Baileys is a TypeScript and JavaScript library for interacting directly with the WhatsApp Web protocol over WebSockets. It does not require Selenium, Chromium, or another browser process to maintain a WhatsApp session. Accounts can be linked through WhatsApp’s multi-device system using QR codes or pairing codes. The library exposes events and socket APIs for messages, chats, contacts, groups, presence, media, and other WhatsApp Web behaviors. Its architecture is widely used as a foundation for bots, integrations, and custom messaging clients. Baileys is community-maintained and has introduced major API changes across recent releases, so applications should follow its current migration guidance. The maintainers explicitly discourage spam, stalkerware, and abusive automated messaging.
Features
- Direct WhatsApp WebSocket connection
- Multi-device authentication
- QR code and pairing code login
- Messaging and media APIs
- Group and contact event handling
- TypeScript-first development