Scan your whole stack
From OX Research Newsroom
Are you using @nakanoo/baileys?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.0.1
@nakanoo/baileys was last scanned on 16 Nov 2026 at version 1.0.1. Risk score 90 of 100 (critical). High-severity rules fired and the AI review flagged it as malicious.
| Version | Published | Status |
|---|---|---|
| 1.0.1 LATEST | 16 Nov 2026 | 2 rules fired |
| 1.0.0 | 16 Nov 2026 | 1 rule fired |
| 0.0.0-stage | 16 Nov 2026 | Not shown |
Findings for v1.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 1.0.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A lightweight WhatsApp Web API library (WebSocket-based, TypeScript) with built-in interactive message builders. Fork of Baileys, made for WhatsApp bots.
@nakanoo/baileys is a fork of Baileys (WhiskeySockets) v7.0.0-rc14, a WebSocket-based TypeScript library for the WhatsApp Web multi-device API. It talks to WhatsApp directly over WebSocket, with no Selenium and no browser, which makes it light on memory and a good fit for WhatsApp bots, automation, and integrations.
All core Baileys functionality is kept (socket, Signal, WABinary, WAUSync, WAM, WAProto, media, auth). On top of that, this fork adds the "nakanoo" modules:
sendPreview, newsletterMsg).All added modules were written from scratch (not copied code). See NOTICE.md for details.
| Category | What you get |
|---|---|
| Baileys core | Multi-device, QR code / pairing code login, auth state, event buffer, groups, communities, newsletters (channels), USync |
| Message builders | AIRich / ORich, Button, ButtonV2, Carousel, Toolkit, BaseBuilder |
| A2UI | A2UI + sendA2UIWidget (card, video, choice picker, image) |
| Rich messages | tokenizeCode(V2), generateTableContent(V2), generateListContent, generateCodeBlockContent(V2), generateLinkContent(V2), and more |
| Sticker pack | makeStickerPack |
| Extra socket | sendPreview, newsletterMsg via patchExtraSocket |
| Business | uploadingNecessaryImages, uploadingNecessaryImagesOfProduct |
| Dual build | ESM (lib/) and a CommonJS wrapper (cjs/) |
require() (CommonJS): Node ≥ 20.19 or ≥ 22.12, because the CJS entry relies on Node's native require(ESM). Dependencies such as whatsapp-rust-bridge and p-queue ship no CJS build.corepack enable)Optional peer dependencies, install as needed:
| Package | Used for |
|---|---|
sharp or jimp |
Image / sticker thumbnails |
link-preview-js |
High-quality link previews |
audio-decode |
Voice note waveforms |
# from npm (if published)
npm install @nakanoo/baileys
# from a tarball created with `npm pack`
npm install ./nakanoo-baileys-1.0.0.tgz
import makeWASocket, {
useMultiFileAuthState,
fetchLatestBaileysVersion,
DisconnectReason,
makeCacheableSignalKeyStore
} from '@nakanoo/baileys'
import pino from 'pino'
const logger = pino({ level: 'silent' })
async function start() {
const { state, saveCreds } = await useMultiFileAuthState('auth_info')
const { version } = await fetchLatestBaileysVersion()
const sock = makeWASocket({
version,
logger,
auth: {
creds: state.creds,
keys: makeCacheableSignalKeyStore(state.keys, logger)
}
})
sock.ev.on('creds.update', saveCreds)
sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
if (connection === 'close') {
const code = lastDisconnect?.error?.output?.statusCode
if (code !== DisconnectReason.loggedOut) start()
}
})
sock.ev.on('messages.upsert', async ({ messages, type }) => {
if (type !== 'notify') return
for (const msg of messages) {
const text = msg.message?.conversation || msg.message?.extendedTextMessage?.text
if (text === 'ping') {
await sock.sendMessage(msg.key.remoteJid, { text: 'pong' }, { quoted: msg })
}
}
})
}
start()
const { default: makeWASocket, useMultiFileAuthState } = require('@nakanoo/baileys')
Other named exports (AIRich, Utils, proto, etc.) are also available through require, along with the Utils, Types, Defaults, WABinary, WAM, and WAUSync namespaces.
if (!sock.authState.creds.registered) {
const code = await sock.requestPairingCode('628xxxxxxxxxx')
console.log('Pairing code:', code)
}
If you do not pass a second argument (custom code), the library uses customConfig.pairingCode from src/custom.ts. See Default Behavior.
Every builder accepts an optional sock in its constructor. Without sock you can still call .build() to get the message content. With sock you can use .send(jid).
ORich is an alias of AIRich.
import { AIRich } from '@nakanoo/baileys'
const rich = new AIRich(sock)
.addText('Hello, this is a rich message!')
.addCode('const x = 1', 'js')
.addTable({ headers: ['Name', 'Score'], values: [['Ana', 10], ['Budi', 8]] })
.addSource({ title: 'Documentation', url: 'https://baileys.wiki' })
.addTip('Remember to drink water')
.createAlert('info', 'This is an alert example')
.setFooter('nakanoo/baileys')
await rich.send(jid, { quoted: msg })
Available methods:
| Method | Purpose |
|---|---|
addText(text) |
Append text (joined with newlines) |
addCode(code, language = 'js') |
Fenced code block |
addTable({ headers?, values }) |
Simple text table |
addImage(input) / addVideo(input) |
Media attachments (requires sock) |
addSection(title, items?) |
Section |
addSource({ title, url? }) |
Source / reference |
addTip(text) |
Tip marked with 💡 |
createAlert('info' \| 'warn' \| 'error', text) |
Alert marked with ℹ️ / ⚠️ / ⛔ |
addSuggest(text) |
Quick reply button |
addFooterAction({ text, url }) |
URL button in the footer |
addFOAText, addProduct, addWidget, addReels, addPost, addMetadata, addSubmessage |
Extra metadata |
assignId(id?), getIds(), hasId(id) |
ID management |
setResponseId, setBotResponseId, refreshResponseId, refreshBotResponseId |
Response IDs |
tokenizer() |
Simple code tokenizer |
toTableMetadata() |
Table metadata |
newLayout() |
Reset sections, widgets, and media |
build() |
Produce the message content |
send(jid, options?) |
Build, then send via relayMessage |
sendEdit(jid, key) / buildEdit(jid, key) |
Edit an already sent message |
delete(jid, key) |
Delete (revoke) a message |
The result of build() depends on what the builder contains:
interactiveMessage (native flow),extendedTextMessage.Native flow interactive message with several button types.
import { ButtonV2 } from '@nakanoo/baileys'
await new ButtonV2(sock)
.addText('Choose one:')
.addQuickReply('Yes', 'btn_yes')
.addUrl('Open Website', 'https://example.com')
.addCall('Call us', '+628123456789')
.addCopy('Copy Code', 'CODE123')
.setFooter('nakanoo')
.send(jid)
List message (single select).
import { Button } from '@nakanoo/baileys'
await new Button(sock)
.title('Menu')
.subtitle('Pick an item')
.addRow('menu_1', 'Bot Info', 'View bot info')
.addRow('menu_2', 'Help')
.send(jid)
import { Carousel } from '@nakanoo/baileys'
const carousel = new Carousel(sock)
.addCard({ title: 'Card 1', text: 'First card body', image: imageMessage })
.addCard({ title: 'Card 2', text: 'Second card body', image: imageMessage })
.setFooter('swipe to see more')
await carousel.send(jid)
AIRichError, ItemNotFoundError, DuplicateIdError, InvalidTargetError, ContentValidationError. All extend AIRichError and expose a code property (for example DUPLICATE_ID).
try {
await new ButtonV2().build() // no buttons
} catch (e) {
if (e instanceof ContentValidationError) console.log(e.code) // CONTENT_VALIDATION
}
Collect widgets, then render them into a message.
import { A2UI, sendA2UIWidget } from '@nakanoo/baileys'
const ui = new A2UI('Title')
.addCard('Card', 'Card body')
.addChoicePicker('Pick an option', [
{ label: 'Option A', id: 'a' },
{ label: 'Option B', id: 'b' }
])
await sendA2UIWidget(sock, jid, { a2ui: ui, quoted: msg })
Rendering rules:
choicePicker, it becomes a listMessage,url become cta_url buttons inside an interactiveMessage,Functions exported from Utils:
| Function | Description |
|---|---|
tokenizeCode(lang, code) |
Split code into lines |
tokenizeCodeV2(lang, code) |
Per line, with keyword flags (JS/TS, Python, Go, Lua, Bash) |
generateTableContent(V2) |
Table as text |
toTableMetadataV2 |
Table metadata (headers, rows, colCount, rowCount) |
generateListContent |
Single-select listMessage |
generateCodeBlockContent(V2) |
Fenced code block |
generateLinkContent(V2) |
Text + link |
generateLatexContent |
LaTeX content as a text block |
generateRichMessageContent |
extendedTextMessage with context info |
prepareRichResponseMessage |
Prepare and send content via relayMessage |
buildBotForwardedMessage, buildRichContextInfo |
Forwarded message and context info |
RichSubMessageType, CodeHighlightType |
Enums |
import { makeStickerPack } from '@nakanoo/baileys'
await makeStickerPack(sock, jid, {
packname: 'My Pack',
author: 'nakanoo',
stickers: [
{ image: { url: './s1.webp' }, emojis: ['😀'] },
{ image: { url: './s2.webp' }, emojis: ['😎'] }
]
}, { quoted: msg })
sendPreview and newsletterMsg are not attached automatically. Call patchExtraSocket once after creating the socket (it is safe to call more than once).
import makeWASocket, { patchExtraSocket } from '@nakanoo/baileys'
const sock = makeWASocket({ /* ... */ })
patchExtraSocket(sock)
// send a custom link preview
const id = await sock.sendPreview(jid, {
caption: 'Check this out',
url: 'https://example.com',
title: 'Preview Title',
description: 'Preview description',
jpegThumbnail: buffer
})
// normalized channel (newsletter) info
const info = await sock.newsletterMsg('120363xxxxxxxxxx@newsletter')
// { id, state, thread_metadata: { name, creation_time, subscribers_count, verification } }
import { uploadingNecessaryImages, uploadingNecessaryImagesOfProduct } from '@nakanoo/baileys'
const prepared = await uploadingNecessaryImages(sock, products)
const one = await uploadingNecessaryImagesOfProduct(sock, products[0])
Products without images are skipped, and a failed image upload does not stop the other products.
This fork ships with a few default behaviors defined in src/custom.ts and src/Socket/index.ts. Read this section before using it in production.
| Behavior | Default | Notes |
|---|---|---|
| ASCII banner | Enabled | Printed once, the first time makeWASocket() is called |
| Custom pairing code | RANDEV12 |
Used by requestPairingCode(phone) when you do not pass your own code |
| Auto-follow channels | Enabled | After the connection reaches open (once per process), the socket follows the channels listed in newsletterIds |
To change or disable them, edit customConfig in src/custom.ts and rebuild:
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.