playground
Try the SDK, copy the code.
Pick a method, set its options, then copy TypeScript or JavaScript that is ready to run. Preview the exact Graph API request the SDK builds and a sample of the { data, error } result. Nothing is sent to WhatsApp from this page.
Send a plain text message, optionally with a link preview.
read the docs2 · set parameters
Phone number (international, no +), group ID, or a BSUID like US.13491208655302741918 (routed to `recipient` automatically).
Generate a web preview card for URLs in the text.
Send optionsSendOptions
Use "group" when "to" is a group ID from whatsapp.groups.
Quote an inbound message (sets context.message_id).
Echoed back in status webhooks. Max 512 chars.
Output & client settings
import { Whatsapp } from "wapi-cloud";
const whatsapp = new Whatsapp({
accessToken: process.env.WA_TOKEN!,
phoneNumberId: process.env.WA_PHONE_ID!,
});
const { data, error } = await whatsapp.messages.sendText("15551234567", {
body: "Hello from wapi-cloud!",
});
if (error) {
console.error(error.code, error.type, error.message);
} else {
console.log(data);
}Install with npm install wapi-cloud. Credentials are read from environment variables unless you chose placeholders.