Scan your whole stack
From OX Research Newsroom
Are you using @chatbridge-it/baileys?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.2.0
@chatbridge-it/baileys was last scanned on 1 Dec 2026 at version 1.2.0. Risk score 90 of 100 (critical). High-severity rules fired and the AI review flagged it as malicious.
| Version | Published | Status |
|---|---|---|
| 1.2.0 LATEST | 1 Dec 2026 | 2 rules fired |
| 1.0.9 | 1 Dec 2026 | No rules fired |
| 1.0.8 | 1 Dec 2026 | No rules fired |
| 1.0.7 | 1 Dec 2026 | Not shown |
| 1.0.6 | 1 Dec 2026 | Not shown |
Findings for v1.2.0. 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 1.2.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A WhatsApp Web Multi-Device API library for Node.js. It connects to WhatsApp directly over WebSocket, so no browser (Puppeteer, Selenium, etc.) is required.
Disclaimer. This is an unofficial library. It is not affiliated with, authorized by, or endorsed by WhatsApp LLC or Meta. Using it may violate WhatsApp's Terms of Service and can lead to account restrictions or bans. Do not use it for spam, unsolicited bulk messaging, or harassment. You are solely responsible for how you use this software.
useMultiFileAuthState) and support for custom auth statesock.evpreinstall script (engine-requirements.js) stops the installation on older versions.Optional peer dependencies. Install only what you need:
| Package | Used for | Notes |
|---|---|---|
qrcode-terminal |
Printing QR codes in the terminal | Used in the quick start below |
sharp |
Image and video thumbnails | Declared peer range is ^0.32.2, install that version |
jimp |
Thumbnails if sharp is not available |
Alternative to sharp |
link-preview-js |
Link previews in text messages | Optional |
npm install qrcode-terminal
Install the library from npm:
npm install @chatbridge-it/baileys
Import it in CommonJS:
const {
makeWASocket,
useMultiFileAuthState,
fetchLatestBaileysVersion,
DisconnectReason
} = require("@chatbridge-it/baileys");
In ES modules, import the default export and destructure it:
import baileys from "@chatbridge-it/baileys";
const { makeWASocket, useMultiFileAuthState, fetchLatestBaileysVersion, DisconnectReason } = baileys;
This example logs in with a QR code, replies pong to ping, and reconnects automatically unless the session was logged out.
const {
makeWASocket,
useMultiFileAuthState,
fetchLatestBaileysVersion,
DisconnectReason
} = require("@chatbridge-it/baileys");
const qrcode = require("qrcode-terminal");
async function start() {
const { state, saveCreds } = await useMultiFileAuthState("auth_info");
const { version } = await fetchLatestBaileysVersion();
const sock = makeWASocket({
version,
auth: state,
printQRInTerminal: false
});
sock.ev.on("creds.update", saveCreds);
sock.ev.on("connection.update", ({ connection, lastDisconnect, qr }) => {
if (qr) {
qrcode.generate(qr, { small: true });
}
if (connection === "open") {
console.log("Connected");
}
if (connection === "close") {
const statusCode = lastDisconnect?.error?.output?.statusCode;
if (statusCode === DisconnectReason.loggedOut) {
console.log("Logged out. Delete the auth_info folder and pair again.");
} else {
start();
}
}
});
sock.ev.on("messages.upsert", async ({ messages, type }) => {
if (type !== "notify") return;
for (const msg of messages) {
if (!msg.message || msg.key.fromMe) continue;
const text = msg.message.conversation || msg.message.extendedTextMessage?.text;
if (text === "ping") {
await sock.sendMessage(msg.key.remoteJid, { text: "pong" }, { quoted: msg });
}
}
});
}
start().catch(console.error);
Run it with node index.js, then scan the QR code from WhatsApp on your phone: Settings > Linked devices > Link a device.
The library emits a qr value through connection.update. Render it however you like. The example above uses qrcode-terminal.
Pairing codes let you link a device by typing a code on your phone instead of scanning a QR code. Request it only when the account is not registered yet:
if (!sock.authState.creds.registered) {
const phoneNumber = "15551234567"; // digits only, including the country code
setTimeout(async () => {
// Pass null to get a random code, or pass your own code as the second argument
const code = await sock.requestPairingCode(phoneNumber, null);
console.log("Pairing code:", code);
}, 3000);
}
On your phone: Settings > Linked devices > Link a device > Link with phone number instead, then enter the code.
null for a random code, or a code that is not predictable.Save credentials every time they change, otherwise you will have to pair again after restarting:
sock.ev.on("creds.update", saveCreds);
Every message is sent with sock.sendMessage(jid, content, options). A JID is a WhatsApp address: 15551234567@s.whatsapp.net for a user, 120363...@g.us for a group, and ...@newsletter for a channel.
await sock.sendMessage(jid, { text: "Hello" });
await sock.sendMessage(jid, { text: "Got it" }, { quoted: msg });
await sock.sendMessage(groupJid, {
text: "@15551234567 welcome!",
mentions: ["15551234567@s.whatsapp.net"]
});
image, video and document accept a Buffer, a local file read with fs.readFileSync, or a { url } object.
const fs = require("fs");
await sock.sendMessage(jid, { image: { url: "https://example.com/photo.jpg" }, caption: "Look" });
await sock.sendMessage(jid, { video: fs.readFileSync("./clip.mp4"), caption: "Clip" });
await sock.sendMessage(jid, { image: fs.readFileSync("./photo.jpg"), viewOnce: true });
await sock.sendMessage(jid, { audio: { url: "./song.mp3" }, mimetype: "audio/mp4" });
// Voice note (push-to-talk), Opus in an OGG container
await sock.sendMessage(jid, {
audio: fs.readFileSync("./note.ogg"),
mimetype: "audio/ogg; codecs=opus",
ptt: true
});
await sock.sendMessage(jid, {
document: fs.readFileSync("./report.pdf"),
mimetype: "application/pdf",
fileName: "report.pdf",
caption: "Monthly report"
});
Stickers must be WebP files.
await sock.sendMessage(jid, { sticker: fs.readFileSync("./sticker.webp") });
await sock.sendMessage(jid, {
location: {
degreesLatitude: 41.9028,
degreesLongitude: 12.4964,
name: "Rome",
address: "Piazza Venezia"
}
});
const vcard = [
"BEGIN:VCARD",
"VERSION:3.0",
"FN:Jane Doe",
"TEL;type=CELL;waid=15551234567:+1 555 123 4567",
"END:VCARD"
].join("\n");
await sock.sendMessage(jid, { contacts: { displayName: "Jane Doe", contacts: [{ vcard }] } });
await sock.sendMessage(jid, {
poll: {
name: "Lunch?",
values: ["Pizza", "Sushi", "Salad"],
selectableCount: 1
}
});
await sock.sendMessage(jid, { react: { text: "👍", key: msg.key } });
Send an empty text to remove the reaction.
sendMessage returns the sent message, including its key, which you need to edit or delete it later.
const sent = await sock.sendMessage(jid, { text: "Draft" });
await sock.sendMessage(jid, { text: "Final version", edit: sent.key });
await sock.sendMessage(jid, { delete: sent.key });
await sock.sendMessage(jid, { forward: msg, force: true });
Edits only work on messages sent by your account. WhatsApp limits how long after sending a message edits and deletes are still allowed.
await sock.readMessages([msg.key]);
await sock.sendPresenceUpdate("composing", jid); // typing
await sock.sendPresenceUpdate("paused", jid); // stopped typing
Supported presence types: available, unavailable, composing, recording, paused.
Interactive messages add a text body, an optional header title, a footer and native-flow buttons. Pass the buttons in interactiveButtons.
await sock.sendMessage(jid, {
text: "Your order has shipped.", // body
title: "Order update", // optional header
footer: "chatbridge", // optional footer
interactiveButtons: [
{
name: "cta_url",
buttonParamsJson: JSON.stringify({
display_text: "Track order",
url: "https://example.com/track"
})
},
{
name: "cta_copy",
buttonParamsJson: JSON.stringify({
display_text: "Copy code",
id: "ORDER-1234",
copy_code: "ORDER-1234"
})
},
{
name: "quick_reply",
buttonParamsJson: JSON.stringify({
display_text: "Thanks!",
id: "thanks"
})
}
]
}, { quoted: msg });
name is required. buttonParamsJson can be a JSON string or a plain object (it is converted for you).cta_url (open a link), cta_copy (copy a code or link), cta_call (call a number), quick_reply (send a reply back).mentions works on interactive messages as well.Button rendering depends on the recipient's WhatsApp app version and account type, and WhatsApp may change or restrict these message types at any time. Test with your target accounts before relying on them in production.
To tag people, write @number in the text. Two ways to make it a real mention:
// 1) explicit list (recommended): exactly these JIDs are mentioned
await sock.sendMessage(jid, {
text: "Welcome @393331234567!",
mentions: ["393331234567@s.whatsapp.net"]
});
// 2) automatic: without `mentions`, every @number (7-15 digits) in the text or caption is mentioned
await sock.sendMessage(jid, { text: "Welcome @393331234567!" });
autoMentions: false to turn the automatic detection off.contextInfo (for example externalAdReply) is merged with the mentions, never replaces them.// Create a group
const group = await sock.groupCreate("Team", ["15551234567@s.whatsapp.net"]);
// Metadata
const meta = await sock.groupMetadata(group.id);
// Subject and description
await sock.groupUpdateSubject(group.id, "Team (renamed)");
await sock.groupUpdateDescription(group.id, "Project discussions");
// Participants: action is "add", "remove", "promote" or "demote"
await sock.groupParticipantsUpdate(group.id, ["15557654321@s.whatsapp.net"], "add");
// Invite link code
const inviteCode = await sock.groupInviteCode(group.id);
// Groups the account participates in
const groups = await sock.groupFetchAllParticipating();
// Member label shown in the group (trimmed to 30 characters)
await sock.setLabelGroup(group.id, "Admin");
// Leave
await sock.groupLeave(group.id);
Pending join requests can be handled with groupRequestParticipantsUpdate(jid, participants, action).
// Resolve a channel from its link or bare invite key
const channel = await sock.newsletterFromUrl("https://whatsapp.com/channel/XXXXXXXXXXXX");
// -> { id, name, description, subscribers, verification, creation_time, ... }
// Create a channel. The third argument is the reaction setting string, converted to uppercase
const created = await sock.newsletterCreate("Updates", "Official updates", "all");
// Follow and mute
await sock.newsletterFollow(channel.id);
await sock.newsletterMute(channel.id);
// React to a channel post
await sock.newsletterReactMessage(channel.id, serverId, "👍");
// Remove the reaction
await sock.newsletterReactMessage(channel.id, serverId);
newsletterMetadata(type, key, role) gives direct access to channel metadata when you already have the channel key.
// Check which numbers have a WhatsApp account. Returns an array with jid and exists fields.
const results = await sock.onWhatsApp("15551234567");
// Profile picture: type is "preview" (default) or "image"
const picUrl = await sock.profilePictureUrl(jid, "image");
// Status text of a contact
const status = await sock.fetchStatus(jid);
// Your profile
await sock.updateProfileName("chatbridge Bot");
await sock.updateProfileStatus("Available 24/7");
await sock.updateProfilePicture(sock.user.id, fs.readFileSync("./avatar.jpg"));
// Privacy and block list
await sock.updateLastSeenPrivacy("contacts");
await sock.updateBlockStatus(jid, "block"); // "block" or "unblock"
const blocked = await sock.fetchBlocklist();
// Presence: subscribe to a contact's online status
await sock.presenceSubscribe(jid);
Listen to events through sock.ev.on(eventName, handler).
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.