Jugaad
Jugaad Tool MITIntermediateWhatsApp & SupportFree

Baileys

A TypeScript/JavaScript library for connecting Node.js apps to WhatsApp Web over WebSockets, without a browser.

Stars
12k
Forks
3.5k
Last update
1 Nov 2026

Overview

Baileys lets developers send and receive WhatsApp messages, manage groups, and listen for real-time events through a Node.js application. It connects directly over WebSockets and supports QR-code or pairing-code authentication. It is unofficial and not affiliated with WhatsApp; the maintainers discourage bulk or automated messaging, spam, and stalkerware.

Who it's for

Node.js and TypeScript developersSoftware agencies building custom WhatsApp interfacesTechnical teams evaluating WhatsApp Web integrations

Tech stack

TypeScriptJavaScriptNode.jsWebSocketsqrcode-terminal

Features and benefits

Key features

  • Connects directly to WhatsApp Web over WebSockets without Selenium or Chromium.
  • Supports authentication using a QR code or pairing code.
  • Sends and receives messages.
  • Sends text, media, polls, and reactions.
  • Provides real-time events for messages, connection changes, and group updates.
  • Creates groups, manages participants, and configures group settings.
  • Controls privacy settings and subscribes to presence updates.
  • Supports custom WebSocket callbacks to extend functionality.

Why it helps in Pakistan

  • Avoids running a browser for WhatsApp Web connections.
  • Uses less memory than Selenium-based approaches, according to the official docs.
  • Provides messaging and group functions for custom Node.js applications.
  • Lets developers respond to connection and message events in real time.
  • Allows modification and self-hosting under the MIT licence.

Pakistan use cases

  • 01

    A Karachi software team could prototype a staff-operated tool for replying to individual WhatsApp enquiries.

  • 02

    A Lahore retailer could build a custom interface for staff to share product media in customer conversations.

  • 03

    An Islamabad development agency could build group-management tools for a client's existing WhatsApp groups.

  • 04

    A Pakistani developer could test WhatsApp connection events and QR authentication in a Node.js project.

Requirements

Hardware
Check the official docs
Operating system
Check the official docs
Skills
JavaScript or TypeScript developmentNode.js package managementWorking with event listeners and authentication state
Accounts needed
A WhatsApp account to link using a QR code or pairing code

Setup guide

Commands are copied from the project's README and official docs.

  1. 1

    Check environment compatibility

    Check the official docs. The supplied guide uses a Node.js project but does not specify supported operating systems or Node.js versions.

    Not fully covered in the README. Check the official docs before running this step.

  2. 2

    Install the library

    In your Node.js project, run npm install @whiskeysockets/baileys qrcode-terminal. The qrcode-terminal package renders the pairing QR code in your terminal.
  3. 3

    Create and authenticate the connection

    Follow the official homepage example: use makeWASocket with useMultiFileAuthState, save credentials on creds.update, and render the QR code from connection.update. Scan it with your WhatsApp app to link your account.
  4. 4

    Test a message after connecting

    Use the homepage example to call sock.sendMessage once connection.update reports an open connection. Check the official docs for a valid recipient address and project execution instructions, which are not fully provided in the supplied page.

    Not fully covered in the README. Check the official docs before running this step.

Works with

  • WhatsApp Web

    Connects through its binary WebSocket protocol to exchange messages and access group, privacy, and presence functions. This is an unofficial integration.

  • qrcode-terminal

    Renders the authentication QR code in the terminal in the official setup example.

What it costs

SoftwareFree to self-host under the MIT licence.
HostingHardware and RAM requirements are not stated, so hosting cannot be reliably sized from these sources. Check the official docs and current hosting prices.

FAQ

Is Baileys an official WhatsApp API?

No. It is an unofficial library and is not affiliated with, authorized by, or endorsed by WhatsApp.

Does it need a browser or Selenium?

No. It connects directly to WhatsApp Web over a WebSocket, without Selenium or Chromium.

How do I connect my WhatsApp account?

The docs support QR-code or pairing-code authentication. The homepage example shows scanning a QR code with the WhatsApp app.

Can I use it for bulk or automated messaging?

The README discourages bulk or automated messaging, spam, and stalkerware. Use the library responsibly and in accordance with WhatsApp's Terms of Service.

What should I check before upgrading?

Version 7.0.0 introduced multiple breaking changes. Read the official migration guide before updating an existing integration.

Troubleshooting

An existing integration breaks after upgrading to version 7.

Review the breaking changes and migration instructions at https://whiskey.so/migrate-latest.

The authentication QR code is not displayed in the terminal.

Compare your implementation with the homepage example: install qrcode-terminal and render the qr value received through connection.update; see the official docs.

The first test message is sent before the connection is ready.

Follow the official example and call sock.sendMessage only after connection.update reports connection === 'open'; see the official docs.

A documentation page is missing or incomplete.

The README says the new guide is a work in progress. Consult the linked old guide or NPM homepage, or report missing content through the documentation issue link.

Get it set up for you

Don't want to install it yourself? A Jugaad maker can set up Baileys for your business. Payment is held in Safe Deal until it works.

No maker offers a setup gig for this yet. Post a request and makers will quote.

Post a setup request Paid through Safe Deal

Built by WhiskeySockets and contributors on GitHub. All credit goes to the authors. GitHub stats refresh daily. Jugaad does not host, copy or sell this code.

Is this your project?