Skip to content

About

Wasm bridge of whatsapp-rust

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

@oxidezap/whatsapp-rust-bridge

npm version npm downloads pkg.pr.new

High-performance WhatsApp utilities powered by Rust and WebAssembly.

Features

Feature Status
Binary Protocol ✅
Libsignal ✅
App State Sync ✅
Audio (waveform, duration) ✅
Image (thumbnails, conversion) ✅
Sticker Metadata ✅

Preview builds

Every commit CI builds and tests — on main and on every pull request — then uploads that build to pkg.pr.new, installable from a URL. Nothing is published to npm, so a fix can be tried before it reaches a release:

# the head of a pull request, following it as new commits land
npm install https://pkg.pr.new/@oxidezap/whatsapp-rust-bridge@88

# one specific commit
npm install https://pkg.pr.new/@oxidezap/whatsapp-rust-bridge@7ef8db0

Every open pull request comments the URL for its own head, and pkg.pr.new/~/oxidezap/whatsapp-rust-bridge lists what is available. Two things leave a commit without one. A release version bump is not built at all — CI skips a diff that cannot reach the build, and that commit is on its way to npm anyway. And the upload does not fail the run: pkg.pr.new is not this repository's to keep up, so a green commit with no preview means it was unreachable, not that the build was bad.

The tarball is the one the run built and tested: the same bun run build output, packed through the same prepack guard a real publish goes through. What it is not is a release. Preview builds carry the version 0.0.0-preview-<sha>, which no range written for a real release can match — an install is a deliberate pin, and it stays on that commit until you change it. They are for trying a change, not for running one.

Host-loaded runtimes

On Node and Bun the default entrypoint finds and loads the wasm itself:

import { createWhatsAppClient } from "@oxidezap/whatsapp-rust-bridge";

Hosts without filesystem access (Cloudflare Workers, workerd, Deno, browsers) supply the wasm instead. Import the asset through the ./wasm subpath — a static import, which workerd/wrangler compile to a WebAssembly.Module — and pass it to initSync from ./host:

import wasm from "@oxidezap/whatsapp-rust-bridge/wasm";
import {
  initSync,
  createWhatsAppClient,
} from "@oxidezap/whatsapp-rust-bridge/host";

initSync({ module: wasm });

Call initSync once per isolate, and on workerd create clients inside a request handler rather than at global scope (crypto.getRandomValues is unavailable during global-scope evaluation).

About

Wasm bridge of whatsapp-rust

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages