Skip to content
Playground

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 message
await client.messages.text({ to: '15551234567', body: 'Hello!' });
// Send a template message
await client.messages.template({
to: '15551234567',
name: 'hello_world',
language: { code: 'en_US' },
});

Prerequisites

Next Steps