It re-pairs (shows a QR) on every restart
It re-pairs (shows a QR) on every restart
Logs say "received socket payload before noise session init"
Logs say "received socket payload before noise session init"
close event from a socket whose close() had already timed out reached the live handlers and tore down the new noise session, leaving the new socket open with no session and no reconnect, so every later payload was dropped with that message. Socket events and noise sessions are now bound to the connection they belong to.A freshly paired companion disappears from Linked devices
A freshly paired companion disappears from Linked devices
pair-success, while the signing frame was still queued, so the device was listed without a key-index and the primary removed it. Pairing now waits for the server’s stream:error 515 before restarting. See After the phone accepts.A pairing code stops working after a brief disconnect
A pairing code stops working after a brief disconnect
primary_hello only reaches the connection that sent the companion_hello, so a reconnect silently killed the code. zapo now re-registers a pending code on the new connection; if that fails, auth_pairing_required fires with forceManual: true so you can render a fresh one.Group messages go missing when the sender key arrives
Group messages go missing when the sender key arrives
pkmsg with the sender key and an skmsg that failed to decrypt, the successful pkmsg suppressed the retry receipt, so the group message was simply lost. A failed skmsg now triggers a retry receipt even when another <enc> of the same stanza decrypted.The client doesn't reconnect after a drop
The client doesn't reconnect after a drop
zapo does not auto-reconnect. Listen for the connection event with status: 'close' and call connect() again (skip it when isLogout is true). See the reconnection pattern.My media sends but has no preview / dimensions / waveform
My media sends but has no preview / dimensions / waveform
@zapo-js/media-utils — but without it there’s no processor to generate thumbnails/previews, image-video dimensions, or voice-note waveforms, so it can render as a plain attachment or with no preview. For proper media, install it (npm i @zapo-js/media-utils, plus ffmpeg/ffprobe) and wire a processor through the media option. See Media.Prefer a stream over a Buffer for media
Prefer a stream over a Buffer for media
string) or a Readable stream to media, not a Buffer — zapo streams the bytes through the pipeline so memory stays flat for large files. On download, prefer downloadToFile/download over downloadBytes.Proxy isn't being used
Proxy isn't being used
proxy.ws leg needs the ws package (the runtime’s native WebSocket can’t take an HTTP Agent). Media/link-preview legs use an undici dispatcher. See the proxy examples for SOCKS/HTTP/HTTPS and IPv4/IPv6.Which JID do I reply to in a group?
Which JID do I reply to in a group?
event.key.remoteJid (the group JID), never a participant’s JID. When you have a peer’s LID, prefer the LID — it’s the privacy-preserving, forward-compatible identity. See Identities (PN vs LID).I receive my own outgoing messages
I receive my own outgoing messages
message event flagged key.fromMe === true. Filter them out if you only want inbound traffic. See Receiving messages.How do I type the message handler in TypeScript?
How do I type the message handler in TypeScript?
Can I register a brand-new number (mobile)?
Can I register a brand-new number (mobile)?
zapo intentionally does not provide a registration API — registering a number is complex and requires a physical phone. You connect with already-registered credentials. See Mobile connections.QR or 8-character code — which should I use?
QR or 8-character code — which should I use?
auth_qr event). For an 8-character code, call client.auth.requestPairingCode(phone) after the auth_pairing_required event. See Authentication.logout() vs disconnect()
logout() vs disconnect()
disconnect() closes the socket but keeps credentials so you can resume later. logout() unlinks the device server-side and clears stored state (per logoutStoreClear). See Authentication.Handshake fails with HTTP 405 / failure_client_too_old
Handshake fails with HTTP 405 / failure_client_too_old
zapo when possible. As a stopgap, set recoverFromClientTooOld: true to auto-fetch the current version and retry, or pass a version resolver that returns a fresh string per connect. See WhatsApp Web version.Still stuck?
Architecture in depth
Low-level API
lowlevel.