@deploybaseline/whatsapp
v0.14.0
Published
WhatsApp Cloud API emulator for local development and tests: messages (text, media, template, interactive, reactions, location, contacts, read), media, message templates, phone numbers, webhook subscriptions with signed webhooks, and simulate endpoints th
Readme
@deploybaseline/whatsapp
WhatsApp Cloud API emulator for local development and tests: messages (text, media, template, interactive, reactions, location, contacts, read), media, message templates, phone numbers, webhook subscriptions with signed webhooks, and simulate endpoints that act as WhatsApp users.
Part of Baseline: local drop-in replacement services for CI and no-network sandboxes.
Usage
npx @deploybaseline/cli start --service whatsappWhatsApp starts only when named in config or with --service. In tests, start it from code:
import { createEmulator } from "@deploybaseline/cli";
const whatsapp = await createEmulator({ service: "whatsapp" });
const res = await fetch(`${whatsapp.url}/v24.0/106540352242922/messages`, {
method: "POST",
headers: { Authorization: "Bearer baseline-whatsapp-token", "Content-Type": "application/json" },
body: JSON.stringify({ messaging_product: "whatsapp", to: "16505551234", type: "text", text: { body: "Hi" } }),
});
await whatsapp.close();Documentation
- WhatsApp docs: default fixtures, auth, messages, the customer service window, templates, media, webhooks, simulate endpoints, errors, and seed config
- API reference:
http://localhost:3999/docs/whatsappwhile the CLI runs (how it works)
License
Apache-2.0
