API & Integrations
TypeScript SDK
Use the Taildove TypeScript SDK to manage contacts, campaigns, and sequences with typed methods.
TypeScript SDK
The Taildove TypeScript SDK gives you a small, fetch-based client for working with the Taildove API from Astro, Node.js, Bun, Deno, or the browser.
It currently includes typed resource clients for:
- Contacts
- Campaigns
- Sequences
Import the client
If you are working inside this repo, import the SDK directly from src/lib/taildove-sdk.ts:
import { createTaildoveClient } from "../lib/taildove-sdk";
Create a client
import { createTaildoveClient } from "../lib/taildove-sdk";
const taildove = createTaildoveClient({
apiKey: process.env.TAILDOVE_API_KEY!,
});
The client automatically:
- Sends your API key as a Bearer token
- Uses
https://app.taildove.com/api/v1by default - Throws a
TaildoveApiErrorwhen the API returns a non-2xx response
Quick example
const contacts = await taildove.contacts.list({ per_page: 10 });
const campaign = await taildove.campaigns.create({
name: "April product update",
title: "What shipped this month",
content: "<p>Hello from Taildove</p>",
});
const sequence = await taildove.sequences.create({
name: "Welcome sequence",
trigger_type: "manual",
steps: [
{
subject: "Welcome aboard",
content: "<p>Thanks for joining.</p>",
delay_hours: 0,
delay_unit: "hours",
},
],
});
Resource methods
Contacts
await taildove.contacts.list({ q: "jane@", subscribed: true });
await taildove.contacts.get("contact_id");
await taildove.contacts.create({
email: "jane@example.com",
first_name: "Jane",
groups: ["Newsletter"],
});
await taildove.contacts.update("contact_id", { tags: ["vip"] });
await taildove.contacts.delete("contact_id");
Campaigns
await taildove.campaigns.list({ status: "draft" });
await taildove.campaigns.get("campaign_id");
await taildove.campaigns.create({
name: "Launch email",
title: "We just shipped something new",
content: "<p>Big update</p>",
group_ids: ["group_id"],
});
await taildove.campaigns.update("campaign_id", {
preview_text: "Short summary",
});
await taildove.campaigns.delete("campaign_id");
Sequences
await taildove.sequences.list({ status: "active" });
await taildove.sequences.get("sequence_id");
await taildove.sequences.create({
name: "Trial onboarding",
trigger_type: "manual",
steps: [
{
subject: "Start here",
content: "<p>Welcome</p>",
delay_hours: 0,
delay_unit: "hours",
},
],
});
await taildove.sequences.update("sequence_id", {
status: "paused",
});
await taildove.sequences.delete("sequence_id");
Authentication
Use an API key from Settings → API Keys in your Taildove account.
For the authentication flow and examples, see SDK Authentication and API Keys.