Skip to main content

Prerequisites

Before you start, you need:

Guide

1

Install

Get the Sendbaze SDK. It is a zero-dependency client built on fetch and runs on Node.js 20+, Bun, Deno, Cloudflare Workers and Vercel Edge.
2

Set your API key

Store the key in an environment variable in your .env file.
.env
3

Send an email

send.ts
The call returns as soon as the email is queued. Delivery happens in the background and is reported by webhook and in the dashboard Logs.
4

Try it

Run the file and check the Logs page. With a live key the email arrives within seconds; with a test key it appears in the logs with a test badge and is never delivered.

Examples

Handle errors

Every non-2xx response throws a SendbazeError with a stable code that matches the errors reference. Network failures throw SendbazeConnectionError, which is safe to retry with the same idempotency key.

Send with a template

Attach a file

Send a React component

Prefer components to HTML strings? Install @react-email/render react react-dom, then pass react instead of html. The SDK renders the HTML and a plain-text part before sending. See React Email.

Look up a message

SDK reference

Every resource the SDK covers: emails, templates, domains, suppressions, webhooks, SMS and usage.