wa-js

wppconnect-teamApache-2.0活跃维护

在浏览器里直接调用 WhatsApp Web 的 JavaScript API,收发消息、管理联系人、群组和媒体,适合做聊天机器人和自动化集成。

Browser-side WhatsApp Web automation library. Exposes the WPP JavaScript API for chats, messages, contacts, groups, media and events; powers WPPConnect integrations and extensions.

v4.7.2发布于 2026-10-23 17:58 UTC839star +4 / 7 天253fork同步于 2026-11-10 23:53 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/wppconnect-team/wa-js.git
cd wa-js
npm ci
npm run build:prd
npm run launch:local
硬件要求按 README 说明

README 未说明;仅要求能运行 WhatsApp Web 的浏览器,构建需 Node.js/npm。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在 WhatsApp Web 页面内注入 WPP API 的浏览器端自动化库,不是 Node 客户端

在浏览器里直接调用 WhatsApp Web 的 JavaScript API,收发消息、管理联系人、群组和媒体,适合做聊天机器人和自动化集成。

核心能力

  • 通过注入 dist/wppconnect-wa.js 暴露全局 WPP 对象
  • 覆盖聊天、消息、联系人、群组、频道与媒体操作
  • 提供连接事件、资料隐私设置、标签与聊天列表接口
  • 导出带类型的 WhatsApp 内部模块,便于扩展开发
  • 自带本地启动器,注入 bundle 后打开浏览器调试

容易踩的坑

package.json 声明依赖 WhatsApp Web >=2.3000.1038792969-alpha,具体能力随 WhatsApp 更新可能失效;每个页面只能加载一个默认 WPP bundle,自定义全局名需另配;本地启动器可用 WA_VERSION 选择缓存或下载的版本。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v4.7.2
  1. v4.7.2最新正式版2026-10-23 · 2026-10-23 17:58 UTC

    4.7.2 (2026-10-23)

    Bug Fixes

    • chat: avoid replaying notifications when reading history (550966c)
    • chat: include LID chats in list onlyUsers filter (c3e7729)
    • chat: pass options object to markUnread on WhatsApp >= 2.3000.1051327739 (c202eb0)
    • contact: resolve profile picture through thumb getters (626311c)
    • group: ensure invite job module before join fallback call (6e7d96a)
    • status: ensure revoke action module before remove (831beec)

    Tests

    • chat: cover unread action version compatibility (42fe3d5)

    Build System

    • deps-dev: update commitlint monorepo to ^21.2.4 (#3740) (b85ed2d), closes #3740
    • deps-dev: update dependency eslint to ^10.13.0 (7a3cdbe)
    • deps-dev: update dependency webpack to ^5.112.0 (#3733) (62b507b), closes #3733
    • deps-dev: update dependency webpack to ^5.112.1 (#3747) (c25a840), closes #3747
    • deps-dev: update typescript-eslint monorepo to ^8.72.0 (#3742) (ecda587), closes #3742
    • deps: bump markdown-it from 14.3.2 to 14.3.3 (a85c3f7)
    • deps: update node.js to v24.22.1 (#3744) (d7601f2), closes #3744

    Chores

    • ci: associate schedule with joaosouz4dev (17fc1eb)
  2. v4.7.12026-10-15 · 2026-10-15 22:34 UTC
    查看更新说明

    4.7.1 (2026-10-15)

    Features

    • mark messages as read with native unread counters (#3712) (abba270), closes #3712

    Bug Fixes

    • split MediaPrep bindings after WhatsApp moved prepRawMedia and uploadProductImage (#3732) (0c6d784), closes #3732

    Build System

    • deps: update node.js to v24.22.0 (#3728) (2e21a8c), closes #3728

    Continuous Integration

    • deps: update dependency node to v24.22.0 (#3729) (0a3bf38), closes #3729
  3. v4.7.02026-10-14 · 2026-10-14 14:59 UTC
    查看更新说明

    Highlights

    • Fix Pix key messages and preserve native payment payloads in WPP.chat.sendPixKeyMessage.
    • Fix native-flow buttons, group sender-key messages, and files with interactive buttons.
    • Avoid preloading the native attachment preview UI, resolving the media selection problem reported in #3716.
    • Return custom lists in synchronized device order with WPP.lists.list(), including orderIndex.
    • Add WPP.lists.setOrder(listIds) to reorder custom lists through WhatsApp's native persistence action. Pass every custom list ID exactly once; built-in list positions and colors are preserved. WhatsApp must enable list reordering for the account.
    const ids = WPP.lists.list().map(list => list.id);
    await WPP.lists.setOrder(ids.reverse());
    

    Validated with 179 unit tests, including 15 ordering cases, and all 59 pull request checks. Authenticated phone synchronization and real message sending were not tested in this release run.

    4.7.0 (2026-10-14)

    Features

    Bug Fixes

  4. v4.6.12026-10-02 · 2026-10-02 13:55 UTC
    查看更新说明

    4.6.1 (2026-10-02)

    Bug Fixes

    • call: place calls without the deep-link confirmation and return the call (#3677) (b35d2f0), closes #3677
    • changelog: restore grouped release notes and full CHANGELOG history (#3587) (f2458fd), closes #3587
    • chat: keep media encrypt/upload on the main thread (#3575) (0beac7e), closes #3575
    • community: bootload WAWebGroupCommunityJob before use (#3603) (93b9daa), closes #3603
    • conn: recover event registration when Stream arrives late (#3683) (98b435e), closes #3683
    • group: load the group creation job before use (#3681) (b4d9551), closes #3681
    • group: register the invite-code lazy module (#3654) (4ad31a0), closes #3654
    • group: resolve membership request participant identities (#3639) (53c9bec), closes #3639
    • group: support named description arguments (#3638) (ad0cd96), closes #3638
    • lists: preserve native mutation results and availability (#3641) (05e4ba7), closes #3641
    • loader: expire misses for predeclared Meta modules (#3640) (3d91212), closes #3640
    • loader: retry failed lazy bundles and skip unresolved modules (#3692) (93bca15), closes #3692
    • profile: load the profile name setter before use (#3682) (a1e8ffb), closes #3682
    • profile: read isSMB from WAWebConnGetters (#3602) (0c211f3), closes #3602
    • recover compatibility bindings on recent WhatsApp builds (#3632) (5ff28a1), closes #3632
    • status: support named encryption arguments (#3637) (7f326a0), closes #3637

    Tests

    • chat: cover main-thread media upload patch (#3611) (e4e54a4), closes #3611

    Build System

    • deps-dev: update commitlint monorepo to ^21.2.3 (#3667) (90fed63), closes #3667
    • deps-dev: update dependency @wppconnect/wa-version to ^1.5.4605 (#3588) (22efae5), closes #3588
  5. nightlyNightly Releasepre-release2021-10-12 · 2021-10-12 21:08 UTC
    查看更新说明

    4.7.3-alpha.0 (2026-11-06)

    Bug Fixes

    • chat: resolve newsletters from their own store (#3767) (4595d9e), closes #3767
    • chat: respect native newsletter action lifecycle (#3762) (5f134cb), closes #3762
    • deps: prevent glob amplification and retain import lint rules (#3764) (9065591), closes #3764
    • deps: prevent release tooling response-decoding crash (#3754) (dd533b7), closes #3754
    • loader: recover community participants on current WhatsApp (#3751) (13fec08), closes #3751

    Documentation

    • adopt official WPPConnect branding and API favicon (#3758) (1276b2f), closes #3758
    • refresh API reference visual design (#3766) (6a617d4), closes #3766
    • standardize bilingual READMEs and support guidance (2479f13)
    • update official WPPConnect logo and API favicon (#3765) (e1bd9e2), closes #3765

    Build System

    • deps-dev: bump fast-uri from 3.1.8 to 3.1.9 (3ee6227)
    • deps-dev: update dependency eslint to ^10.14.0 (#3760) (c97f9e4), closes #3760
    • deps-dev: update dependency release-it to ^21.1.2 (#3759) (1852440), closes #3759
    • deps-dev: update dependency webpack to ^5.112.2 (#3749) (59d6356), closes #3749
    • deps-dev: update dependency webpack-cli to ^7.3.1 (#3761) (96cecad), closes #3761
    • deps-dev: update playwright monorepo to ^1.65.0 (#3770) (f8c27c2), closes #3770
    • deps-dev: update typescript-eslint monorepo to ^8.72.1 (#3753) (fe73b0a), closes #3753
    • deps: update node.js to v24.22.2 (#3756) (a50ccf1), closes #3756
    • deps: update node.js to v26 (#3763) (1b7c75e), closes #3763

    Continuous Integration

    • deps: update dependency node to v26 (#3755) (5c5b6bb), closes #3755

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    English | Português (Brasil)

    WPPConnect/WA-JS

    Expose WhatsApp Web functions through the browser-side WPP API.

    A project in the WPPConnect ecosystem, maintained by WPPConnect Team.

    Getting started | Documentation | Contributing | Support WPPConnect

    License: Apache-2.0 npm version CI Open Collective

    Overview

    For extension and browser-integration developers who need to execute code inside WhatsApp Web. The generated dist/wppconnect-wa.js bundle exposes chat, contact, connection and other modules; it is not a Node.js WhatsApp client.

    Features

    • Chat and media operations, groups, communities, channels and business catalog functions.
    • Connection events, profile/privacy settings, labels and chat lists.
    • Typed exported WhatsApp modules and browser-injection tooling.

    Getting started

    Use Node.js/npm for the build and a browser with WhatsApp Web for execution. package.json declares WhatsApp Web >=2.3000.1038792969-alpha; individual capabilities may vary with WhatsApp updates.

    git clone https://github.com/wppconnect-team/wa-js.git
    cd wa-js
    npm ci
    npm run build:prd
    npm run launch:local
    

    The launcher opens a browser with the bundle injected. After signing in, evaluate this in that page's developer console to inspect the current authentication state:

    WPP.loader.onReady(() => {
      console.log(WPP.conn.isAuthenticated());
    });
    

    Configuration

    Set window.WPPConfig before injection for supported options in src/config. WA_VERSION selects a cached/downloaded version for the local launcher. Only load one default WPP bundle per page; the reference notes explain custom global names.

    Documentation

    WPPConnect ecosystem

    ProjectPurposeWhen to use it
    WPPConnectControl WhatsApp Web from Node.js applications.Embed automation in a Node.js application.
    Wppconnect ExtensionSend configured messages and attachments through a Chrome extension for WhatsApp Web.Use a Chrome UI over WA-JS.
    WPPConnect/WA-JS API SERVERServe URL-preview metadata and PNG payloads for WA-JS integrations.Provide a companion link-preview service.
    WPPConnect/WA-VersionTrack WhatsApp Web versions and retrieve stored page content.Investigate WhatsApp Web version compatibility.

    Support the project

    WPPConnect is maintained by an open-source community. Your support helps fund maintenance, infrastructure, documentation, and the people working on the ecosystem.

    If WPPConnect helps your project or business, consider making a one-time contribution or becoming a recurring supporter.

    Support WPPConnect on Open Collective

    Contributions are voluntary. See the official page for current financial information. You can also help with code, tests, documentation, translations and well-described issue reports.

    Additional official beneficiaries in .github/FUNDING.yml: joaosouz4dev, manfe.

    Contributing

    Contributions of code, tests, examples, documentation and translations are welcome. For larger changes, discuss the approach in an issue first. Include the project/runtime versions, a minimal reproduction and sanitized logs when reporting a problem. Update both README.md and README.pt-BR.md in the same change when installation, configuration, features, examples, licensing or funding changes.

    After installing the development dependencies, use the repository checks relevant to your change:

    npm run build:prd
    npm run lint
    npm test
    

    Account-dependent examples and tests require separate validation with an authorized test account. Never attach credentials or session files to an issue.

    Community and support

    Use repository issues for reproducible bugs and feature proposals. For usage questions, join the community through the official channels:

    This project is independent and is not affiliated with or endorsed by WhatsApp or Meta. Follow applicable terms and obtain authorization for account and messaging operations.

    License

    Apache License 2.0 (Apache-2.0).

    Copyright 2021 WPPConnect Team.

    The original legal document and existing copyright notices are preserved. Third-party components retain their own terms.