pedroslopez /whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app

★ 22,911⑂ 5,206👁 359⑃ 1,385● 3,088▤ 125
JavaScriptApache-2.0Created 2019-02-17wwebjs.dev
下载:v1.34.8v1.34.8 ↓1.34.82026-11-12
+2
日增长
+60
周增长
+172
月增长
22,911
stars
5,206
forks
359
watchers
1,385
prs
3,088
issues
125
releases

README

About

whatsapp‑web.js is a powerful [Node.js][nodejs] library that lets you interact with WhatsApp Web, making it easy to build a dynamic WhatsApp API with nearly all features of the web client. It uses [Puppeteer][puppeteer] to access WhatsApp Web’s internal functions and runs them in a managed browser instance to reduce the risk of being blocked.

 Links

- [GitHub][gitHub]
- [Guide][guide] ([source][guide-source])
- [Documentation][documentation] ([source][documentation-source])
- [Discord Server][discord]
- [npm][npm]

 Installation

Node.js v18.0.0 or higher, is required.

sh
npm install whatsapp-web.js
yarn add whatsapp-web.js
pnpm add whatsapp-web.js


Having trouble installing? Take a peak at the [Guide][guide] for more detailed instructions.

 Example usage

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

const client = new Client();

client.on('qr', (qr) = {
    qrcode.generate(qr, { small: true });
});

client.on('ready', () = {
    console.log('Client is ready!');
});

client.on('message', (msg) = {
    if (msg.body == '!ping') {
        msg.reply('pong');
    }
});

client.initialize();


Take a look at [example.js][examples] for additional examples and use cases.  
For more details on saving and restoring sessions, check out the [Authentication Strategies][auth-strategies].

 Supported features

| Feature                                          | Status                                       |
| ------------------------------------------------ | -------------------------------------------- |
| Multi Device                                     | ✅                                           |
| Send messages                                    | ✅                                           |
| Receive messages                                 | ✅                                           |
| Send media (images/audio/documents)              | ✅                                           |
| Send media (video)                               | ✅ [(requires Google Chrome)][google-chrome] |
| Send stickers                                    | ✅                                           |
| Receive media (images/audio/video/documents)     | ✅                                           |
| Send contact cards                               | ✅                                           |
| Send location                                    | ✅                                           |
| Send buttons                                     | ❌ [(DEPRECATED)][deprecated-video]          |
| Send lists                                       | ❌ [(DEPRECATED)][deprecated-video]          |
| Receive location                                 | ✅                                           |
| Message replies                                  | ✅                                           |
| Join groups by invite                            | ✅                                           |
| Get invite for group              

Top issues

Latest release

v1.34.8 v1.34.8 2026-11-12
What's Changed
 fix: block unblock contact by @BenyFilho in https://github.com/wwebjs/whatsapp-web.js/pull/201753
 refactor: auth store handling by @RC047 in https://github.com/wwebjs/whatsapp-web.js/pull/201667
 feat: support big file downloads (read from WA cache + streaming) by @Adi1231234 in https://github.com/wwebjs/whatsapp-web.js/pull/201697
 fix: prevent duplicate ready events on SPA re-injection by @Adi1231234 in https://github.com/wwebjs/whatsapp-web.js/pull/201653
 fix: use WWebJS.getChat for inviteV4 fallback in addParticipants by @ashmitmittal in https://github.com/wwebjs/whatsapp

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON