Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.zavu.dev/llms.txt

Use this file to discover all available pages before exploring further.

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

TypeScript

TypeScript/JavaScript SDK for Node.js

Python

Python SDK with sync and async support

Ruby

Ruby SDK for Rails, Sinatra, and more

Go

Go SDK with strong typing

PHP

PHP SDK for Laravel, Symfony, and more

CLI

Command-line interface for Zavu

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 and deploy Zavu Functions from your terminal:
# Install
brew install zavudev/tools/zavu

# Authenticate (opens browser, picks a project)
zavu login

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

# List messages
zavu messages list --limit 10

# Get help
zavu --help
Full reference: CLI reference.