NEW
Pro

TypeScript SDK
Email API Made Simple

Create inboxes, fetch messages, and subscribe to real-time updates from a fully typed TypeScript client.

Pro & Business

TypeScript SDK

The fastest way to integrate disposable email into your app

Quick Start

Create inboxes, read messages, and manage teams - all with a single import.

TypeScript
import { DestroyNetwork } from "@buun_group/destroy-network-sdk";

const dn = new DestroyNetwork();

// Create a temporary inbox
const inbox = await dn.inboxes.create({
  customName: "signup-test",
});

console.log(inbox.address);

// Check for new messages
const messages = await dn.inboxes.listMessages(inbox.id);
console.log(messages[0].subject);

Type-Safe Methods

Every method returns typed responses. Autocomplete guides you through every API call.

const result = await dn.inboxes.create()
Promise<Inbox>28ms

12 Resources

One consistent interface for the entire API. Every resource follows the same patterns.

inboxes
teams
webhooks
billing
labels
inboxRules
inboxTemplates
domains
apiKeys
user
auth
digest

Get Started

Install the SDK and start building. Available on Pro and Business plans.

$npm i @buun_group/destroy-network-sdk
View SDK Documentation

See It
in Action

Create a disposable identity, automate signup, extract the verification code, and save to vault, all from the terminal

Automated testing, CI pipelines, SaaS onboarding flows, and chatbot integrations all share a common need: programmatic access to disposable email. The destroy.network TypeScript SDK gives you a clean, fully typed API client that handles authentication, retries, and real-time subscriptions out of the box.

Install with a single command, initialize with your API key, and start creating inboxes in three lines of code. Every method returns strongly typed responses so your editor catches mistakes before they reach production. The SDK covers the full API surface: inbox CRUD, message retrieval, attachment downloads, webhook management, and more.

For workflows that need instant email delivery, the SDK includes a built-in real-time subscription system. Open an SSE connection and receive messages the moment they hit the inbox. No polling loops, no wasted API calls.

client.messages.subscribe(inboxId, msg => console.log(msg))

The package is tree-shakeable and ships with zero dependencies beyond the standard Fetch API, keeping your bundle lean. It works in Node.js, Deno, Bun, Cloudflare Workers, and any runtime that supports the Web Fetch standard.

Fully Type-Safe

Every request and response is strongly typed with TypeScript interfaces. Catch errors at compile time, not runtime.

Real-Time Subscriptions

Subscribe to inbox events via SSE and receive messages the instant they arrive. No polling required.

Easy Installation

Install from npm with a single command. Zero external dependencies, works in any modern JS runtime.

Full API Coverage

Inbox creation, message retrieval, attachment downloads, webhooks, and team management in one SDK.

SDK Features

  • Complete TypeScript type definitions for all API endpoints, request bodies, and response shapes
  • Automatic retry with exponential backoff for transient network failures and rate limit responses
  • Built-in SSE-based real-time subscriptions for instant message delivery without polling
  • Tree-shakeable ESM package with zero dependencies. Works in Node.js, Deno, Bun, and Cloudflare Workers

Frequently Asked Questions

How do I install the SDK?
Run `npm install @destroy-network/sdk` (or use pnpm, yarn, or bun). Then import the client, pass your API key, and start making calls. Full setup instructions are in the documentation.
What languages and runtimes are supported?
The SDK is written in TypeScript and works in any JavaScript runtime that supports the Fetch API, including Node.js 18+, Deno, Bun, and Cloudflare Workers. A REST API is also available for other languages.
Are there rate limits?
Yes. Rate limits depend on your plan tier. Pro plans include generous limits for automated workflows, and Business plans offer higher thresholds. The SDK handles 429 responses automatically with exponential backoff.
Does the SDK support real-time message delivery?
Yes. The SDK includes a `messages.subscribe()` method that opens a Server-Sent Events connection to receive messages in real-time. This is ideal for automated testing and CI pipelines that need instant email verification.
Can the SDK generate fictional personas for form filling?
Yes. Pass `persona: true` when creating an agent identity via `client.agent.create()` to generate a fictional persona with name, address, phone, date of birth, and username. You can also specify `country` (17 supported countries) and `gender`. Personas are for testing and automation only. Requires Pro or Business plan.

Start Building Today

Install the SDK, grab an API key, and create your first inbox in minutes.