Buddy

Write one line, not a request handler.

Hand-rolling HTTP calls, retries and signature checks is busywork. The official Buddy SDKs give you typed methods for subscribers, messages, events and webhooks, with the details handled for you.

import { Buddy } from "@usebuddy/sdk";
 
const buddy = new Buddy({
apiKey: process.env.BUDDY_KEY
});
 
await buddy.subscribers.create({
phone: "+44 7700 900123",
tags: ["trial"],
});
 
await buddy.messages.send({
to: "+44 7700 900123",
template: "welcome",
});
# Install the beta SDK
$ npm install @usebuddy/sdk@beta
# Keep your API key on the server
Typed
Autocomplete everywhere
Retries
Built in
Webhook verify
One call
Technology fromMeta
Built on the official WhatsApp Business Platform
Inside SDKs
JavaScript and TypeScriptPythonTyped modelsRetriesIdempotencyWebhook helpersPaginationTest mode

Every team writes the same API wrapper, and each one has bugs.

Auth headers, retries, pagination and signature checks get rewritten in every codebase. The SDKs do it once, properly, and keep up with the API.

Today

Plumbing in every project.

  • Raw HTTP calls scattered through your code.
  • Retries that sometimes send twice.
  • Signature checks copied from a blog post.
  • Guessing at response shapes.
  • Updating everything when the API grows.
With SDKs

One import, and you're building.

  • Clear methods like subscribers.create and messages.send.
  • Safe retries with idempotency keys added for you.
  • webhooks.verify in one line.
  • Types for every request and response.
  • New API features arrive in an update.

Install, configure, call.

The beta SDKs are available on npm and PyPI. Use a test key while you build, or start with the REST quickstart.

1

Install

Select the npm beta channel or allow Python prereleases. The import names are @usebuddy/sdk and buddy.

$ npm install @usebuddy/sdk@beta
$ pip install --pre usebuddy
2

Configure

Create a client with your key. Use a test key while you build.

import os
from buddy import Buddy
buddy = Buddy(api_key=os.environ["BUDDY_KEY"])
3

Call

Use typed methods for subscribers, messages, events, campaigns and webhooks.

buddy.ingest_events(body={
"name": "order_paid",
"phone": "+14155550142",
"properties": {"total": 84}})

Everything inside the SDKs.

The parts of an API client you'd otherwise write and maintain yourself.

JavaScript, TypeScript and Python, kept in step with the API.

Every endpoint, every field and every error has a method or a type. When the API gains something new, the SDK gets it in the next release.

"

Retries add an idempotency key automatically, so a network blip never sends a customer two messages.

Typed models

Subscribers, messages, events and results as real types, with autocomplete.

Safe retries

Automatic retries on network errors and rate limits, without double sends.

Webhook helpers

Verify signatures and parse events into typed objects in one call.

Pagination

Iterate over every subscriber or message without managing cursors.

Helpful errors

Errors as typed exceptions, like SubscriberOptedOut, so you can handle them properly.

Test mode

Point the client at a test key and nothing reaches a phone.

OAuth connections

Pass a scoped OAuth access token to call the API for a connected workspace.

Framework friendly

Works in Node, serverless functions, Django, FastAPI and Flask.

Open source

Read the code, file issues and follow releases on GitHub.

What the SDKs save you.

Your first message in minutes.

Install, create a client, call messages.send. The SDK handles auth, serialisation and errors, so the first working version is the short one.

npm and pipTyped methodsTest keys
await buddy.messages.send({
to: "+1 415 555 0142",
template: "order_shipped",
variables: ["Noah"],
});
A product team working around a table with laptops
from buddy import verify_webhook
 
event = verify_webhook(
body, headers["Buddy-Signature"],
secret)
if event["type"] == "message.replied":
open_ticket(event)

Webhooks verified in one line.

Signature checks are easy to get subtly wrong. webhooks.verify handles the timestamp, the secret and the comparison for you.

Errors you can actually handle.

Instead of parsing status codes, catch SubscriberOptedOut or TemplateNotApproved and do the right thing.

try {
await buddy.messages.send(msg);
} catch (e) {
if (e instanceof SubscriberOptedOut) skip();
}

Where teams use the SDKs.

Next.js apps

Send from API routes and server actions.

JavaScript

Serverless

Track events from functions on any cloud.

JavaScript and Python

Django and FastAPI

Add subscribers when users sign up.

Python

Job queues

Send reminders from scheduled workers.

Backends

Data scripts

Import subscribers and events in bulk.

Data teams

Three things people ask about SDKs.

Do I have to use an SDK?

No. The REST API works from any language. The SDKs just save you the plumbing.

Which languages are supported?

JavaScript and TypeScript for Node.js, and Python. Other languages can use the REST API directly.

Will updates break my code?

The SDKs follow semantic versioning, and breaking changes only arrive in major versions with clear upgrade notes.

Questions about SDKs.

Anything else, ask Sarah.She reads every message and writes back herself.
Ask a question
How do I install the SDK?

Run npm install @usebuddy/sdk@beta for JavaScript and TypeScript, or pip install --pre usebuddy for Python. The REST quickstart works without installing an SDK.

Does the SDK retry failed requests?

Yes, on network errors and rate limits, with an idempotency key so nothing sends twice.

Can I use the SDK with OAuth tokens?

Yes. Create a client with an OAuth access token instead of an API key, and it calls the API for that workspace.

Is the source code available?

Yes, on GitHub, where you can follow releases and open issues.

How do I get access?

Join the waitlist and tell us what you're building. We'll set up your workspace with test and live keys and help with your first integration.

Spend your time on the product, not the plumbing.

Join the waitlist and install the SDK the day you get keys.

Two people reviewing work together at a laptop
Installed
@usebuddy/sdk
Sent
messages.send
Verified
webhooks.verify
Shipped
Same day