Simple, powerful WhatsApp API for Node.js — powered by Neonize.
- 🚀 Simple API - Send messages in just a few lines of code
- 📱 Full WhatsApp Support - Messages, media, groups, reactions, polls & more
- 🔒 Multi-Device - Works with WhatsApp's multi-device protocol
- ⚡ High Performance - Native Go library via FFI
- 📦 Zero Config - Just install and connect
npm install @azizemad/neonize-nodeThe native library is automatically downloaded on install.
| Platform | Architecture | Status |
|---|---|---|
| Windows | x64 | ✅ |
| Linux | x64 | ✅ |
| Linux | ARM64 | ✅ |
| macOS | x64 | ✅ |
| macOS | ARM64 (M1+) | ✅ |
import { WhatsApp } from '@azizemad/neonize-node';
const wa = new WhatsApp();
wa.onMessage((msg) => {
console.log(`${msg.sender}: ${msg.text}`);
if (msg.text === 'ping') {
msg.reply('pong 🏓');
}
});
wa.onConnected(() => {
console.log('Connected! My number:', wa.myNumber);
});
wa.connect();// Text message
wa.send('1234567890', 'Hello from neonize-node!');
// Image with caption
wa.sendImage('1234567890', './photo.jpg', 'Check this out!');
// Document
wa.sendDocument('1234567890', './file.pdf', 'document.pdf');
// Poll
wa.sendPoll('1234567890', 'Best pizza topping?', ['Pepperoni', 'Mushrooms', 'Pineapple']);wa.onMessage((msg) => {
// Reply with quoted context
msg.reply('Thanks for your message!');
// React to the message
msg.react('👍');
// Delete the message (your own messages only)
msg.delete();
// Download media
if (msg.hasImage) {
const buffer = msg.downloadMedia();
fs.writeFileSync('image.jpg', buffer);
}
});// Get all groups
const groups = wa.getGroups();
// Get group info
const info = wa.getGroupInfo('123456789@g.us');For full control, use the NewClient class directly:
import { NewClient, Event, EventType } from '@azizemad/neonize-node';
const client = new NewClient('session.db');
// Set up event handling
client.event.onMessage((client, message) => {
console.log('Received:', message);
});
client.event.onConnected((client) => {
console.log('Connected!');
// Full API access
client.sendMessage(jid, { conversation: 'Hello!' });
client.sendReaction(chatJid, senderJid, messageId, '❤️');
client.editMessage(chatJid, messageId, 'Edited text');
// ... and 90+ more methods
});
await client.connect();| Method | Description |
|---|---|
onMessage(handler) |
Handle incoming messages |
onConnected(handler) |
Handle connection |
onQR(handler) |
Handle QR code display |
onDisconnected(handler) |
Handle disconnection |
send(to, text) |
Send text message |
sendImage(to, image, caption?) |
Send image |
sendVideo(to, video, caption?) |
Send video |
sendDocument(to, doc, filename) |
Send document |
sendPoll(to, question, options) |
Send poll |
getGroups() |
Get joined groups |
getGroupInfo(groupId) |
Get group details |
connect() |
Start connection |
disconnect() |
Close connection |
logout() |
Logout and clear session |
| Property | Description |
|---|---|
text |
Message text content |
sender |
Sender's phone number |
chatId |
Chat identifier |
id |
Message ID |
isGroup |
Is from a group? |
isFromMe |
Is from yourself? |
hasImage |
Has image attachment? |
hasVideo |
Has video attachment? |
hasDocument |
Has document attachment? |
| Method | Description |
|---|---|
reply(text) |
Reply with quoted context |
react(emoji) |
React with emoji |
delete() |
Delete/revoke message |
downloadMedia() |
Download media as Buffer |
The session is stored in a SQLite database. Default is neonize.db in the current directory.
const wa = new WhatsApp('my-session.db');Enable debug logging:
const client = new NewClient('session.db', {
logLevel: 'DEBUG' // DEBUG, INFO, WARN, ERROR
});
client.event.debug(true);- Node.js 18.0.0 or higher
- Windows, Linux, or macOS (x64 or ARM64)
The native library wasn't downloaded. Run manually:
node node_modules/@azizemad/neonize-node/scripts/download.jsThis usually means the session is corrupted. Delete the .db file and try again.
MIT © See LICENSE for details.