Skip to main content
The SDK mirrors Meta’s official Cloud API surface so anything you build here works against Meta directly. When you point it at Kapso, you can opt into additional fields with fields=kapso(...), store history, and query conversations.

Installation

npm install @kapso/whatsapp-cloud-api
# or
yarn add @kapso/whatsapp-cloud-api

Quickstart

Direct Meta API (default)
import { WhatsAppClient } from '@kapso/whatsapp-cloud-api';

const client = new WhatsAppClient({ accessToken: process.env.META_ACCESS_TOKEN! });
await client.messages.sendText({ phoneNumberId: '647015955153740', to: '56961567267', body: 'Hello!' });
Via Kapso proxy
const client = new WhatsAppClient({ baseUrl: 'https://app.kapso.ai/api/meta/', kapsoApiKey: process.env.KAPSO_API_KEY! });
// Kapso adds storage/query APIs and optional kapso(...) fields in responses
When using accessToken without the Kapso base URL, Kapso storage and query features are not used.

Support matrix

FeatureWhatsApp token (direct Graph)Kapso base URL + API key
Send text
Send media (image, video, audio, document, sticker)
Send location
Send interactive (buttons, list, product, product list, flow)
Send template
Reactions
Mark read
Media: upload
Media: get/delete
Templates: list (by WABA)
Phone numbers: settings/profile
Calling: connect/pre‑accept/accept/reject/terminate
Calling: permissions.get
Conversations: list/get
Messages history: query/list by conversation
Contacts: list/get/update
Call logs: list
Storage of conversations/messages
Supabase sync

Next steps

Check out the guides to learn how to send different types of messages and use advanced features.
I