Documentation Index
Fetch the complete documentation index at: https://zapo.to/llms.txt
Use this file to discover all available pages before exploring further.
client.lowlevel (WaLowLevelCoordinator) is the raw escape hatch beneath the typed coordinators. Use it to send protocol stanzas the high-level API doesn’t cover, issue custom IQs, or intercept inbound stanzas.
Binary nodes
Everything here speaksBinaryNode — zapo’s representation of a WhatsApp protocol stanza:
Sending a node
sendNode writes a raw stanza. Failures that look like a transient receipt-send issue are buffered to the receipt queue and logged rather than thrown.
Issuing an IQ
query sends an IQ stanza and awaits the matching response (within timeoutMs). It throws if the client isn’t connected.
| Param | Type | Notes |
|---|---|---|
node | BinaryNode | The IQ to send. |
timeoutMs | number | Response timeout. Defaults to the IQ default (60s). |
options.useSystemId | boolean | Use a system-generated stanza id. |
Intercepting incoming nodes
Register a handler for inbound nodes that match atag (and optional subtype). The handler returns a Promise<boolean> — return true when you’ve handled the node. registerIncomingHandler returns an unregister function.
WaIncomingNodeHandlerRegistration:
Filtering inbound stanzas
A stanza filter runs before the typed handlers. Returntrue to drop a stanza entirely. zapo still sends the appropriate ack for message/receipt/notification, so the server stops re-delivering it.
| Method | Signature |
|---|---|
sendNode | (node: BinaryNode) => Promise<void> |
query | (node, timeoutMs?, options?) => Promise<BinaryNode> |
registerIncomingHandler | (registration) => () => void |
unregisterIncomingHandler | (registration) => boolean |
registerIncomingStanzaFilter | (filter) => () => void |
