@send0/sdk
Official TypeScript SDK for the send0 messaging API.
Installation
npm install @send0/sdk
Quick Start
import { Send0 } from "@send0/sdk";
const send0 = new Send0("sk_live_...");
await send0.emails.send({
from: "hello@yourdomain.com",
to: "user@example.com",
subject: "Welcome",
html: "<p>Hello!</p>",
});
Email Templates (JSX)
Build type-safe email templates with the built-in component system:
import { Template, Text, Button } from "@send0/sdk/components";
export default function Welcome({ name }: { name: string }) {
return (
<Template preview={`Welcome, ${name}!`}>
<Text heading>Hey {name}</Text>
<Text>Thanks for signing up!</Text>
<Button href="https://example.com" primary>
Get Started
</Button>
</Template>
);
}
CLI
npx @send0/sdk init
npx @send0/sdk dev
npx @send0/sdk preview
npx @send0/sdk push
npx @send0/sdk validate
Webhook Verification
import { Send0 } from "@send0/sdk";
const event = Send0.webhooks.verify(rawBody, headers, webhookSecret);
Resources
License
MIT