Skip to content

SDKs

Every Duta SDK covers the whole API and behaves the same way:

  • Safe retries. Every send carries an idempotency key, made for you when you give none, so a retry can never send twice. Rate limits are retried after Retry-After. Server errors are retried only for requests that are safe to repeat.
  • Duta’s errors. Each error carries Duta’s error code and the request_id that finds the request on the Logs screen.
  • Paging. listAll on emails, logs and suppressions walks every page for you.
  • Webhook verification, for the signature on every webhook delivery.

Each one is tested against the same API spec and the same signed webhook delivery, so they cannot drift apart.

Terminal window
npm install @duta/sdk
import { Duta } from '@duta/sdk';
const duta = new Duta(process.env.DUTA_API_KEY);
const { data, error } = await duta.emails.send({
from: 'Kedai <resit@kedai.my>',
to: 'siti@example.com',
subject: 'Resit #1042',
html: '<p>Terima kasih.</p>',
});
if (error) console.error(error.code, error.message, error.requestId);

Node 20+, Bun, Deno and Cloudflare Workers, with no dependencies. Published with signed provenance. github.com/indra-sh/duta-js

Duta’s API follows Resend’s, so Resend’s official SDKs work with Duta too, once they have a Duta API key and Duta’s address. That makes moving over a configuration change: see Moving from Resend.

Set RESEND_BASE_URL=https://api.duta.indra.sh, or new Resend(key, { baseUrl: 'https://api.duta.indra.sh' }).