Installation
Get started with Baileys by installing it via your preferred package manager.Requirements
Before installing Baileys, ensure your environment meets these requirements:- Node.js: Version 20.0.0 or higher
- Package Manager: npm, yarn, or pnpm
Baileys requires Node.js 20+ due to dependencies on modern JavaScript features and native modules.
Install Baileys
Choose your preferred package manager to install Baileys:Install the edge version
If you need the latest features and bug fixes (with no stability guarantee), you can install directly from GitHub:Optional dependencies
Baileys includes several optional peer dependencies that enable additional features:Media processing
For automatic thumbnail generation and image processing:Link previews
To enable automatic link preview generation in messages:Audio processing
For audio decoding and processing:Additional tools
FFmpeg (for video thumbnails)
To generate thumbnails for video messages, install FFmpeg on your system:Audio conversion
For audio messages to work properly across all devices, you need to convert them to Opus format. Install FFmpeg (shown above) and use these flags:codec: libopus- OGG file formatac: 1- One audio channel (mono)avoid_negative_ts make_zero- Timestamp handling
Import Baileys
Once installed, import Baileys in your TypeScript or JavaScript files:Verify installation
Create a simple test file to verify everything is working:test.ts
Next steps
Quick start guide
Learn how to create your first WhatsApp bot with Baileys