whatsapp-baileys

Integrate WhatsApp messaging into Node.js apps using Baileys with QR authentication.

Updated May 18, 2026
One-click install
npx skills add https://github.com/lucasloutayf/barberia-evolution --skill whatsapp-baileys-lucasloutayf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: whatsapp-baileys
Source: https://github.com/lucasloutayf/barberia-evolution/tree/main/.agents/skills/whatsapp-bayleis
Command: npx skills add https://github.com/lucasloutayf/barberia-evolution --skill whatsapp-baileys-lucasloutayf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Integrate WhatsApp messaging into a Node.js application using the Baileys library with QR-based authentication and persisted sessions. The solution covers installation, automatic reconnection, sending and receiving messages (text, image, document, audio), and integration with Express apps or existing servers, plus guidance on common errors.

Core Features & Use Cases

  • Manage WhatsApp connectivity through a Baileys-powered socket with multi-file auth state and QR code handling.
  • Send and receive messages (text, image, document, audio) within Node.js applications or APIs.
  • Support for Express/HTTP endpoints and server-side automation with automatic session persistence and reconnection.

Quick Start

Create a Node.js app, install Baileys, and run the provided connectToWhatsApp example to start scanning the QR and establish a persistent session.

Frequently Asked Questions about whatsapp-baileys

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate WhatsApp messaging into a Node.js application?

You integrate WhatsApp messaging into a Node.js application using the Baileys library with QR-based authentication and persistent sessions. It supports sending and receiving text, image, document, and audio messages within Express or existing servers.

Can I persist WhatsApp sessions and handle automatic reconnection in Node.js?

Yes, WhatsApp sessions are persisted in the auth_info_baileys directory using multi-file auth state. The Baileys socket includes automatic reconnection and robust error handling to maintain connectivity across server restarts.

What's the best way to authenticate a WhatsApp bot using Baileys?

The best way to authenticate a WhatsApp bot using Baileys is through QR-based authentication. The library generates a QR code in the terminal using the qrcode-terminal dependency, which you scan to establish a persistent connection.

Does the Baileys WhatsApp integration support sending images, documents, and audio?

Yes, the Baileys WhatsApp integration supports sending and receiving text, image, document, and audio messages. It handles multimedia payloads directly within Node.js applications or Express HTTP endpoints.

What Node.js version is required to use Baileys for WhatsApp integration?

Using Baileys for WhatsApp integration requires Node.js 20 or higher and Baileys version 7 or higher. You also need to install the qrcode-terminal and pino dependencies for QR rendering and logging.

Why does my WhatsApp Baileys session disconnect when the Express server restarts?

Session disconnections during Express server restarts are handled by automatic reconnection logic. Credentials are persisted in the auth_info_baileys directory, allowing the Baileys socket to restore the session automatically without a new QR scan.