Skip to main content

WhatsApp

Send text and template messages via Meta’s WhatsApp Business Cloud API. No third-party SDKs required — uses native fetch.

Prerequisites

1

Create Meta Developer Account

Go to Meta Developer Portal and create a new app with WhatsApp integration.
2

Get Credentials

From the WhatsApp section of your app dashboard, get your Access Token and Phone Number ID.
3

Set Environment Variables

For first-time outreach to a number, you must use pre-approved message templates. Text messages can only be sent within the 24-hour messaging window after a user messages you first.

Quick Start


Config

string
WhatsApp Business API access token. Falls back to WHATSAPP_ACCESS_TOKEN env var.
string
WhatsApp Business phone number ID. Falls back to WHATSAPP_PHONE_NUMBER_ID env var.
string
default:"v22.0"
API version. Falls back to WHATSAPP_VERSION env var.
string
Default recipient WhatsApp ID (e.g. "919876543210"). Falls back to WHATSAPP_RECIPIENT_WAID env var.

Tools


Example: Send a Text Message

Example: Send a Template Message