💬 🤖 The most reliable tool for chatbots with advanced features. Be sure to 🌟 this repository for updates!
See the code[!WARNING] When you use this project, you explicitly agree to the Terms of Service.
This project is unofficial and is not affiliated with WhatsApp or Meta. Use it at your own risk.
[!NOTE] Version 5 is the current release line. Existing v4 applications should use an explicit v4 version while they migrate; unqualified installs use v5.
Turn a WhatsApp account into an API, bot runtime, webhook bridge, and AI tool surface.
Easy API - SocketClient - Embedded runtime - Plugins - MCP - Support
@open-wa/wa-automate is a Node.js toolkit for WhatsApp Web automation. You can make a local API, bot backend, webhook source, plugin host, or MCP server.
This repository is the v5 monorepo. Its packages share the stable 5.0.0 release and use separate modules for the runtime, drivers, API, and integrations.
Need a WhatsApp API running quickly? Start with Easy API. Want the browser/runtime inside your own app? Use the embedded runtime. Building integrations, proxying sessions, or exposing WhatsApp to an AI agent? Those surfaces are in this repo too.
| Surface | What it gives you | Start here |
|---|---|---|
| Easy API | Run WhatsApp as a local HTTP API with docs and generated schemas | Quick start |
| SocketClient | Connect another Node.js app to a running Easy API instance | Simple automation |
| Embedded runtime | Own the runtime lifecycle directly through createClient | Deep integration |
| Browser drivers | Choose Puppeteer, Playwright, or Lightpanda-backed runtime packages | Embedded runtime |
| Plugins | Load reusable integrations with plugins and pluginConfig | Plugins and integrations |
| Webhooks | Push WhatsApp events into your own service | Plugins and integrations |
| Chatwoot | Bridge WhatsApp into Chatwoot conversations | Plugins and integrations |
| Cloudflare proxy | Get remote access to a local session without direct exposure of local ports | Cloudflare Session Proxy |
| MCP | Let AI agents discover and call Easy API methods as tools | AI-agent integration |
| If you want to... | Start here |
|---|---|
| get a WhatsApp-backed API running in minutes | Quick start: Easy API |
| build a bot without owning the browser runtime | Simple automation: SocketClient |
| own the runtime inside your own Node.js app | Deep integration: embedded runtime |
| move an existing v4 application to v5 | Migrating from v4 to v5 |
| publish or share reusable automation pieces | Plugins and integrations |
You can use this project in a few practical ways:
Want to convert a WhatsApp account into an API with the least ceremony? Run the CLI:
npx @open-wa/wa-automate@latest --port 8080
That starts an Easy API instance, launches the first-run authentication flow, and exposes interactive docs for the live session.
Use an explicit version in deployments that need repeatable installs.
For first login, the runtime will ask you to authenticate. Depending on your setup, either:
Once the session is connected, open:
http://localhost:8080/api-docs/
That page is your first proof of life: the session is up, the API is reachable, and the method surface is discoverable.
Other useful generated artifacts:
http://localhost:8080/meta/swagger.json
http://localhost:8080/meta/postman.json
Useful first commands:
# choose a port
npx @open-wa/wa-automate@latest --port 8080
# provide your own API key
npx @open-wa/wa-automate@latest --port 8080 --api-key "your-secure-key"
# run a named session
npx @open-wa/wa-automate@latest --session-id sales --port 8081
Good defaults for a first real session:
sessionId early if you might run more than one account--api-key before exposing it outside your machineIf your goal is simply "connect WhatsApp to another service", configure @open-wa/integration-webhook in wa.config.*. The v5 CLI parses --webhook but currently warns that CLI webhook registration parity is not restored, so that flag does not enable source-backed delivery. See Webhooks for Business for the working configuration.
If you prefer Docker:
docker run -p 8080:8080 --init openwa/wa-automate
Docker notes:
--init so the init process removes zombie processesW_A_V, for example -e W_A_V=4.42.1Building a bot, worker, or app integration? Keep the WhatsApp runtime in Easy API and let your Node.js app act as a clean remote consumer.
Start the runtime:
npx @open-wa/wa-automate@latest --port 8080 --api-key "your-secure-key"
Install the remote consumer in your app:
npm install @open-wa/socket-client
Keep the Easy API process running. Your app is a remote consumer, not the runtime host.
Then connect from your app:
import { SocketClient } from '@open-wa/socket-client';
async function start() {
const client = await SocketClient.connect('http://localhost:8080', 'your-secure-key');
client.onMessage(async (message) => {
if (message.body === 'Hi') {
await client.sendText(message.from, '👋 Hello!');
}
});
}
start().catch(console.error);
Why this path is good for most builders:
Use this choice to deploy automation quickly. The Easy API process owns browser setup, session lifecycle, and API hosting.
If Easy API is the hosted engine, embedded runtime is the cockpit. Use it when your app needs to own browser selection, lifecycle, and runtime behavior directly.
The v5 public contract exposes createClient from @open-wa/core through @open-wa/wa-automate.
This path is lower-level than Easy API + SocketClient. Use it when runtime ownership matters more than the quickest working bot.
npm install @open-wa/wa-automate @open-wa/driver-puppeteer
import { createClient } from '@open-wa/wa-automate';
import { PuppeteerDriver } from '@open-wa/driver-puppeteer';
async function start() {
const client = await createClient({
sessionId: 'sales',
driver: new PuppeteerDriver(),
headless: true,
});
client.onMessage(async (message) => {
if (message.body === 'Hi') {
await client.sendText(message.from, '👋 Hello!');
}
});
}
start().catch(console.error);
Important v5 reality:
createClientAvailable runtime driver packages in this repo:
@open-wa/driver-puppeteer@open-wa/driver-playwright@open-wa/driver-lightpandaUse the embedded path when you need deeper control over browser selection, runtime lifecycle, or infrastructure behavior.
Common config fields documented in the repo’s current config schema and docs include:
sessionIdheadlessuseChrome / executablePathqrTimeout / authTimeoutlicenseKeylinkCodepluginspluginConfigCommon high-value CLI flags include:
--port 8080
--api-key "your-secure-key"
--session-id sales
--config ./wa.config.mjs
--pm2
--license-key "YOUR-LICENSE-KEY"
Some older docs and examples still mention additional legacy or transitional flags. For v5 onboarding, prefer the smaller set above unless you have verified the exact flag against the version you are running.
For contributors to this monorepo, the repo currently declares:
>=22.21.111.15.1The exact toolchain is pinned in mise.toml (mise install),
and the full contributor setup — including browser-automation dependencies —
is documented in CONTRIBUTING.md.
pnpm install
pnpm build
This repo is no longer just a single package. It includes a plugin/integration surface for extending the runtime.
Want to build one? Start with the plugin authoring guide (@open-wa/plugin-sdk).
Relevant packages in this repo:
@open-wa/plugin-sdk@open-wa/integration-webhook@open-wa/integration-chatwoot@open-wa/integration-s3@open-wa/integration-cloudflare@open-wa/node-redThe current config schema supports plugin references as npm package names or file paths:
plugins: [
'@open-wa/integration-chatwoot',
'@open-wa/integration-webhook',
'./my-local-plugin'
],
pluginConfig: {
webhook: {
// plugin-specific config
}
}
The safest documented path today is:
plugins and pluginConfig entries they needGood examples to copy from in this repo:
The docs do not yet define these stable public workflows:
So today, “share a plugin” realistically means “publish a package users can install and load”.
If you want remote access without exposing local ports, this repo ships @open-wa/cf-proxy.
High-level flow:
Example consumer connection:
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect(
'cf-proxy://open-wa-proxy.account.workers.dev?sessionId=my-session&token=CONSUMER_TOKEN'
);
This is the cleanest path if you want remote access but do not want to invent your own transport bridge.
If your goal is to let an AI agent interact with WhatsApp, the cleanest surface is the built-in Model Context Protocol server.
MCP exposes each Easy API method as a tool. AI agents such as Claude, Cursor, and Windsurf can call these tools directly.
Create wa.config.mjs:
export default {
apiKey: process.env.WA_API_KEY,
port: 8080,
mcp: {
enabled: true,
path: '/mcp',
exposeToolsMeta: true,
},
};
Then start the v5 Easy API from the same directory:
WA_API_KEY="your-secure-key" npx @open-wa/wa-automate@latest --config ./wa.config.mjs
Then point your MCP client at:
http://localhost:8080/mcp
Add to your claude_desktop_config.json:
{
"mcpServers": {
"open-wa": {
"url": "http://localhost:8080/mcp",
"headers": {
"X-API-Key": "your-secure-key"
}
}
}
}
Add a new MCP server with the URL http://localhost:8080/mcp and include X-API-Key in headers.
http://localhost:8080/dashboard/mcp{
apiKey: process.env.WA_API_KEY,
mcp: {
enabled: true,
path: '/mcp',
exposeToolsMeta: true,
},
}
The current v5 source does not parse --mcp. Enable MCP through wa.config.* as shown above.
MCP is an Easy API-only feature. It is not available through createClient(). The API key is mandatory — MCP refuses to start without one. Discovery (tool listing) and execution require authentication.
If you prefer HTTP, give your agent the Easy API docs surface instead:
http://localhost:8080/api-docs/http://localhost:8080/meta/swagger.jsonhttp://localhost:8080/meta/postman.jsonThe npm latest tag now selects v5. Pin v4 explicitly while migrating an existing application:
npx @open-wa/wa-automate@4.76.0
The v5 runtime has a different public surface, so update existing integrations deliberately:
http://localhost:8080/api-docs/ workscreateClient only when you need direct runtime ownershipThe current docs organize information by usage mode. Start with:
If you want to work on the monorepo itself:
git clone https://github.com/open-wa/wa-automate-nodejs.git
cd wa-automate-nodejs
pnpm install
pnpm build
Useful root scripts:
pnpm dev
pnpm test
pnpm lint
pnpm typecheck
If you need help, paid support, or consulting:
| Description | Link |
|---|---|
| Documentation | https://openwa.dev |
| Discord | https://discord.gg/dnpp72a |
| Get a license key | https://openwa.page.link/key |
| Donate or book 1 hour consult | |
| Per-minute consulting | |
| Hire me |
Hippocratic + Do Not Harm Version 1.1
This code is in no way affiliated with, authorized, maintained, sponsored, or endorsed by WhatsApp or any of its affiliates or subsidiaries. This is independent and unofficial software.
This distribution includes cryptographic software. Your country can restrict the import, possession, use, or re-export of encryption software. Examine your local laws before you use it. Refer to http://www.wassenaar.org/ for more information.
The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), classifies this software as ECCN 5D002.C.1. This classification includes information security software that has cryptographic functions with asymmetric algorithms. This distribution is eligible for the License Exception ENC Technology Software Unrestricted (TSU) exception. Refer to Section 740.13 of the BIS Export Administration Regulations for object code and source code.
193 followers · starred May 2026
720 followers · starred Apr 2025
83 followers · starred Mar 2025
135 followers · starred Nov 2021
💬 🤖 The most reliable tool for chatbots with advanced features. Be sure to 🌟 this repository for updates!
See the code[!WARNING] When you use this project, you explicitly agree to the Terms of Service.
This project is unofficial and is not affiliated with WhatsApp or Meta. Use it at your own risk.
[!NOTE] Version 5 is the current release line. Existing v4 applications should use an explicit v4 version while they migrate; unqualified installs use v5.
Turn a WhatsApp account into an API, bot runtime, webhook bridge, and AI tool surface.
Easy API - SocketClient - Embedded runtime - Plugins - MCP - Support
@open-wa/wa-automate is a Node.js toolkit for WhatsApp Web automation. You can make a local API, bot backend, webhook source, plugin host, or MCP server.
This repository is the v5 monorepo. Its packages share the stable 5.0.0 release and use separate modules for the runtime, drivers, API, and integrations.
Need a WhatsApp API running quickly? Start with Easy API. Want the browser/runtime inside your own app? Use the embedded runtime. Building integrations, proxying sessions, or exposing WhatsApp to an AI agent? Those surfaces are in this repo too.
| Surface | What it gives you | Start here |
|---|---|---|
| Easy API | Run WhatsApp as a local HTTP API with docs and generated schemas | Quick start |
| SocketClient | Connect another Node.js app to a running Easy API instance | Simple automation |
| Embedded runtime | Own the runtime lifecycle directly through createClient | Deep integration |
| Browser drivers | Choose Puppeteer, Playwright, or Lightpanda-backed runtime packages | Embedded runtime |
| Plugins | Load reusable integrations with plugins and pluginConfig | Plugins and integrations |
| Webhooks | Push WhatsApp events into your own service | Plugins and integrations |
| Chatwoot | Bridge WhatsApp into Chatwoot conversations | Plugins and integrations |
| Cloudflare proxy | Get remote access to a local session without direct exposure of local ports | Cloudflare Session Proxy |
| MCP | Let AI agents discover and call Easy API methods as tools | AI-agent integration |
| If you want to... | Start here |
|---|---|
| get a WhatsApp-backed API running in minutes | Quick start: Easy API |
| build a bot without owning the browser runtime | Simple automation: SocketClient |
| own the runtime inside your own Node.js app | Deep integration: embedded runtime |
| move an existing v4 application to v5 | Migrating from v4 to v5 |
| publish or share reusable automation pieces | Plugins and integrations |
You can use this project in a few practical ways:
Want to convert a WhatsApp account into an API with the least ceremony? Run the CLI:
npx @open-wa/wa-automate@latest --port 8080
That starts an Easy API instance, launches the first-run authentication flow, and exposes interactive docs for the live session.
Use an explicit version in deployments that need repeatable installs.
For first login, the runtime will ask you to authenticate. Depending on your setup, either:
Once the session is connected, open:
http://localhost:8080/api-docs/
That page is your first proof of life: the session is up, the API is reachable, and the method surface is discoverable.
Other useful generated artifacts:
http://localhost:8080/meta/swagger.json
http://localhost:8080/meta/postman.json
Useful first commands:
# choose a port
npx @open-wa/wa-automate@latest --port 8080
# provide your own API key
npx @open-wa/wa-automate@latest --port 8080 --api-key "your-secure-key"
# run a named session
npx @open-wa/wa-automate@latest --session-id sales --port 8081
Good defaults for a first real session:
sessionId early if you might run more than one account--api-key before exposing it outside your machineIf your goal is simply "connect WhatsApp to another service", configure @open-wa/integration-webhook in wa.config.*. The v5 CLI parses --webhook but currently warns that CLI webhook registration parity is not restored, so that flag does not enable source-backed delivery. See Webhooks for Business for the working configuration.
If you prefer Docker:
docker run -p 8080:8080 --init openwa/wa-automate
Docker notes:
--init so the init process removes zombie processesW_A_V, for example -e W_A_V=4.42.1Building a bot, worker, or app integration? Keep the WhatsApp runtime in Easy API and let your Node.js app act as a clean remote consumer.
Start the runtime:
npx @open-wa/wa-automate@latest --port 8080 --api-key "your-secure-key"
Install the remote consumer in your app:
npm install @open-wa/socket-client
Keep the Easy API process running. Your app is a remote consumer, not the runtime host.
Then connect from your app:
import { SocketClient } from '@open-wa/socket-client';
async function start() {
const client = await SocketClient.connect('http://localhost:8080', 'your-secure-key');
client.onMessage(async (message) => {
if (message.body === 'Hi') {
await client.sendText(message.from, '👋 Hello!');
}
});
}
start().catch(console.error);
Why this path is good for most builders:
Use this choice to deploy automation quickly. The Easy API process owns browser setup, session lifecycle, and API hosting.
If Easy API is the hosted engine, embedded runtime is the cockpit. Use it when your app needs to own browser selection, lifecycle, and runtime behavior directly.
The v5 public contract exposes createClient from @open-wa/core through @open-wa/wa-automate.
This path is lower-level than Easy API + SocketClient. Use it when runtime ownership matters more than the quickest working bot.
npm install @open-wa/wa-automate @open-wa/driver-puppeteer
import { createClient } from '@open-wa/wa-automate';
import { PuppeteerDriver } from '@open-wa/driver-puppeteer';
async function start() {
const client = await createClient({
sessionId: 'sales',
driver: new PuppeteerDriver(),
headless: true,
});
client.onMessage(async (message) => {
if (message.body === 'Hi') {
await client.sendText(message.from, '👋 Hello!');
}
});
}
start().catch(console.error);
Important v5 reality:
createClientAvailable runtime driver packages in this repo:
@open-wa/driver-puppeteer@open-wa/driver-playwright@open-wa/driver-lightpandaUse the embedded path when you need deeper control over browser selection, runtime lifecycle, or infrastructure behavior.
Common config fields documented in the repo’s current config schema and docs include:
sessionIdheadlessuseChrome / executablePathqrTimeout / authTimeoutlicenseKeylinkCodepluginspluginConfigCommon high-value CLI flags include:
--port 8080
--api-key "your-secure-key"
--session-id sales
--config ./wa.config.mjs
--pm2
--license-key "YOUR-LICENSE-KEY"
Some older docs and examples still mention additional legacy or transitional flags. For v5 onboarding, prefer the smaller set above unless you have verified the exact flag against the version you are running.
For contributors to this monorepo, the repo currently declares:
>=22.21.111.15.1The exact toolchain is pinned in mise.toml (mise install),
and the full contributor setup — including browser-automation dependencies —
is documented in CONTRIBUTING.md.
pnpm install
pnpm build
This repo is no longer just a single package. It includes a plugin/integration surface for extending the runtime.
Want to build one? Start with the plugin authoring guide (@open-wa/plugin-sdk).
Relevant packages in this repo:
@open-wa/plugin-sdk@open-wa/integration-webhook@open-wa/integration-chatwoot@open-wa/integration-s3@open-wa/integration-cloudflare@open-wa/node-redThe current config schema supports plugin references as npm package names or file paths:
plugins: [
'@open-wa/integration-chatwoot',
'@open-wa/integration-webhook',
'./my-local-plugin'
],
pluginConfig: {
webhook: {
// plugin-specific config
}
}
The safest documented path today is:
plugins and pluginConfig entries they needGood examples to copy from in this repo:
The docs do not yet define these stable public workflows:
So today, “share a plugin” realistically means “publish a package users can install and load”.
If you want remote access without exposing local ports, this repo ships @open-wa/cf-proxy.
High-level flow:
Example consumer connection:
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect(
'cf-proxy://open-wa-proxy.account.workers.dev?sessionId=my-session&token=CONSUMER_TOKEN'
);
This is the cleanest path if you want remote access but do not want to invent your own transport bridge.
If your goal is to let an AI agent interact with WhatsApp, the cleanest surface is the built-in Model Context Protocol server.
MCP exposes each Easy API method as a tool. AI agents such as Claude, Cursor, and Windsurf can call these tools directly.
Create wa.config.mjs:
export default {
apiKey: process.env.WA_API_KEY,
port: 8080,
mcp: {
enabled: true,
path: '/mcp',
exposeToolsMeta: true,
},
};
Then start the v5 Easy API from the same directory:
WA_API_KEY="your-secure-key" npx @open-wa/wa-automate@latest --config ./wa.config.mjs
Then point your MCP client at:
http://localhost:8080/mcp
Add to your claude_desktop_config.json:
{
"mcpServers": {
"open-wa": {
"url": "http://localhost:8080/mcp",
"headers": {
"X-API-Key": "your-secure-key"
}
}
}
}
Add a new MCP server with the URL http://localhost:8080/mcp and include X-API-Key in headers.
http://localhost:8080/dashboard/mcp{
apiKey: process.env.WA_API_KEY,
mcp: {
enabled: true,
path: '/mcp',
exposeToolsMeta: true,
},
}
The current v5 source does not parse --mcp. Enable MCP through wa.config.* as shown above.
MCP is an Easy API-only feature. It is not available through createClient(). The API key is mandatory — MCP refuses to start without one. Discovery (tool listing) and execution require authentication.
If you prefer HTTP, give your agent the Easy API docs surface instead:
http://localhost:8080/api-docs/http://localhost:8080/meta/swagger.jsonhttp://localhost:8080/meta/postman.jsonThe npm latest tag now selects v5. Pin v4 explicitly while migrating an existing application:
npx @open-wa/wa-automate@4.76.0
The v5 runtime has a different public surface, so update existing integrations deliberately:
http://localhost:8080/api-docs/ workscreateClient only when you need direct runtime ownershipThe current docs organize information by usage mode. Start with:
If you want to work on the monorepo itself:
git clone https://github.com/open-wa/wa-automate-nodejs.git
cd wa-automate-nodejs
pnpm install
pnpm build
Useful root scripts:
pnpm dev
pnpm test
pnpm lint
pnpm typecheck
If you need help, paid support, or consulting:
| Description | Link |
|---|---|
| Documentation | https://openwa.dev |
| Discord | https://discord.gg/dnpp72a |
| Get a license key | https://openwa.page.link/key |
| Donate or book 1 hour consult | |
| Per-minute consulting | |
| Hire me |
Hippocratic + Do Not Harm Version 1.1
This code is in no way affiliated with, authorized, maintained, sponsored, or endorsed by WhatsApp or any of its affiliates or subsidiaries. This is independent and unofficial software.
This distribution includes cryptographic software. Your country can restrict the import, possession, use, or re-export of encryption software. Examine your local laws before you use it. Refer to http://www.wassenaar.org/ for more information.
The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), classifies this software as ECCN 5D002.C.1. This classification includes information security software that has cryptographic functions with asymmetric algorithms. This distribution is eligible for the License Exception ENC Technology Software Unrestricted (TSU) exception. Refer to Section 740.13 of the BIS Export Administration Regulations for object code and source code.
193 followers · starred May 2026
720 followers · starred Apr 2025
83 followers · starred Mar 2025
135 followers · starred Nov 2021