Skip to main content

Welcome to Baileys

Bailey is a WebSockets-based TypeScript library for interacting with the WhatsApp Web API. Unlike other solutions, Baileys doesn’t require Selenium or any browser automation - it communicates directly with WhatsApp Web using WebSockets, saving you significant resources and complexity.
Baileys supports both the multi-device and web versions of WhatsApp, allowing your application to act as a secondary WhatsApp client.

Why Baileys?

Lightweight

No Selenium or Chromium required - saves approximately half a gigabyte of RAM compared to browser-based solutions.

TypeScript-first

Fully typed with IntelliSense support, making development faster and safer with comprehensive type definitions.

Multi-device support

Works with WhatsApp’s multi-device API, allowing authentication via QR code or pairing code.

Feature-rich

Send messages, media, polls, reactions, manage groups, handle events, and much more with a single unified API.

Key features

Baileys provides comprehensive WhatsApp functionality:
  • Direct WebSocket connection - No browser automation overhead
  • Multiple authentication methods - QR code scanning or pairing code
  • Rich messaging - Text, media (images, videos, audio), locations, contacts, polls, reactions, and more
  • Group management - Create groups, manage participants, update settings, and handle invites
  • Event handling - Real-time events for messages, presence, calls, and connection updates
  • Privacy controls - Manage blocking, online status, read receipts, and disappearing messages
  • Session persistence - Save and restore authentication state across restarts

Getting started

Installation

Install Baileys using your preferred package manager

Quickstart

Get up and running with a working example in minutes

API Reference

Explore the complete API documentation

Discord Community

Join the community for support and discussions

Important disclaimer

This project is not affiliated with WhatsApp or Meta. Use Baileys responsibly and in accordance with WhatsApp’s Terms of Service. The maintainers do not condone spam, stalkerware, bulk messaging, or any automated usage that violates WhatsApp’s policies.
The official WhatsApp website can be found at whatsapp.com. “WhatsApp” and related trademarks are registered trademarks of their respective owners.

Requirements

Baileys requires Node.js version 20.0.0 or higher to run properly.

Community and support

For business or enterprise-level support, you can book time with the current maintainer. See the GitHub repository for details.

Build docs developers (and LLMs) love