Skip to content
meta-cloud-api logo

meta-cloud-api

Type-safe, comprehensive, and modular WhatsApp Business Platform integration

Features

Type-Safe

Full TypeScript support with strict mode and comprehensive type definitions for all API endpoints.

Modular Architecture

17 API modules including messages, media, templates, flows, webhooks, and more.

Framework Support

Built-in webhook adapters for Express.js and Next.js (App Router & Pages Router).

Production Ready

Battle-tested with comprehensive error handling, retry logic, and logging utilities.

Quick Start

Install the package via npm, yarn, or pnpm:

Terminal window
pnpm add meta-cloud-api

Initialize the SDK:

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 your first message:

await client.messages.text({
to: '15551234567',
body: 'Hello from meta-cloud-api!',
});

What’s Included

  • 17 API Modules: Messages, Media, Templates, Flows, Phone, Profile, Registration, Two-Step Verification, Encryption, QR Codes, WABA, Block Users, Calling, Groups, Marketing Messages, Commerce, Payments
  • Webhook System: Framework-agnostic webhook processor with Express.js and Next.js adapters
  • Type Definitions: Comprehensive TypeScript types for all request/response payloads
  • Utilities: Encryption helpers, loggers, HTTP client, and more
  • Examples: Production-ready examples for Express.js and Next.js