Introduction
meta-cloud-api is a TypeScript SDK wrapper for Meta’s WhatsApp Cloud API. It provides a type-safe, modular interface for building WhatsApp Business Platform integrations.
Why meta-cloud-api?
- Type-safe — Full TypeScript strict mode with types for every endpoint
- Comprehensive — 17 API modules covering all WhatsApp Cloud API features
- Modular — Tree-shakeable imports, use only what you need
- Framework-ready — Built-in webhook adapters for Express.js and Next.js
Quick Example
import WhatsApp from 'meta-cloud-api';
const client = new WhatsApp({ accessToken: process.env.CLOUD_API_ACCESS_TOKEN, phoneNumberId: Number(process.env.WA_PHONE_NUMBER_ID), businessAcctId: process.env.WA_BUSINESS_ACCOUNT_ID,});
// Send a text messageawait client.messages.text({ to: '15551234567', body: 'Hello!' });
// Send a template messageawait client.messages.template({ to: '15551234567', name: 'hello_world', language: { code: 'en_US' },});Prerequisites
- Node.js >= 18
- A Meta WhatsApp Business Account
- Cloud API access token, phone number ID, and WABA ID
Next Steps
- Installation — Add the SDK to your project
- Quick Start — Send your first message
- Architecture — Understand how the SDK works