Scan your whole stack
Are you using @dekzypedia/baileys?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v7.0.0-dekzy.3
@dekzypedia/baileys was last scanned on 27 Nov 2026 at version 7.0.0-dekzy.3. Risk score 90 of 100 (critical). High-severity rules fired and the AI review flagged it as malicious.
| Version | Published | Status |
|---|---|---|
| 7.0.0-dekzy.3 LATEST | 27 Nov 2026 | 2 rules fired |
| 0.0.0-stage | 27 Nov 2026 | Not shown |
Findings for v7.0.0-dekzy.3. 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.
The code combines a hardcoded or decoded WhatsApp channel identifier with a follow or mute call in the same file, or builds a WhatsApp channel request with a fixed query ID. This can use the user's own authenticated session to follow, and often mute, channels the package author chooses, without the user asking for it.
HIGHThe score describes 7.0.0-dekzy.3; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
[!CAUTION] NOTICE OF BREAKING CHANGE.
As of 7.0.0, multiple breaking changes were introduced into the library.
Please check out https://whiskey.so/migrate-latest for more information.
This is a temporary README.md, the new guide is in development and will this file will be replaced with .github/README.md (already a default on GitHub).
New guide link: https://baileys.wiki
If you'd like business to enterprise-level support from Rajeh, the current maintainer of Baileys, you can book a video chat. Book a 1 hour time slot by contacting him on Discord or pre-ordering here. The earlier you pre-order the better, as his time slots usually fill up very quickly. He offers immense value per hour and will answer all your questions before the time runs out.
If you are a business, we encourage you to contribute back to the high development costs of the project and to feed the maintainers who dump tens of hours a week on this. You can do so by booking meetings or sponsoring below. All support, even in bona fide / contribution hours, is welcome by businesses of all sizes. This is not condoning or endorsing businesses to use the library. See the Disclaimer below.
If you'd like to financially support this project, you can do so by supporting the current maintainer here.
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at whatsapp.com. "WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.
The maintainers of Baileys do not in any way condone the use of this application in practices that violate the Terms of Service of WhatsApp. The maintainers of this application call upon the personal responsibility of its users to use this application in a fair way, as it is intended to be used. Use at your own discretion. Do not spam people with this. We discourage any stalkerware, bulk or automated messaging usage.
[!IMPORTANT] The original repository had to be removed by the original author - we now continue development in this repository here. This is the only official repository and is maintained by the community. Join the Discord here
Do check out & run example.ts to see an example usage of the library. The script covers most common use cases. To run the example script, download or clone the repo and then type the following in a terminal:
cd path/to/Baileysyarnyarn exampleThis fork ships as @dekzypedia/baileys, not the upstream package. Any of these work:
# straight from this repo; `prepare` builds lib/ during install (Node 20+ required)
npm install github:dekzypedia/baileys
# or from a packed tarball, which already contains lib/ so no build step is needed
npm pack # in the repo, writes dekzypedia-baileys-<version>.tgz
npm install ../baileys/dekzypedia-baileys-7.0.0-dekzy.2.tgz
Once the package is published under the @dekzypedia scope on npm, npm install @dekzypedia/baileys also works.
Then import your code using:
import makeWASocket from '@dekzypedia/baileys'
Publishing is manual: the package lives under your own scope and needs your npm credentials.
npm login # the account that owns the @dekzypedia scope
npm version 7.0.0-dekzy.3 # or any version above the published one
npm publish --access public # prepack builds lib/ first
After that anyone can npm install @dekzypedia/baileys. To publish from CI instead, add an NPM_TOKEN repository secret (npm automation token with publish rights on the scope) and push a v* tag: .github/workflows/publish-release.yml builds, publishes with provenance and creates a GitHub release.
.github/workflows/sync-upstream.yml merges WhiskeySockets/Baileys@master every Monday and opens a PR. By hand:
bash scripts/sync-upstream.sh # docs conflicts keep the fork version, source conflicts abort
bash scripts/sync-upstream.sh # run again after resolving conflicts locally
yarn update:version # latest WhatsApp Web protocol version
yarn lint && yarn test
Connecting Account
Important Notes About Socket Config
Save Auth Info
Handling Events
Implementing a Data Store
Whatsapp IDs Explain
Utility Functions
Sending Messages
Modify Messages
Manipulating Media Messages
Reject Call
Send States in Chat
Modifying Chats
User Querys
Change Profile
Groups
Privacy
Broadcast Lists & Stories
Writing Custom Functionality
WhatsApp provides a multi-device API that allows Baileys to be authenticated as a second WhatsApp client by scanning a QR code or Pairing Code with WhatsApp on your phone.
[!NOTE] > Here is a simple example of event handling
[!TIP] > You can see all supported socket configs in the SocketConfig type alias (Recommended)
[!TIP] You can customize browser name if you connect with QR-CODE, with
Browserconstant, we have some browsers config, see the BrowsersMap type alias
import makeWASocket from '@whiskeysockets/baileys'
const sock = makeWASocket({
// can provide additional config here
browser: Browsers.ubuntu('My App'),
printQRInTerminal: true
})
If the connection is successful, you will see a QR code printed on your terminal screen, scan it with WhatsApp on your phone and you'll be logged in!
[!IMPORTANT] Pairing Code isn't Mobile API, it's a method to connect Whatsapp Web without QR-CODE, you can connect only with one device, see here
The phone number can't have + or () or -, only numbers, you must provide country code
import makeWASocket from '@whiskeysockets/baileys'
const sock = makeWASocket({
// can provide additional config here
printQRInTerminal: false //need to be false
})
if (!sock.authState.creds.registered) {
const number = 'XXXXXXXXXXX'
const code = await sock.requestPairingCode(number)
console.log(code)
}
syncFullHistory as trueconst sock = makeWASocket({
...otherOpts,
// can use Windows, Ubuntu here too
browser: Browsers.macOS('Desktop'),
syncFullHistory: true
})
If you use baileys for groups, we recommend you to set cachedGroupMetadata in socket config, you need to implement a cache like this:
const groupCache = new NodeCache({ stdTTL: 5 * 60, useClones: false })
const sock = makeWASocket({
cachedGroupMetadata: async jid => groupCache.get(jid)
})
sock.ev.on('groups.update', async ([event]) => {
const metadata = await sock.groupMetadata(event.id)
groupCache.set(event.id, metadata)
})
sock.ev.on('group-participants.update', async event => {
const metadata = await sock.groupMetadata(event.id)
groupCache.set(event.id, metadata)
})
getMessage config in socket like this:const sock = makeWASocket({
getMessage: async key => await getMessageFromStore(key)
})
markOnlineOnConnect to falseconst sock = makeWASocket({
markOnlineOnConnect: false
})
You obviously don't want to keep scanning the QR code every time you want to connect.
So, you can load the credentials to log back in:
import makeWASocket, { useMultiFileAuthState } from '@whiskeysockets/baileys'
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
// will use the given state to connect
// so if valid credentials are available -- it'll connect without QR
const sock = makeWASocket({ auth: state })
// this will be called as soon as the credentials are updated
sock.ev.on('creds.update', saveCreds)
[!IMPORTANT] >
useMultiFileAuthStateis a utility function to help save the auth state in a single folder, this function serves as a good guide to help write auth & key states for SQL/no-SQL databases, which I would recommend in any production grade system.
[!NOTE] When a message is received/sent, due to signal sessions needing updating, the auth keys (
authState.keys) will update. Whenever that happens, you must save the updated keys (authState.keys.set()is called). Not doing so will prevent your messages from reaching the recipient & cause other unexpected consequences. TheuseMultiFileAuthStatefunction automatically takes care of that, but for any other serious implementation -- you will need to be very careful with the key state management.
[!IMPORTANT] > The events are in the BaileysEventMap type alias, it's important you see all events
You can listen to these events like this:
const sock = makeWASocket()
sock.ev.on('messages.upsert', ({ messages }) => {
console.log('got messages', messages)
})
[!NOTE] This example includes basic auth storage too
[!NOTE] For reliable serialization of the authentication state, especially when storing as JSON, always use the BufferJSON utility.
import makeWASocket, { DisconnectReason, useMultiFileAuthState } from '@whiskeysockets/baileys'
import { Boom } from '@hapi/boom'
async function connectToWhatsApp() {
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
const sock = makeWASocket({
// can provide additional config here
auth: state,
printQRInTerminal: true
})
sock.ev.on('connection.update', update => {
const { connection, lastDisconnect } = update
if (connection === 'close') {
const shouldReconnect = (lastDisconnect.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut
console.log('connection closed due to ', lastDisconnect.error, ', reconnecting ', shouldReconnect)
// reconnect if not logged out
if (shouldReconnect) {
connectToWhatsApp()
}
} else if (connection === 'open') {
console.log('opened connection')
}
})
sock.ev.on('messages.upsert', event => {
for (const m of event.messages) {
console.log(JSON.stringify(m, undefined, 2))
console.log('replying to', m.key.remoteJid)
await sock.sendMessage(m.key.remoteJid!, { text: 'Hello Word' })
}
})
// to storage creds (session info) when it updates
sock.ev.on('creds.update', saveCreds)
}
// run in main file
connectToWhatsApp()
[!IMPORTANT] In
messages.upsertit's recommended to use a loop likefor (const message of event.messages)to handle all messages in array
messages.updatesock.ev.on('messages.update', event => {
for (const { key, update } of event) {
if (update.pollUpdates) {
const pollCreation = await getMessage(key)
if (pollCreation) {
console.log(
'got poll update, aggregation: ',
getAggregateVotesInPollMessage({
message: pollCreation,
pollUpdates: update.pollUpdates
})
)
}
}
}
})
getMessage is a store implementation (in your end)connection.update will be fired requesting you to restart sockmessaging.history-set[!IMPORTANT] I highly recommend building your own data store, as storing someone's entire chat history in memory is a terrible waste of RAM.
It can be used as follows:
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.