WA-JS ships as a single UMD bundle (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/wppconnect-team/wa-js/llms.txt
Use this file to discover all available pages before exploring further.
wppconnect-wa.js) that you inject into a running WhatsApp Web page. There is no server component — all calls happen inside the browser context. This page covers every supported way to get the bundle into the page, plus how to confirm it is ready before you call any WPP function.
npm package
Install the package from the npm registry if you are using a Node.js-based automation framework such as Playwright or Puppeteer.dist/index.d.ts.
CDN / script tag
If you are writing a userscript or loading WA-JS directly in a browser extension, reference the nightly release URL. This always points to the latest published build.tampermonkey-header.js
Playwright injection
With Playwright (or Puppeteer), useaddScriptTag with require.resolve to locate the bundle on disk after installing the npm package. This avoids hard-coding an absolute path.
playwright.ts
require.resolve('@wppconnect/wa-js') returns the absolute path to dist/wppconnect-wa.js inside node_modules. Playwright reads the file from disk and evaluates it inside the page, so it works even in environments without internet access.
Detecting the ready state
WA-JS initialises asynchronously. CallingWPP functions before initialisation completes will throw errors or return unexpected results. Use one of the two approaches below depending on your context.
Inside the page (userscripts, inline scripts)
browser-context.js
playwright.ts
WPP.isReady becomes true once the core modules are loaded. A separate WPP.isFullReady flag is set when every runtime chunk has been loaded — you only need this for advanced use cases.
Version compatibility
WA-JS requires WhatsApp Web 2.2326.10-beta or later (theengines.whatsapp-web field in package.json). The library is actively maintained to stay compatible with new WhatsApp Web versions as they roll out.
If WhatsApp Web ships an update that breaks an existing function, update your WA-JS dependency to pick up the latest compatibility patch: