Skip to content

Baileys

A TypeScript/JavaScript library for building WhatsApp Web clients over WebSockets, without a browser.

Stars
11.5k
Forks
3.5k
Licence
MIT
Language
JavaScript
Last update
5 days ago
Type
Library

What it is

Baileys is a library that lets a developer write code that talks to WhatsApp Web directly over a WebSocket connection. The README says it does not need Selenium or a browser, which it notes saves a large amount of RAM. Developers use it to build bots and tools that connect to WhatsApp accounts, such as sending and receiving messages and managing groups.

  • Send text, media, location, contact, poll and reaction messages from a script
  • Receive and handle incoming message events
  • Create groups and manage participants, settings and invite codes
  • Download media from messages and fetch profile pictures or chat history

Great for

  • Developers who want to script WhatsApp message handling in TypeScript or JavaScript
  • Teams that want to avoid running a headless browser for WhatsApp Web integration
  • Developers comfortable reading library docs and handling events and session storage themselves

Not ideal for

  • Non-developers looking for a ready-made app, since this is a code library with no end-user interface
  • Businesses seeking an official WhatsApp integration, because the README states the project is unaffiliated with WhatsApp and does not endorse use that violates WhatsApp's Terms of Service
  • Anyone planning spam, bulk or automated messaging, or stalkerware, which the README explicitly discourages
Step-by-step guide: how to use BaileysInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js or Bun or Deno (the README does not specify versions) · yarn (used in the README's example and install commands)

    Install the stable version

    yarn add @whiskeysockets/baileys

    Install the edge version from GitHub

    yarn add github:WhiskeySockets/Baileys
  2. 2

    Run it

    • Clone or download the repository
    • Run `cd path/to/Baileys` then `yarn`
    • Run `yarn example` to execute Example/example.ts
    • Import with `import makeWASocket from '@whiskeysockets/baileys'` in your own code
  3. 3

    Get the most out of it

    • Read the migration guide linked in the README if you are upgrading to 7.0.0
    • Use the Connect with QR Code or Pairing Code sections to choose how to link an account
    • Review the Caching Group Metadata section, which the README marks as recommended
    • Use the Handling Events section to respond to incoming messages

Downloads

Strengths

  • Connects directly over WebSockets, so it does not require Selenium or a browser, per the README
  • Covers many WhatsApp Web features, including messages, groups, privacy settings and media
  • Written in TypeScript with an example file and a documentation site linked from the README

Trade-offs

  • The README warns of breaking changes in 7.0.0 and the latest release is a release candidate, so APIs may change
  • The README says the project is unofficial and that use may conflict with WhatsApp's Terms of Service, which carries account risk
  • The README is marked temporary and points to an external docs site for the full guide

How it compares

ProjectStarsTypeLevelUpdatedBest for
Baileys (this)11.5kLibraryintermediate5 days agoDevelopers who want to script WhatsApp message handling in TypeScript or JavaScript
hono32.8kLibrarybeginner5 days agoDevelopers writing TypeScript or JavaScript HTTP APIs
kysely14.3kLibraryintermediate4 days agoTypeScript developers who want SQL control without losing compile-time type checks
workerman11.5kLibraryintermediate13 days agoPHP developers who need a long-running socket or WebSocket server
deno109kAppbeginner8 days agoDevelopers who want to run TypeScript without a separate build setup
OpenWA16.5kAppintermediate4 days agoDevelopers who want to automate WhatsApp messages from their own systems

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.