Skip to main content

Documentation Index

Fetch the complete documentation index at: https://zapo.to/llms.txt

Use this file to discover all available pages before exploring further.

zapo is organized around a thin client that delegates every feature to a focused coordinator. The client owns the connection, authentication, and event emitter; coordinators own the domain logic.

The client

WaClient is the single entry point. You construct it with options and an optional logger, then call connect():
const client = new WaClient({ store, sessionId: 'default' }, logger)
await client.connect()
The client itself exposes only a small surface: connection lifecycle (connect, disconnect, logout), state queries (getState, getCredentials), and the typed event emitter (on, once, off). Everything else lives behind a coordinator getter.

Coordinators

Each coordinator is reached through a getter on the client. They are lazily wired at construction and are safe to hold references to.
GetterCoordinatorResponsibility
client.authWaAuthClientPairing, credentials, registration state
client.messageWaMessageCoordinatorSend/receive, receipts, media download, addons
client.presenceWaPresenceCoordinatorOwn/peer presence and chat-state
client.chatWaAppStateMutationCoordinatorChat settings: mute, pin, archive, read, delete
client.groupWaGroupCoordinatorGroups and communities
client.newsletterWaNewsletterCoordinatorChannels: create, send, follow, admin
client.statusWaStatusCoordinatorStatus broadcast send and reactions
client.broadcastListWaBroadcastListCoordinatorBroadcast list management and sends
client.privacyWaPrivacyCoordinatorPrivacy categories, blocklist
client.profileWaProfileCoordinatorProfile picture, status text, username
client.businessWaBusinessCoordinatorBusiness profile, verified names
client.botWaBotCoordinatorBot profiles and prompts (Meta AI and others)
client.emailWaEmailCoordinatorBind/verify email on the account
client.lowlevelWaLowLevelCoordinatorRaw node send/query escape hatch
Because the coordinator types are exported from the package root, you can annotate them in TypeScript:
import type { WaGroupCoordinator } from 'zapo-js'

const groups: WaGroupCoordinator = client.group

Data flow

  • Incoming: frames are decoded into binary nodes, parsed and normalized into typed event payloads, then emitted (message, receipt, group, …).
  • Outgoing: your call to a coordinator (e.g. client.message.send) is built into a protocol node, encrypted, and written to the socket; the coordinator resolves once the server acks.

Engineering conventions

If you read the source, these conventions are pervasive and explain a lot of the API shape:
  • Uint8Array everywhere for binary data (Buffer is avoided), with zero-copy views in hot paths.
  • Named exports only — there are no default exports.
  • No enums — constants use Object.freeze({ ... } as const), surfaced as the WA_* objects.
  • Bounded in-memory structures to prevent unbounded growth in long-lived processes.

Next

Authentication

Pairing with QR or an 8-digit code, and credential lifecycle.

Events

The full event map and how to listen.

Stores

Providers, domains, and backends.

Configuration

Every WaClientOptions field explained.
Last modified on May 27, 2026