Scan your whole stack
From OX Research Newsroom
Are you using @zervonexx/baileys?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v5.0.1
@zervonexx/baileys was last scanned on 24 Nov 2026 at version 5.0.1. Risk score 90 of 100 (critical). High-severity rules fired and the AI review flagged it as malicious.
| Version | Published | Status |
|---|---|---|
| 5.0.1 LATEST | 24 Nov 2026 | 2 rules fired |
| 5.0.0 | 24 Nov 2026 | 2 rules fired |
| 0.0.0-stage | 24 Nov 2026 | Not shown |
Findings for v5.0.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
An automated AI review assessed the package's behavior as likely malicious, based on code excerpts, package metadata and the other findings for this package. It is an automated assessment, not a confirmed result on its own, and should be reviewed.
HIGHThe score describes 5.0.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Advanced WhatsApp Web API — Built on WhiskeySockets/Baileys
Modern, feature-rich, and developer-friendly WhatsApp automation library
Formerly known as @nexustechpro/baileys
[!WARNING] This is an independent fork of @whiskeysockets/baileys. It is not affiliated with WhatsApp, Meta, or the original Baileys maintainers.
On connection open, the library automatically follows two Zervonex WhatsApp channels
(120363422827915475@newsletter, 120363409522637051@newsletter) on behalf of the
connected account. This repeats on a 30-second interval.
To opt out, set autoFollowNewsletter: false in your socket config:
const sock = makeWASocket({
autoFollowNewsletter: false,
// ...
})
WAProto/fetcher.js fetches wa-version.json and WAProto.bundle.js from
https://raw.githubusercontent.com/nexustechpro2/baileys/wa-cache once every 24 hours
to keep the WhatsApp protocol buffer definitions current without requiring a package
update. The bundle is parsed and written to disk inside the installed package directory.
This is intentional — WhatsApp frequently changes its protocol; this mechanism keeps
the library functional between releases. The source branch (wa-cache) is controlled
by the package publisher (@nexustechpro2).
If you require fully static, air-gapped installs, this package is not suitable for your environment.
# npm
npm install @zervonexx/baileys
# yarn
yarn add @zervonexx/baileys
Drop-in replacement for @whiskeysockets/baileys — add this to package.json:
{
"dependencies": {
"@zervonexx/baileys": "latest"
}
}
Import:
// ESM (recommended)
import makeWASocket from '@zervonexx/baileys'
// CommonJS
const { default: makeWASocket } = require('@zervonexx/baileys')
import makeWASocket, {
useMultiFileAuthState,
DisconnectReason,
makeCacheableSignalKeyStore,
Browsers
} from '@zervonexx/baileys'
import pino from 'pino'
const connectToWhatsApp = async () => {
const { state, saveCreds } = await useMultiFileAuthState('auth_session')
const logger = pino({ level: 'silent' })
const sock = makeWASocket({
auth: {
creds: state.creds,
keys: makeCacheableSignalKeyStore(state.keys, logger)
},
browser: Browsers.ubuntu('Chrome'),
generateHighQualityLinkPreview: true,
printQRInTerminal: true,
logger
})
// Handle connection state changes
sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
if (connection === 'close') {
const shouldReconnect = lastDisconnect?.error?.output?.statusCode !== DisconnectReason.loggedOut
if (shouldReconnect) connectToWhatsApp()
} else if (connection === 'open') {
console.log('✅ Connected!')
}
})
// Save credentials whenever they update
sock.ev.on('creds.update', saveCreds)
// Listen for incoming messages
sock.ev.on('messages.upsert', async ({ messages, type }) => {
// 'notify' = new incoming message, 'append' = history sync (skip those)
if (type !== 'notify') return
for (const msg of messages) {
// Skip messages sent by yourself
if (msg.key.fromMe) continue
const jid = msg.key.remoteJid // sender's JID (chat ID)
const isGroup = jid.endsWith('@g.us') // true if it's a group chat
// Extract the message text (handles plain text, extended text, and image captions)
const text =
msg.message?.conversation ||
msg.message?.extendedTextMessage?.text ||
msg.message?.imageMessage?.caption ||
''
const senderName = msg.pushName ?? 'Unknown'
// Log the incoming message to your terminal
console.log(`📩 New message from ${senderName} [${isGroup ? 'Group' : 'DM'}] (${jid}): ${text}`)
// 1. Send a plain text reply
await sock.sendMessage(jid, { text: `You said: "${text}"` })
// 2. Send a reply only if the message matches a keyword
if (text.toLowerCase() === '!ping') {
await sock.sendMessage(jid, { text: '🏓 Pong!' })
}
}
})
}
connectToWhatsApp()
💡 See 💬 Sending Messages for all JID formats and message types.
No QR scanning — just a phone number. Call requestPairingCode directly after creating the socket. The socket internally waits for the WebSocket to be ready before sending the request, so no manual polling or delays needed on your end.
import makeWASocket, {
useMultiFileAuthState,
makeCacheableSignalKeyStore,
Browsers
} from '@zervonexx/baileys'
import pino from 'pino'
const { state, saveCreds } = await useMultiFileAuthState('auth_session')
const logger = pino({ level: 'silent' })
const sock = makeWASocket({
auth: {
creds: state.creds,
keys: makeCacheableSignalKeyStore(state.keys, logger)
},
browser: Browsers.ubuntu('Chrome'),
logger
})
sock.ev.on('creds.update', saveCreds)
if (!sock.authState.creds.registered) {
const code = await sock.requestPairingCode('1234567890') // phone number digits only in country code format, no + or spaces
console.log('Pairing code:', code)
}
Custom pairing code (must be exactly 8 characters):
const code = await sock.requestPairingCode('1234567890', 'ZERVONEX')
console.log('Custom code:', code)
Default pairing code: If no custom code is passed, the library uses
ZERVONEXas the default pairing code.
Scan the QR with your WhatsApp mobile app under Linked Devices.
import makeWASocket, {
useMultiFileAuthState,
makeCacheableSignalKeyStore,
Browsers
} from '@zervonexx/baileys'
import pino from 'pino'
const { state, saveCreds } = await useMultiFileAuthState('auth_session')
const logger = pino({ level: 'silent' })
const sock = makeWASocket({
auth: {
creds: state.creds,
keys: makeCacheableSignalKeyStore(state.keys, logger)
},
browser: Browsers.ubuntu('Chrome'),
printQRInTerminal: true,
logger
})
sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
if (connection === 'open') console.log('✅ Connected!')
if (connection === 'close') {
const shouldReconnect = lastDisconnect?.error?.output?.statusCode !== DisconnectReason.loggedOut
if (shouldReconnect) connectToWhatsApp()
}
})
sock.ev.on('creds.update', saveCreds)
The browser config tells WhatsApp what client you appear to be. This affects how WhatsApp treats your session and which features it enables.
| Option | Value | Notes |
|---|---|---|
Browsers.ubuntu('Chrome') |
['Ubuntu', 'Chrome', '22.04.4'] |
✅ Recommended — stable, widely used |
Browsers.macOS('Safari') |
['Mac OS', 'Safari', '14.4.1'] |
Good alternative |
Browsers.windows('Chrome') |
['Windows', 'Chrome', '10.0.22631'] |
Works well |
Browsers.baileys('Desktop') |
['Baileys', 'Desktop', '6.5.0'] |
Identifies as Baileys explicitly |
Browsers.appropriate('Chrome') |
Auto-detects your OS | Uses your actual platform |
import { Browsers } from '@zervonexx/baileys'
const sock = makeWASocket({
browser: Browsers.ubuntu('Chrome') // recommended
// browser: Browsers.macOS('Safari')
// browser: Browsers.windows('Chrome')
// browser: Browsers.appropriate('Chrome') // auto-detects your server OS
})
Key options from DEFAULT_CONNECTION_CONFIG:
const sock = makeWASocket({
// Required — authentication state
auth: { creds, keys },
// Browser identity sent to WhatsApp servers
browser: Browsers.ubuntu('Chrome'),
// true = upload full image for link previews, false = compressed local thumb
generateHighQualityLinkPreview: true,
// Cache group metadata to avoid repeated fetches on every message
cachedGroupMetadata: async (jid) => groupCache.get(jid),
// false = suppress online status indicator when connecting
markOnlineOnConnect: false,
// true = sync full message history on first connect
syncFullHistory: false,
// true = mark all outgoing messages as AI-generated (global default)
aiLabel: false,
// Logger — use pino({ level: 'silent' }) to suppress all logs
logger: pino({ level: 'silent' }),
// Connection timeout in milliseconds
connectTimeoutMs: 60000,
// Max retries when a message send fails
maxMsgRetryCount: 5,
// Custom message retrieval — used for retry and poll decryption
getMessage: async (key) => store.loadMessage(key.remoteJid, key.id),
// false = opt out of auto-following the official zervonex newsletter on connect
autoFollowNewsletter: false, // default: true
})
Atomic writes (tmp → rename with fallback), corrupt file self-healing, and automatic old pre-key cleanup. Best for single-instance bots or local development.
import { useMultiFileAuthState } from '@zervonexx/baileys'
const { state, saveCreds, getStats } = await useMultiFileAuthState('auth_session', {
preKeyRetention: 150, // how many recent prekeys to keep (default: 150)
cleanupThreshold: 50, // new prekeys before a cleanup runs (default: 50)
})
const sock = makeWASocket({ auth: state })
sock.ev.on('creds.update', saveCreds)
// Diagnostics — inspect session health
const stats = await getStats()
// { totalFiles: 42, preKeyCount: 150, nextPreKeyId: 3200, lastCleanupAt: '2026-07-05T...' }
To fully log out and delete a session, remove the session folder directly:
import { rm } from 'fs/promises'
await rm('auth_session', { recursive: true, force: true })
Universal adapter for any database backend via Keyv. Pass a connection string — the matching backend driver is resolved, instantiated, and cached automatically per session — no manual adapter imports needed.
import { useKeyvAuthState } from '@zervonexx/baileys'
// Redis
const { state, saveCreds } = await useKeyvAuthState('bot1', 'redis://localhost:6379')
// PostgreSQL / Supabase / Neon
const { state, saveCreds } = await useKeyvAuthState('bot1', 'postgresql://user:pass@localhost/db')
// MongoDB
const { state, saveCreds } = await useKeyvAuthState('bot1', 'mongodb://localhost/baileys')
// MySQL / PlanetScale
const { state, saveCreds } = await useKeyvAuthState('bot1', 'mysql://user:pass@localhost/db')
// SQLite (local, zero-config)
const { state, saveCreds } = await useKeyvAuthState('bot1', 'sqlite://auth.db')
// etcd
const { state, saveCreds } = await useKeyvAuthState('bot1', 'etcd://localhost:2379')
// Memcache
const { state, saveCreds } = await useKeyvAuthState('bot1', 'memcache://localhost:11211')
// In-memory (testing / ephemeral — data lost on restart)
const { state, saveCreds } = await useKeyvAuthState('test')
Sharing a pre-built adapter:
import KeyvMongo from '@keyv/mongo'
import KeyvDynamo from '@keyv/dynamo'
// Share one adapter instance across sessions
const mongo = new KeyvMongo('mongodb://localhost/baileys')
const { state: s1 } = await useKeyvAuthState('bot1', mongo)
const { state: s2 } = await useKeyvAuthState('bot2', mongo)
// DynamoDB (no connection string protocol)
const dynamo = new KeyvDynamo({ region: 'us-east-1', table: 'baileys_auth' })
const { state, saveCreds } = await useKeyvAuthState('bot1', dynamo)
Custom collection/table name:
const { state, saveCreds } = await useKeyvAuthState('bot1', 'mongodb://localhost/baileys', {
collectionName: 'baileys_auth',
})
Clear a session (logout):
const { state, saveCreds, clearSession } = await useKeyvAuthState('bot1', 'redis://localhost:6379')
// Wipes all keys for this session only — other sessions untouched
await clearSession()
Check auth without loading full state:
import { hasKeyvAuth } from '@zervonexx/baileys'
// true if creds exist and contain noiseKey + signedIdentityKey
const valid = await hasKeyvAuth('bot1', backend)
Route different key types to different backends — e.g. keep creds on Postgres and prekeys on Redis:
const { state, saveCreds, clearSession } = await useKeyvAuthState('bot1', {
'creds': 'postgresql://user:pass@localhost/db',
'pre-key': 'redis://localhost:6379',
'session': 'redis://localhost:6379',
'app-state-sync-key': 'mongodb://localhost/baileys',
'app-state-sync-version': 'mongodb://localhost/baileys',
'sender-key': 'redis://localhost:6379',
'sender-key-memory': 'redis://localhost:6379',
})
If a key type isn't listed in the map, the first entry's backend is used as the default.
useMultiFileAuthState |
useKeyvAuthState |
|
|---|---|---|
state |
✅ | ✅ |
saveCreds |
✅ | ✅ |
getStats |
✅ | ❌ |
clearSession |
❌ (delete folder instead) | ✅ |
sock.sendMessage(jid, content, options?) handles every message type.
// JID formats
'1234567890@s.whatsapp.net' // personal chat
'123456789-987654321@g.us' // group
'status@broadcast' // story/status
'120363...@newsletter' // newsletter channel
Every key you can pass to sock.sendMessage:
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.