Skip to main content
The official Keebai SDK for Node.js, TypeScript, and modern runtimes. Saves you from writing your own HTTP layer against Meta Graph API or api.keebai.com/v1.
Pending migration. The published SDK still targets the per-type routes (/v1/messages/text, /v1/messages/image, …) that were replaced by the single POST /v1/messages. Its keebai mode will fail against the current API until a new version ships; meta mode, which talks straight to Meta Cloud API, is unaffected. Call the REST endpoint directly in the meantime.
That’s it.

Why use it

One client, two modes

Pass apiKey and it talks to Keebai with persistence, dashboards, broadcasts, and normalized webhooks. Pass accessToken and it goes straight to Meta Graph API. Same method surface in both modes.

Full WhatsApp coverage

Text, media (image, video, audio, document, sticker), location, contact cards, reactions, mark-read, interactive (buttons, list, CTA URL, catalog), templates, and broadcasts.

Strict TypeScript

Fully typed: inputs, responses, errors. Autocomplete in VS Code, Cursor, or any LSP-aware IDE. Dual ESM + CJS build with .d.ts.

Retries and timeouts

Automatic exponential backoff on 429, 5xx, and network errors. Configurable timeout. Normalizes Keebai and Meta errors into the same class.

Installation

Requires Node.js 20+ (uses global fetch, FormData, and Blob). Also works on edge runtimes (Vercel Edge, Cloudflare Workers, Deno, Bun) and modern browsers.

Configuration

Set credentials via environment variables:
Instantiate the client:

The two modes

The client infers the mode from the credential. Same method names, same return types, same error model — only the transport changes.
Trade-off details in Direct Meta mode.

API surface

client.messages.*

client.media.*

client.templates.* (Keebai mode)

Examples

Send an image with a caption

Template with named variables

Interactive buttons

Upload media once, send N times

Mark as read + typing

Mass broadcast

Error handling

Common codes: 429s, 5xx, and network errors retry automatically with exponential backoff. Configurable:

Direct Meta mode

When you’d rather go straight to Meta without the platform:

Helpers

Resources

GitHub repo

Source code, issues, and PRs. MIT.

npm: @keebai/sdk

Latest version, changelog, install stats.

Agent Skills

The integrate-keebai-whatsapp skill for AI agents, built on this SDK.

REST API

If you’d rather call the API directly without the SDK.