@dcloude/baileys

中文文档
0.1.2发布于 2026/11/01MITTypeScriptES Module近 30 天下载 2091

WhatsApp Baileys Library Modification to make it easier for developers to develop for anything

原始使用文档

🚀 @dcloude/baileys

High Performance WhatsApp Library powered by Rust WASM
Enhanced Baileys fork with Anti-Ban, Meta AI, MEX GraphQL, Interop, and WA-Web Protocol support.

---

📦 Package Information

Property| Value 📦 Package| "@dcloude/baileys" 🏷️ Version| "0.1.2" 💬 Telegram| https://t.me/lendd3 ⚡ Runtime| Node.js 23+ 🦀 Engine| Rust WASM Bridge 🔗 Base| Baileys Fork


📚 Table of Contents

Getting Started

  • Installation
  • Running on Termux / Android
  • Running on Pterodactyl

Authentication

  • QR Code Login
  • Pairing Code Login
  • Full History Sync

Core Features

  • Socket Configuration
  • Session Management
  • Event Handling
  • Message Routing

Anti-Ban Suite

  • RateLimiter
  • WarmUp
  • HealthMonitor
  • TimelockGuard
  • PresenceChoreographer
  • wrapSocket

Messaging

  • Text Messages
  • Interactive Messages
  • Media Messages
  • Meta AI Messages
  • Status & Stories

Advanced Features

  • Group Management
  • Privacy Controls
  • User Queries
  • Profile Management
  • Chat Modifiers

Internal Protocols

  • MEX GraphQL
  • USync
  • HTTPS GraphQL
  • WA-Web Port

Utilities

  • Sticker Maker
  • View Once Cache
  • Command Loader
  • Multi Session Pool
  • Store Encryption

Rust WASM Bridge


✨ What's Different?

🦀 Rust WASM Performance

Component| Upstream Baileys| WBails Binary Decode| JavaScript| Rust WASM Noise Handshake| JavaScript| Rust WASM AES / HMAC / HKDF| Node Crypto| Rust WASM Signal Protocol| libsignal-node| Rust WASM

Benefits

  • ⚡ Faster packet processing
  • ⚡ Reduced CPU usage
  • ⚡ Better memory efficiency
  • ⚡ Consistent performance across platforms
  • ⚡ Works on Termux without Rust toolchain

🔥 Feature Highlights

Feature| Description 🤖 Meta AI| Full Meta AI integration and message handling 🔐 MEX GraphQL| Direct access to WhatsApp internal GraphQL APIs 🛡️ Anti-Ban Suite| Multiple protection layers for account safety 🌐 Interoperability| Facebook & Instagram messaging support 📦 Album Messages| Send multiple media in one message 🎨 Sticker Packs| Native sticker pack support 📢 Newsletters| Newsletter invite & follower messages 🏘️ Communities| Community and subgroup management 📞 Call Signalling| Advanced call event support 🌍 WA-Web Port| Mobile and Web protocol parity


📥 Installation

npm install npm:@dcloude/baileys

Requirements

Node.js >= 23 npm >= 10

Optional Dependencies

Package| Purpose sharp| Image processing jimp| Fallback image processing audio-decode| Voice metadata extraction link-preview-js| Link preview generation

npm install sharp jimp audio-decode link-preview-js


🦀 Rust WASM Bridge

The Baileys uses whatsapp-rust-bridge compiled to WebAssembly (WASM).

Unlike native ".node" addons, WASM runs on:

  • Android (Termux)
  • Linux
  • Windows
  • macOS
  • ARM Devices
  • x86 Devices

No Rust compiler is required for normal installations.

The package ships with a prebuilt ".wasm" binary, allowing it to run immediately after installation.


🔬 MEX — WhatsApp Internal GraphQL

MEX powers many modern WhatsApp features:

  • Privacy Settings
  • Usernames
  • Passkeys
  • Profiles
  • Integrity Checks
  • Account Management

Example:

await sock.setPrivacySetting('LAST_SEEN', 'CONTACTS')

const user = await sock.findUserByUsername('@lendd3')

const abouts = await sock.getTextStatusList([ '[email protected]' ])

📖 Full documentation: "documentation/MEX.md"


📖 Documentation

Topic| Documentation MEX GraphQL| "documentation/MEX.md" USync| "documentation/USYNC.md" HTTPS GraphQL| "documentation/GRAPHQL.md" Privacy & Profile| "documentation/PRIVACY.md" Registration| "documentation/REGISTRATION.md" Managed Accounts| "documentation/MANAGED-ACCOUNT.md" Communities| "documentation/COMMUNITIES.md" Interoperability| "documentation/INTEROP.md" Username System| "documentation/USERNAME.md" Anti-Ban| "documentation/ANTIBAN.md" Ban System| "documentation/BAN-SYSTEM.md" Protocol Reference| "documentation/PROTOCOLS.md" WA-Web Port| "documentation/WA-WEB-PORT.md"


Created By Arlend Kaizen

版本与发布记录

@dcloude/baileys 共发布 8 个版本,首次发布于 2026/10/13;过去 12 个月发布了 8 个版本。

版本发布日期距今
0.1.2latest2026/11/0113 天前
0.1.12026/11/0113 天前
0.0.92026/10/2817 天前
0.0.82026/10/131 个月前
0.0.0-stage2026/10/131 个月前
0.0.72026/10/111 个月前

关于 @dcloude/baileys 的常见问题

@dcloude/baileys 是什么?

WhatsApp Baileys Library Modification to make it easier for developers to develop for anything

如何安装 @dcloude/baileys?

在项目目录运行 npm install @dcloude/baileys,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:sharp(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@dcloude/baileys 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dcloude/baileys 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dcloude/baileys 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@dcloude/baileys 可以商用吗?

@dcloude/baileys 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dcloude/baileys 的下载量有多少?

根据 npm 官方下载统计,@dcloude/baileys 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,091 次,日均约 70 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dcloude/baileys 还在维护吗?

最新版本 0.1.2 发布于 2026/11/01(13 天前);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/10/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。