Skip to main content
Server-side only — Zavu SDKs are designed for server-side environments (Node.js, Python, Ruby, Go, PHP). Never use them in browser/frontend code as this exposes your API key. See Frontend Integration for the proxy pattern.
Use our official SDKs to integrate Zavu into your application with minimal code.

Available SDKs

Quick Comparison

FeatureTypeScriptPythonRubyGoPHP
Package@zavudev/sdkzavudevzavudevgithub.com/zavudev/sdk-gozavudev/sdk
Min VersionNode 18+Python 3.9+Ruby 3.0+Go 1.21+PHP 8.1+
AsyncNative Promisesasyncio supportThreadsGoroutines
TypesFull TypeScriptType hintsStrong typing

Installation

npm add @zavudev/sdk
# or
bun add @zavudev/sdk

Basic Usage

import Zavudev from '@zavudev/sdk';

const zavu = new Zavudev({
  apiKey: process.env['ZAVUDEV_API_KEY'], // This is the default and can be omitted
});

const result = await zavu.messages.send({
  to: "+14155551234",
  text: "Hello from Zavu!",
});

console.log("Message ID:", result.message.id);

Common Operations

Send a Message

const result = await zavu.messages.send({
  to: "+14155551234",
  text: "Your code is 123456",
  channel: "sms",
});

Send with Template

const result = await zavu.messages.send({
  to: "+14155551234",
  messageType: "template",
  content: {
    templateId: "tpl_abc123",
    templateVariables: {
      "1": "John",
      "2": "12345",
    },
  },
});

Get Message Status

const result = await zavu.messages.get("msg_abc123");
console.log("Status:", result.message.status);

List Messages

const result = await zavu.messages.list({
  status: "delivered",
  limit: 50,
});

for (const message of result.items) {
  console.log(message.id);
}

Error Handling

import Zavudev, { APIError } from '@zavudev/sdk';

const zavu = new Zavudev({
  apiKey: process.env["ZAVUDEV_API_KEY"],
});

try {
  await zavu.messages.send({ to: "invalid", text: "Hello" });
} catch (error) {
  if (error instanceof APIError) {
    console.error("API Error:", error.status, error.message);
  }
}

CLI

The Zavu CLI lets you interact with the API from your terminal:
# Install
go install github.com/stainless-sdks/zavudev-cli/cmd/zavudev@latest

# Set API key
export ZAVUDEV_API_KEY=zv_live_xxx

# Send a message
zavudev messages send --to "+14155551234" --text "Hello from CLI!"

# List messages
zavudev messages list --limit 10

# Get help
zavudev --help