Skip to main content

Installation

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

Quickstart

Via Kapso proxy (recommended)
import { WhatsAppClient } from '@kapso/whatsapp-cloud-api';

const client = new WhatsAppClient({
  baseUrl: 'https://app.kapso.ai/api/meta/',
  kapsoApiKey: process.env.KAPSO_API_KEY!
});

await client.messages.sendText({
  phoneNumberId: '647015955153740',
  to: '56961567267',
  body: 'Hola desde Kapso!'
});
Direct Meta API
const client = new WhatsAppClient({
  accessToken: process.env.META_ACCESS_TOKEN
});
When using accessToken without the Kapso base URL, messages and conversations won’t be stored in Kapso’s database.

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