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():
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.| Getter | Coordinator | Responsibility |
|---|---|---|
client.auth | WaAuthClient | Pairing, credentials, registration state |
client.message | WaMessageCoordinator | Send/receive, receipts, media download, addons |
client.presence | WaPresenceCoordinator | Own/peer presence and chat-state |
client.chat | WaAppStateMutationCoordinator | Chat settings: mute, pin, archive, read, delete |
client.group | WaGroupCoordinator | Groups and communities |
client.newsletter | WaNewsletterCoordinator | Channels: create, send, follow, admin |
client.status | WaStatusCoordinator | Status broadcast send and reactions |
client.broadcastList | WaBroadcastListCoordinator | Broadcast list management and sends |
client.privacy | WaPrivacyCoordinator | Privacy categories, blocklist |
client.profile | WaProfileCoordinator | Profile picture, status text, username |
client.business | WaBusinessCoordinator | Business profile, verified names |
client.bot | WaBotCoordinator | Bot profiles and prompts (Meta AI and others) |
client.email | WaEmailCoordinator | Bind/verify email on the account |
client.lowlevel | WaLowLevelCoordinator | Raw node send/query escape hatch |
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:Uint8Arrayeverywhere for binary data (Bufferis 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 theWA_*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.