wwebjs/whatsapp-web.js
Node.js WhatsApp client driving WhatsApp Web via Puppeteer
What
Unofficial library that logs into WhatsApp Web in a headless browser and exposes events and methods for messages, media, groups and more.
How to use
// npm i whatsapp-web.js qrcode-terminal
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('message', (msg) => { if (msg.body === '!ping') msg.reply('pong'); });
client.initialize();Reach for it when
Quick WhatsApp bots or automations in Node. Unofficial, so accounts can be banned; use the Cloud API for production.