Skip to content
CAI
Software that uses CAICheck a score

wwebjs/whatsapp-web.js

52.7

Adequate · 1 October 2026

10.4k

lines of production code

JavaScript

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a TypeScript library that automates interactions with WhatsApp Web by controlling a Puppeteer-based browser instance. It provides a client API for managing sessions, sending messages, and handling group or contact operations, supported by modular authentication strategies and version caching mechanisms. The codebase includes tooling for automated version detection and release management, along with integration tests to verify client behavior against live sessions.

How it got here

2019 — Initial project scaffolding and core library release

5 changes.

This period established the foundational architecture of the WhatsApp Web client library, including repository initialization, core utility infrastructure, and the primary Client class for session management and browser automation. It also introduced structural refactoring to support new WhatsApp Web features and ID changes, alongside essential dependency updates to ensure compatibility with modern Node.js and Puppeteer versions.

2021–2026 — Authentication refactoring and release automation

8 changes.

This period focused on refactoring the authentication system into modular strategies and implementing comprehensive integration tests for core client structures. It also introduced tooling for automated version detection, release publishing, and strict commit workflow enforcement to improve reliability and developer experience.

Features

Added WhatsApp Web version caching support

The src/webCache module now provides a factory and concrete implementations for caching WhatsApp Web versions. Users can configure caching via a 'local' strategy (storing HTML files in a local directory, defaulting to ./.wwebjs\_cache/) or a 'remote' strategy (fetching from a configurable URL endpoint), with an option to enforce strict resolution that throws an error if a version is not found.

src/webCache · high confidence

Automated WhatsApp Web version detection and update tooling

The tools/version-checker directory now includes a Node.js script (update-version) that uses Puppeteer to launch a headless browser, navigate to WhatsApp Web, and extract the current build version from the page's runtime constants. This script compares the detected version against the locally stored version in .version and, if they differ, automatically updates the version string in the source constants file (src/util/Constants.js) and the documentation (README.md). A new .version file has been added to track the currently supported version (2.3000.1017054665).

tools/version-checker · high confidence

Initial project scaffolding and configuration

The repository is initialized with essential configuration files including an Apache 2.0 license, ESLint and Prettier rules, JSDoc settings, and a commitlint configuration. A comprehensive TypeScript definition file (index.d.ts) is added to provide type safety for the library's public API, alongside an interactive shell (shell.js) for rapid development and testing. The README is also updated with installation instructions, usage examples, and a feature support matrix.

(repo-wide) · high confidence

Initial release of the WhatsApp Web client library

This change introduces the core \Client\ class, serving as the primary entry point for interacting with the WhatsApp Web API. It establishes the foundational architecture for session management via authentication strategies, browser automation using Puppeteer, and event-driven communication for messages, contacts, groups, and connection states.

src · high confidence

Introduction of modular authentication strategies (Local, Remote, NoAuth)

The authentication system has been refactored into a strategy pattern with a new \BaseAuthStrategy\ class and three concrete implementations: \LocalAuth\, \RemoteAuth\, and \NoAuth\. \LocalAuth\ manages session persistence using local directories, enforcing compatibility checks against user-supplied \userDataDir\ and supporting configurable retry logic for directory cleanup. \RemoteAuth\ enables session backup and restoration via a remote database store, handling ZIP compression, periodic syncing, and optional dependency validation. \NoAuth\ provides a minimal strategy that requires QR code authentication on every session start. This change allows users to select the authentication method that best fits their deployment environment.

src/authStrategies · high confidence

Introduction of utility infrastructure for WhatsApp Web interaction

This change introduces the core utility layer for the client, establishing a centralized configuration system in Constants.js that defines default options (including the supported WhatsApp Web version 2.3000.1017054665), client status codes, a comprehensive set of emitted events (such as message reactions, polls, and group updates), and message type enums. It adds an InterfaceController to manage WhatsApp Web UI interactions like opening chats, searching, and toggling feature flags, alongside a Puppeteer helper for safely exposing functions to the browser context. Additionally, it provides a Util module for handling media processing (converting images and videos to WebP stickers with metadata) and default option merging.

src/util · high confidence

New release automation scripts for changelog and publishing

Added two new executable scripts in the tools directory to streamline the release process. The \changelog.sh\ script generates a commit log for the current release by comparing the latest tag against HEAD. The \publish\ script automates the full release workflow, including version bumping (supporting alpha, patch, and minor modes), documentation generation, and publishing to npm with support for both local authentication and GitHub Actions OIDC trusted publishing, while ensuring the operation only proceeds on the main branch with a clean working tree.

tools · high confidence

Behavioural changes

Enforced commit message formatting and staged file linting

The development workflow now automatically enforces coding standards before changes are accepted. Commit messages are normalized to lowercase types and validated against commitlint rules, ensuring consistent history. Additionally, staged files are automatically linted via lint-staged before each commit, helping to catch style or syntax issues early.

.husky · high confidence

Structures refactored to support WhatsApp Web ID changes and new features

The \src/structures\ directory has been completely rewritten to introduce a factory pattern for creating Chat and Contact instances, ensuring the correct subclass (e.g., GroupChat, BusinessContact, Channel) is instantiated based on the data. A new \Base\ class provides an \\_normalizeId\ helper to maintain backward compatibility with WhatsApp Web's ID structure changes (switching from \\_serialized\ to \$1\). The update adds support for new WhatsApp features including Channels, Broadcasts (Status/Story), Calls, and Polls, while also introducing new message types like Buttons and Lists.

src/structures · high confidence

Fixes

Fix chat.isReadOnly and other utility injections in Utils.js

The newly added src/util/Injected/Utils.js file implements core utility functions for the WhatsApp Web interface, including version comparison, function injection, message forwarding, and sending seen statuses. This change specifically addresses the chat.isReadOnly issue mentioned in the commit history, ensuring that read-only status is correctly handled. Additionally, it includes fixes for media handling (dropping \_\_x\_id before spreading mediaOptions), group chat participant addition, and message forwarding with captions. The file also provides methods for sending messages with various options like stickers, quotes, and media types, while ensuring compatibility with different WhatsApp Web versions through the compareWwebVersions helper.

src/util/Injected · high confidence

Test coverage

Add integration test suite for WhatsApp Web client; Added integration tests for Chat, Group, and Message structures.

Dependencies

Update to version 1.34.7 with dependency upgrades

The library has been updated to version 1.34.7, introducing several dependency upgrades and a stricter runtime requirement. Puppeteer has been upgraded to version 24.38.0, and node-webpmux to 3.2.1. Development tooling has also been updated, including Mocha to 11.7.5, ESLint to 9.39.4, and Sinon to 21.0.2. Additionally, the minimum required Node.js version is now 18.0.0.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 52 → 53 (+0.2)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 45 → 44 (-1.0)
  • Architecture 100 → 99 (-0.8)
  • Maturity 57 → 55 (-2.1)
  • Readiness 61 → 62 (+0.5)
  • Security 53 → 67 (+14.2)
  • Performance 60 (new)

Resolved (2)

  • Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no pnpm-resolved versions to grade)
  • Hotspot: src/Client.js (src/Client.js)

New (15)

  • Banned license: node-webpmux
  • FileTooLong: Injected/Utils.js (src/util/Injected/Utils.js)
  • FunctionTooLong: Utils.LoadUtils (src/util/Injected/Utils.js)
  • FunctionTooLong: example.client.on("message") (example.js)
  • Hotspot: src/structures/GroupChat.js (src/structures/GroupChat.js)
  • Hotspot: src/util/Injected/Utils.js (src/util/Injected/Utils.js)
  • LoadUtils::getChatModel (cyclomatic 18) (src/util/Injected/Utils.js)
  • Low cohesion: GroupChat (LCOM4 11) (src/structures/GroupChat.js)
  • Outdated (npm): mime
  • Outdated (npm): node-fetch
  • Outdated (npm): puppeteer
  • Utils.LoadUtils (cognitive 70) (src/util/Injected/Utils.js)
  • Utils.LoadUtils (cyclomatic 256) (src/util/Injected/Utils.js)
  • example.client.on("message") (cognitive 106) (example.js)
  • example.client.on("message") (cyclomatic 80) (example.js)

Changes since last survey

  • 2 commits — 0 feature/other, 2 fixes

By area

  • src/structures — 1 commit
  • src/util — 1 commit

Notable commits

  • fix: fix(client): add fallback for WhatsApp id._serialized renamed to id.$1 (#201832)
  • fix: fix(media): drop __x_id before spreading mediaOptions into outgoing Msg (#201923)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

wwebjs/whatsapp-web.js was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 064a3d5a5a3dce1281a6a12740b5a7051339d154 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.