Baileys README

The project's README from github.com/WhiskeySockets/Baileys. As one markdown file: README.md.

Baileys logo

[!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.

Baileys is a WebSockets-based TypeScript library for interacting with the WhatsApp Web API.

Join the WhiskeySockets community via the link: https://whiskey.so/discord

Usage & Guide

[!IMPORTANT] The new guide is a work in progress. Expect missing pages/content. Report missing or incorrect content.

You can still access the old guide here: README.md, or the NPM homepage.

The new guide is posted at https://baileys.wiki .

Get Support

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.

Sponsor

If you'd like to financially support this project, you can do so by supporting the current maintainer here.

Disclaimer

[!CAUTION] 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.

License

Copyright (c) 2025 Rajeh Taher/WhiskeySockets

Licensed under the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Thus, the maintainers of the project can't be held liable for any potential misuse of this project.

Baileys (WhiskeySockets/Baileys)

Searching Database…

11.4K ·GitHub
这是什么?Baileys 是一个开源的 TypeScript/JavaScript 库,能让你的代码直接和 WhatsApp 通信:它通过 WebSocket 连接 WhatsApp Web 的 API,所以你可以用程序读取和发送消息,而不需要官方的 Business API。
它是一个写代码时用的库,还是打开就能用的应用?是一个库,不是应用:你把它添加到自己的 JavaScript 或 TypeScript 项目里,基于它的 API 写代码。没有界面可以打开——它在你的代码运行的地方运行(需要 Node.js 20+、Bun 或 Deno)。
我怎么把它跑起来?用 npm 把这个包装到一个 Node.js 20+ 的项目里,然后就可以开始写代码了——仓库里附带一个可以直接运行的示例,用 npm run example 启动。文档位于一份仍在补充中的新指南,以及 README 里那份较早的指南。
使用它需要安装什么?需要一个现代的 JavaScript 运行时:明确要求 Node.js 20 或更高版本,项目里也列出了 Bun 和 Deno。主要的依赖包括 libsignal、protobufjs、ws 和 pino。
这是官方的 WhatsApp 工具吗?有什么风险?它是非官方的,使用风险自负:免责声明里说 Baileys 与 WhatsApp 没有任何隶属关系,也没有获得其认可,维护者也不建议任何违反 WhatsApp 服务条款的用途——比如发垃圾消息、批量或自动群发消息、监控他人。
我到底能用它做什么?任何需要用代码收发 WhatsApp 消息的东西——聊天机器人、你自己系统发出的提醒,或者把 WhatsApp 和另一个应用连接起来的桥接,前提是在正常账号上合理使用。
文档是完整的吗,还是会有缺漏?要有心理准备会缺漏:新指南明确说还在编写中,有缺页和缺失的内容,维护者也请读者把缺失或错误的地方反馈给他们。旧指南仍然可以通过仓库的 README 和 NPM 主页访问。
它连接 WhatsApp 的时候,背后是怎么工作的?它相当于一个 WhatsApp Web 客户端:一个 WebSocket 会话,消息用 Protocol Buffers(protobufjs)序列化,加密由 libsignal 处理,日志用 pino 记录——最近的版本还引入了 whatsapp-rust-bridge 这个依赖。
Size
233.1 MB
Stars
11.4K
Age
4y
Commits · 90 Days