This page collects the answers to questions that come up most often in issues and the community. If your question isn’t here, browse the rest of the docs or open a discussion on GitHub.Documentation Index
Fetch the complete documentation index at: https://whiskeysockets-docs-jids-socket-config-ptbr.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Is Baileys affiliated with WhatsApp?
No. Baileys is an independent open-source library that connects to WhatsApp Web’s WebSocket protocol via the Linked Devices feature. It does not use the WhatsApp Business API. Use it at your own discretion — do not spam, and do not build stalkerware.Why does my socket disconnect right after I scan the QR code?
That’s expected. After you scan the QR, WhatsApp forces a reconnect so Baileys can present full credentials. Watch forDisconnectReason.restartRequired in connection.update and reopen the socket. See Connect with a QR code.
Why isn’t the QR code printing in my terminal?
TheprintQRInTerminal socket option is deprecated. Listen for the qr field on connection.update and render it yourself with a library like qrcode-terminal or qrcode.
Why are my messages stuck on “this message can take a while”?
WhatsApp’s retry system requires you to return the original message when delivery fails. ImplementgetMessage in your socket config so Baileys can re-encrypt and resend it.
Should I use useMultiFileAuthState in production?
No. It is fine for development and small bots, but it does heavy disk I/O that doesn’t scale. Use its implementation as a reference and back your real auth store with a database. See Save and restore WhatsApp sessions.
How do I receive my full chat history?
SetsyncFullHistory: true and use a desktop browser preset. Both options are part of the socket config — see Receiving full message history.
messaging-history.set event after the connection opens. Large histories noticeably increase startup time and memory.
What is a LID and why do I see them instead of phone numbers?
A LIDJID (Linked Identity Jabber Identifier, on@lid) is a per-user, anonymized identifier WhatsApp assigns to each account. The legacy phone-number form is the PNJID (Phone Number Jabber Identifier, on @s.whatsapp.net). By default, all new Signal sessions are LID-based as of Baileys 7.x. You can resolve a PNJID to its LIDJID via onWhatsApp() or getLIDForPN, but not generally the reverse. Don’t try to restore PN JIDs in your application — migrate to LIDs. See WhatsApp JIDs explained and Migrate to Baileys v7.
Why am I getting rate-limited or banned when sending to groups?
EverysendMessage call to a group fetches the group participant list to encrypt to each member. Without caching, this hits the rate limit fast. Provide a cachedGroupMetadata callback in the socket config:
Should I always update to the latest WhatsApp Web version?
No. Avoid callingfetchLatestWaWebVersion on every connect — newer versions can be incompatible. Stay one or two versions behind, and only override the version when you know your protobufs match. The default version Baileys ships with is the recommended one.
How do I stop notifications from disappearing on my phone?
Baileys marks your presence as online on connect by default, which suppresses phone notifications. SetmarkOnlineOnConnect: false in the socket config. You can also send sock.sendPresenceUpdate('unavailable') periodically to keep mobile notifications flowing.
Is the Mobile API supported?
No. Baileys only supports WhatsApp Web’s protocol via Linked Devices. Pairing-code authentication is not the Mobile API — it’s an alternative to QR codes for the same Linked Devices flow.Where do I report bugs or get help?
- Bugs: GitHub Issues
- Feature discussion: GitHub Discussions
- Migration questions: see Migrate to Baileys v7 and Migrate to Baileys v8