Skip to main content

System Requirements

Before installing Baileys, ensure your system meets these requirements:
  • Node.js: Version 20.0.0 or higher
  • Package Manager: npm, yarn, pnpm, or bun
  • Operating System: Linux, macOS, or Windows
Baileys requires Node.js 20+ due to its use of modern JavaScript features and native modules.

Installing Baileys

Choose your preferred package manager to install Baileys:
npm install @whiskeysockets/baileys

Edge Version (Latest Features)

If you want the latest features and fixes (with no stability guarantee), install directly from GitHub:
npm install github:WhiskeySockets/Baileys
The edge version may contain breaking changes and unstable features. Use in production at your own risk.

Optional Dependencies

Baileys has several optional dependencies that enable additional features: To generate link previews in messages:
npm install link-preview-js

Media Thumbnail Generation

For automatic thumbnail generation in images and stickers, install one of:
npm install jimp
sharp is faster and more memory efficient, but requires native compilation. jimp is pure JavaScript and works everywhere.

Video Thumbnail Generation

For video thumbnails, install ffmpeg on your system:
sudo apt update
sudo apt install ffmpeg

Audio Processing

For audio format conversion (optional):
npm install audio-decode

TypeScript Setup

Baileys is written in TypeScript and includes full type definitions. For TypeScript projects, no additional setup is required.

Importing in Your Project

import makeWASocket from '@whiskeysockets/baileys'

Verification

Verify your installation by creating a simple test file:
test.ts
import makeWASocket from '@whiskeysockets/baileys'

console.log('Baileys imported successfully!')
console.log('makeWASocket is a', typeof makeWASocket)
Run it:
npx tsx test.ts
You should see:
Baileys imported successfully!
makeWASocket is a function

Breaking Changes Notice

Version 7.0.0 introduced multiple breaking changes. If you’re upgrading from an earlier version, check the migration guide.

Next Steps

Quick Start Guide

Create your first connection and send a message

Authentication

Learn about authentication and session management

Socket Configuration

Explore all available configuration options

Example Code

View the complete example implementation

Build docs developers (and LLMs) love