# TypeScript SDK for Amazon SES

Source: https://wraps.dev/sdk

![Wraps Logo](https://wraps.dev/wraps-light-logo.png)![Wraps Logo](https://wraps.dev/wraps-dark-logo.png)

](https://wraps.dev/)

[](https://github.com/wraps-team/wraps)[Log in](https://app.wraps.dev/auth?mode=signin)[Sign up](https://app.wraps.dev/auth?mode=signup)

Toggle menu

wraps · typescript sdk

# Communication as code.

TypeScript SDKs that send through your AWS account. Define templates in React, automate with workflows, trigger from custom events.

@wraps.dev/email · @wraps.dev/sms · @wraps.dev/client

[Get Started](https://wraps.dev/docs/quickstart/email)[SDK Reference](https://wraps.dev/docs/sdk-reference)

app/send.ts

```
import { WrapsEmail } from '@wraps.dev/email';

const email = new WrapsEmail();

await email.send({
  from: 'hello@yourdomain.com',
  to: 'user@example.com',
  subject: 'Welcome to our app!',
  html: '<h1>Welcome!</h1>',
});
```

`@wraps.dev/email`

Send email through SES

`@wraps.dev/sms`

Send SMS through AWS

`@wraps.dev/client`

Platform API, workflows, events

Define

## Templates as Code

Write email templates as React components. Type-safe variables, version-controlled, reviewed in PRs. Push to SES with one command.

React Email components — renders correctly in Gmail, Outlook, Apple Mail

Typed variables — catch missing data at compile time, not in production

`wraps email templates push` — compiles, validates, and deploys to SES (shortcut: `wraps push`)

Brand kits — shared colors, fonts, and logo across all templates

[Template guide](https://wraps.dev/docs/guides/templates)

wraps/templates/welcome.tsx

```
import { Body, Container, Heading, Text, Button } from "@react-email/components";export const subject = "Welcome to {{companyName}}";export const emailType = "transactional" as const;type Props = {  name: string;  companyName: string;  loginUrl: string;};export default function WelcomeEmail({ name, companyName, loginUrl }: Props) {  return (    <Body>      <Container>        <Heading>Welcome, {name}</Heading>        <Text>Thanks for joining {companyName}.</Text>        <Button href={loginUrl}>Get Started</Button>      </Container>    </Body>  );}
```

Automate

## Automations as Code

wraps/workflows/onboarding.ts

```
import {  condition,  defineWorkflow,  delay,  sendEmail,  waitForEvent,} from "@wraps.dev/client";export default defineWorkflow({  name: "Onboarding Drip",  trigger: { type: "event", eventName: "user.signed_up" },  steps: [    sendEmail("welcome", { template: "welcome-email" }),    delay("wait-1d", { days: 1 }),    waitForEvent("wait-setup", {      eventName: "account.setup_completed",      timeout: { days: 2 },    }),    condition("check-setup", {      field: "contact.hasCompletedSetup",      operator: "is_true",      branches: {        yes: [sendEmail("tips", { template: "power-user-tips" })],        no: [sendEmail("nudge", { template: "complete-setup" })],      },    }),  ],});
```

Define workflows in TypeScript. Triggers, conditions, delays, branching — all type-checked. Deploy with `wraps email workflows push`.

Event triggers — start workflows from signups, purchases, or any custom event

Wait for events — pause until a specific action happens, with configurable timeouts

Conditional branching — route contacts based on properties, behavior, or event data

Multi-channel — send email and SMS in the same workflow

[Workflow guide](https://wraps.dev/docs/guides/workflows)

Trigger

## Custom Events

Emit events from anywhere in your app. `wraps.track()` fires the event — workflows listening for that event name execute automatically.

Any event name — `user.signed_up`, `order.completed`, `trial.expiring`

Typed properties — attach any JSON payload, available in templates and conditions

Batch support — send multiple events in a single API call

Automatic contact resolution — match events to contacts by email or ID

How it works: Call `wraps.track("order.completed")` from your checkout flow. Any workflow with `trigger: { eventName: "order.completed" }` runs automatically.

[Events reference](https://wraps.dev/docs/guides/custom-events)

app/checkout.ts

```
import { createPlatformClient } from "@wraps.dev/client";const wraps = createPlatformClient({ apiKey: process.env.WRAPS_API_KEY });// Emit an event — triggers any workflow listening for "order.completed"await wraps.track("order.completed", {  contactEmail: "alice@example.com",  properties: {    orderId: "ord_8f3k2",    amount: 149,    plan: "pro",  },});
```

Production

## Built for production

Ship emails and SMS with the same rigor as your application code

### Your AWS, Your Data

The SDK calls SES directly in your AWS account. Sends go straight from your app to your infrastructure.

### TypeScript-First

Strict types, autocomplete, and compile-time validation. Ship with confidence.

### Flexible Auth

AWS credential chain, OIDC federation (Vercel, GitHub Actions), or explicit credentials.

### React Email

Build templates with React components. Built on React Email for consistent rendering across major clients — Gmail, Outlook, Apple Mail.

### Batch Operations

Send to 100 recipients, track multiple events, or manage contacts in bulk with single calls.

### Zero Lock-In

Thin wrappers around AWS services. Eject anytime — your SES templates and infrastructure stay.

npm install @wraps.dev/email

## Define. Automate. Trigger.

Templates as React components. Workflows as TypeScript. Events from your codebase. All running on your AWS.

[Get Started](https://wraps.dev/docs/quickstart/email)[SDK Reference](https://wraps.dev/docs/sdk-reference)
