21kDiscord

Getting Started

Last updated March 20, 2026

Notice

Before you start, please read the Disclaimer about account safety and responsible usage, as whatsapp-web.js is an unofficial library and may carry risks if misused.

This guide is the only resource you need to start building with WWebJS. It covers everything from installation to creating your first application and beyond.

What You'll Learn

This guide covers everything from basic setup to advanced bot features:

  • Setting up your development environment
  • Creating your first WhatsApp bot
  • Handling messages and media
  • Working with groups and channels
  • Best practices and deployment strategies

Getting Started Path

Start here if you're new to WWebJS:

  1. What is WWebJS? - Understand what this library does
  2. Requirements - Check prerequisites
  3. Installation - Install WWebJS
  4. Project Setup - Organize your code
  5. Application Setup - Build your first bot

Quick Start

The fastest way to get a working bot:

const { Client, LocalAuth } = require('whatsapp-web.js')
const qrcode = require('qrcode-terminal')

const client = new Client({ authStrategy: new LocalAuth() })

client.on('qr', qr => qrcode.generate(qr, { small: true }))
client.on('ready', () => console.log('Bot ready!'))
client.on('message_create', msg => {
  if (msg.body === '!ping') msg.reply('Pong!')
})

client.initialize()

Install dependencies:

npm install whatsapp-web.js puppeteer qrcode-terminal

Run it:

node index.js

Scan the QR code with your WhatsApp phone and start messaging your bot.

Important Notice

Before proceeding, please read the Disclaimer regarding:

  • Account safety and blocking risks
  • Terms of service compliance
  • Official alternatives
  • Responsible usage

If you need to brush up on JavaScript basics:

Features You Can Build

With WWebJS, you can create:

  • Text and media message handlers
  • Automated responses and workflows
  • Group management tools
  • Media processing and archiving
  • Message scheduling
  • Custom command systems
  • Integration with external APIs
  • Real-time notifications

Development Tools

We recommend setting up:

  • ESLint - Catch code errors
  • Prettier - Format code automatically
  • Git - Version control
  • VS Code - Code editor

Learn about Linters and Code Quality.

Community and Support

Join our active community:

What's Next?

Choose your learning path:

Disclaimer

This project is not affiliated with WhatsApp or Meta. Always use responsibly and respect WhatsApp's terms of service. Your account may be at risk of suspension if misused. For critical applications, use official APIs instead.