npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zentrix/baileys

v4.2.5

Published

WhatsApp Modified By Zentrix

Readme

 ███████╗███████╗███╗   ██╗████████╗██████╗ ██╗██╗  ██╗
 ╚══███╔╝██╔════╝████╗  ██║╚══██╔══╝██╔══██╗██║╚██╗██╔╝
   ███╔╝ █████╗  ██╔██╗ ██║   ██║   ██████╔╝██║ ╚███╔╝ 
  ███╔╝  ██╔══╝  ██║╚██╗██║   ██║   ██╔══██╗██║ ██╔██╗ 
 ███████╗███████╗██║ ╚████║   ██║   ██║  ██║██║██╔╝ ██╗
 ╚══════╝╚══════╝╚═╝  ╚═══╝   ╚═╝   ╚═╝  ╚═╝╚═╝╚═╝  ╚═╝

⚡ BAILEYS — Multi-Device WhatsApp API

Version License Node Stars

A heavily patched & improved WhatsApp Multi-Device API
Built on top of Baileys — enhanced with critical bug fixes, stability improvements, and extended features.


📦 Installation

Pick your preferred install method:

"@zentrix/baileys": "latest"
"@zentrix/baileys": "^4.1.3"
"baileys": "npm:@zentrix/baileys@latest"
"whiskeysockets/baileys": "npm:@zentrix/baileys@latest"

Then install:

npm install
# or
yarn install

Import in your project:

// CommonJS
const { makeWASocket } = require('@zentrix/baileys')

// ESM
import { makeWASocket } from '@zentrix/baileys'

🔧 Drop-in Replacement

Already using @whiskeysockets/baileys? No code changes needed — just alias it:

"dependencies": {
    "@whiskeysockets/baileys": "npm:@zentrix/baileys@latest"
}

All your existing imports will resolve to ZENTRIX Baileys automatically. ✅


🐛 Bugs Fixed

1. 🔁 Bad MAC Retry Loops

Symptom: Messages fail to decrypt, bot gets stuck in an infinite retry loop.

Fix: Replaced plain Map with a full MessageRetryManager class that:

  • Detects MAC errors via RetryReason enum and forces immediate session recreation
  • Tracks retry counts per message with LRU expiry (15-min TTL)
  • Prevents session recreation hammering with a 1-hour cooldown
  • Supports phone-based resend fallback with cancellable timeouts

2. 🔄 Permanent Bad MAC After Contact Re-registers

Symptom: After a contact reinstalls WhatsApp, every message from them fails to decrypt permanently.

Fix: Added handleIdentityChange() which:

  • Listens for identity change push notifications
  • Debounces rapid identity changes per JID
  • Forces Signal session teardown and rebuild via assertSessions(force=true)

3. ⚡ Pre-key Race Conditions

Symptom: Intermittent decryption failures under high message load.

Fix: Added PreKeyManager which:

  • Creates a separate PQueue (concurrency: 1) per key type
  • Serialises all reads/writes, eliminating race conditions

4. 🧊 Event Loop Blocking on Reconnect

Symptom: Bot becomes unresponsive for seconds after reconnecting with a large backlog.

Fix: Added makeOfflineNodeProcessor() which:

  • Yields to the event loop every 10 nodes
  • Catches per-node errors without crashing the processing loop

5. 📨 Incorrect ACK Stanza Construction

Symptom: Some ACKs were missing the from field, causing server-side routing issues.

Fix: Added buildAckStanza() — always includes correct fields matching WA Web behaviour.


6. 🪪 LID-Addressed Messages Failing to Decrypt

Symptom: Messages from LID-format JIDs silently fail to decrypt.

Fix: Added LIDMappingStore with:

  • Bidirectional LID ↔ Phone Number mapping
  • LRU in-memory cache (3-day TTL)
  • In-flight request deduplication

7. ❌ Error 463 on 1-to-1 Message Sends

Symptom: Occasional 463 error — message never delivered.

Fix: Full tctoken system — reads, stores, and attaches privacy tokens to outgoing messages.


✨ New Exports

| Export | Description | |--------|-------------| | isPnUser(jid) | Checks @s.whatsapp.net | | isHostedPnUser(jid) | Checks @hosted server | | isHostedLidUser(jid) | Checks @hosted.lid server | | isJidMetaAI(jid) | Checks @bot server (Meta AI) | | isJidBot(jid) | Checks bot phone number pattern | | isJidNewsletter(jid) | Fixed spelling (old alias kept) | | WAJIDDomains | Enum: WHATSAPP=0, LID=1, HOSTED=128, HOSTED_LID=129 | | META_AI_JID | Constant: '[email protected]' |


📁 File Structure

zentrix-baileys/
├── lib/
│   ├── Utils/
│   │   ├── index.js                    ← Updated barrel
│   │   ├── message-retry-manager.js    ← NEW
│   │   ├── identity-change-handler.js  ← NEW
│   │   ├── pre-key-manager.js          ← NEW
│   │   ├── offline-node-processor.js   ← NEW
│   │   ├── stanza-ack.js               ← NEW
│   │   └── tc-token-utils.js           ← NEW
│   ├── Signal/
│   │   └── lid-mapping.js              ← NEW
│   └── WABinary/
│       └── jid-utils.js                ← Updated

🔗 New Dependencies

npm install lru-cache p-queue
# or
yarn add lru-cache p-queue

lru-cache may already be present in your package.json — check before installing.


🔗 Links


Thanks for using ZENTRIX Baileys! 🙏

Built with 💙 by the Zentrix Team