Build WhatsApp Bots
with Wabot

A client-side JavaScript library that automates WhatsApp Web for building normal and agentic bots. No WhatsApp Business API required.

Features

Client-Side Automation

Controls WhatsApp Web via Playwright browser automation. No API credentials needed. The bot interacts with the UI exactly as a human user would.

Dual Authentication

Supports both QR code scanning and phone pairing code. Use either independently. Session persistence for reconnection without re-auth.

Full API Surface

Send text, media, location, contacts, buttons, lists, polls. Manage chats, groups, contacts, profile. Download media. Search messages.

Agentic Ready

Event-driven architecture with typed events. Build autonomous bots that react to messages, acks, reactions, presence changes, and calls.

Secure by Default

AES-256-GCM session encryption, input validation on every API surface, token bucket rate limiting, circuit breaker, anti-detection measures.

Cloudflare Pages

REST API gateway hosted on Cloudflare Pages. No Workers needed. Free plan compatible. Stateless proxy to your bot host.

Quick Start

// Install
npm install wabot

// Use in your project
import { Wabot } from 'wabot';

const bot = await Wabot.create({
  session: 'my-bot',
  connectionMode: 'qr',
  onReady: () => console.log('Ready!'),
  onMessage: (msg) => console.log(msg.body),
});

await bot.sendText('2348012345678@c.us', 'Hello from Wabot!');

REST API Gateway

The Wabot API gateway is hosted on Cloudflare Pages. It proxies requests to your Wabot host instance.

MethodEndpointDescription
POST/api/v1/session/startStart a new bot session
GET/api/v1/session/statusGet session status
POST/api/v1/session/qrGet QR code
POST/api/v1/session/pairing-codeGet pairing code
POST/api/v1/send/textSend text message
POST/api/v1/send/mediaSend media message
POST/api/v1/send/broadcastSend broadcast (5/batch)
GET/api/v1/chatsList all chats
GET/api/v1/contactsList all contacts
GET/api/v1/groupsList all groups
GET/api/v1/healthHealth check