explaingit

whiskeysockets/baileys

9,315JavaScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

A TypeScript library for Node.js that lets you send and receive WhatsApp messages from code without running a browser, connects directly to WhatsApp's servers over WebSocket.

Mindmap

mindmap
  root((Baileys))
    What it does
      Send messages
      Receive messages
      Manage groups
      Media handling
    Features
      No browser needed
      Low memory use
      QR or pairing code
      Session persistence
    Tech stack
      TypeScript
      Node.js
      WebSocket
      npm
    Use cases
      WhatsApp bots
      Message automation
      Group management
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a WhatsApp chatbot that responds automatically to incoming messages using Node.js.

USE CASE 2

Send WhatsApp messages, images, or voice notes programmatically from a server-side script.

USE CASE 3

Manage WhatsApp group chats: add members, update group info, and track message reactions from code.

USE CASE 4

Save and restore a WhatsApp session so your bot stays connected across server restarts without re-scanning a QR code.

Tech stack

TypeScriptJavaScriptNode.jsWebSocketnpm

Getting it running

Difficulty · moderate Time to first run · 30min

Requires an active WhatsApp account and a QR code or pairing code scan to authenticate the session before any messages can be sent.

No license information was found in the explanation.

In plain English

Baileys is a TypeScript and JavaScript library that lets developers build programs which interact with WhatsApp through the WhatsApp Web interface. Rather than automating a web browser, Baileys communicates directly with WhatsApp's servers over a WebSocket connection. This means it does not need a running browser in the background and uses significantly less memory as a result. The library supports both the multi-device and web versions of WhatsApp. Using Baileys, a developer can write code that sends and receives messages, handles media like images, video, audio, and GIFs, manages group chats, reads and updates profile information, tracks typing indicators and presence, handles polls and reactions, and archives or deletes conversations. Connections can be established by scanning a QR code or using a pairing code, and session credentials can be saved so the account stays connected across restarts. The library is installed via npm or Yarn and imported into a Node.js, Deno, or Bun project. A working example script is included in the repository that demonstrates many common operations. Full documentation lives on a separate website at baileys.wiki, and community support takes place through a Discord server. Baileys is not affiliated with or endorsed by WhatsApp. The maintainers explicitly discourage using it for spam, bulk messaging, automated outreach, or stalkerware, and ask users to apply personal responsibility in how they use the library. Enterprise-level support from the current maintainer is available for hire, and businesses are encouraged to sponsor the project given the substantial ongoing development effort. The original repository was removed by its initial author, and this repository is the current community-maintained continuation. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Write a Node.js script using Baileys that connects to WhatsApp via QR code, listens for incoming messages, and auto-replies with 'Hello!' to any text message it receives.
Prompt 2
Using Baileys, show me how to send an image file with a caption to a specific WhatsApp contact number from a Node.js script.
Prompt 3
How do I save Baileys session credentials to disk so my WhatsApp bot reconnects automatically after a server restart without scanning the QR code again?
Prompt 4
Write a Baileys script that monitors a WhatsApp group and logs every new message, including the sender name, timestamp, and message text, to a local file.
Prompt 5
Show me how to use Baileys to create a WhatsApp poll in a group chat and then read the poll results when participants vote.
Open on GitHub → Explain another repo

← whiskeysockets on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.