Documentation Index
Fetch the complete documentation index at: https://zapo.to/llms.txt
Use this file to discover all available pages before exploring further.
It re-pairs (shows a QR) on every restart
It re-pairs (shows a QR) on every restart
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.chatJid (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 isSender: 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-digit code — which should I use?
QR or 8-digit code — which should I use?
auth_qr event). For an 8-digit 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.A business/newsletter operation throws
A business/newsletter operation throws
Still stuck?
Architecture in depth
Low-level API
lowlevel.