@kapso/chat-adapter when a Chat SDK agent needs to receive Kapso WhatsApp webhooks, reply in threads, send buttons or media, and read Kapso conversation history.
Use @kapso/whatsapp-cloud-api directly when you need raw templates, flows, catalogs, or lower-level WhatsApp API calls.
Installation
@chat-adapter/state-memory is good for local development. For production, use durable Chat SDK state.
Quickstart
Environment
You can also pass config directly:
Webhook route
Kapso sends platform webhooks asPOST requests. Forward the raw Request to Chat SDK.
Add
whatsapp.message.sent only if your app needs sent-message echoes.
Send replies
Reply inside a direct message handler:Buttons
Chat SDK cards with buttons become WhatsApp reply buttons.Media
Send files through Chat SDK:url. When a WhatsApp media ID is available, the attachment has lazy fetchData().
History
WithKAPSO_API_KEY, history reads from Kapso:
fetchThread() enriches metadata with Kapso contact and conversation records when available.
Source
GitHub repository
Source code, examples, and issue tracker for
@kapso/chat-adapter.
