Skip to main content
The TypeScript SDK wraps Torpedo’s REST API for server-side JavaScript and TypeScript apps. It supports transactional email, email batches, SMS, and TypeScript-only email templates powered by React Email. Other languages should continue using the REST API examples until dedicated SDKs are available.

Install

Create a client

Send raw HTML email

Send a template email

Template support is specific to the TypeScript SDK. The SDK renders the template to html, generates plain text, and sends the existing Torpedo email API request. React Email support is optional. Install it only when you want to send React templates:
Provide text if you want full control over the plain-text part:

Send a batch

Batch sends can mix raw HTML and templates:
Supply an idempotency key when the batch must remain stable across application restarts:

Send SMS

The SDK automatically adds an idempotency key for each write request so SDK retries are safe. You can also pass idempotencyKey to email and SMS send inputs.

Read messages