Migrate from Resend to Duta
If you send transactional email with Resend, moving to Duta is quick. You get the same kind of API, with MYR pricing and local billing. There are two ways to migrate: keep your Resend code and point it at Duta, or switch to the Duta SDK.
Before you start
Section titled “Before you start”- Sign up at app.duta.indra.sh.
- Verify your sending domain (same DNS idea as Resend). See Verify a domain.
- Create a Duta API key (
duta_live_...).
Fastest path: point Resend at Duta (no code rewrite)
Section titled “Fastest path: point Resend at Duta (no code rewrite)”Duta exposes a Resend-compatible endpoint at POST https://api.duta.indra.sh/emails. The official Resend SDK lets you override the base URL, so you can keep all of your existing resend.emails.send(...) calls and just change two things: the base URL and the API key.
import { Resend } from "resend";
// Before// const resend = new Resend("re_xxx");
// After: same SDK, pointed at Dutaconst resend = new Resend("duta_live_xxx", { baseUrl: "https://api.duta.indra.sh",});
// Your existing code keeps working unchangedawait resend.emails.send({ from: "hello@yourdomain.com", to: "user@example.com", reply_to: "support@yourdomain.com", subject: "Hello", html: "<p>Hi</p>",});Or set it with an environment variable, with no code change at all:
RESEND_BASE_URL=https://api.duta.indra.shRESEND_API_KEY=duta_live_xxxNot using the Resend SDK? The endpoint is plain HTTP, so any language works. Just change the host:
curl -X POST https://api.duta.indra.sh/emails \ -H "Authorization: Bearer duta_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "from": "hello@yourdomain.com", "to": "user@example.com", "reply_to": "support@yourdomain.com", "subject": "Hello", "html": "<p>Hi</p>" }'Duta accepts the Resend payload (including reply_to and tags), returns { "id": "..." } on success, and uses the same Authorization: Bearer header. Only the key format differs (duta_live_ instead of re_).
Alternative: switch to the Duta SDK
Section titled “Alternative: switch to the Duta SDK”If you would rather fully adopt Duta, install @duta/sdk. It is a typed client with normalised error handling. The send call is almost identical; the main rename is reply_to to replyTo:
import { Duta } from "@duta/sdk";
const duta = new Duta("duta_live_xxx");
await duta.emails.send({ from: "hello@yourdomain.com", to: "user@example.com", replyTo: "support@yourdomain.com", subject: "Hello", html: "<p>Hi</p>",});Steps:
- Install the SDK:
npm install @duta/sdk(or the Python, PHP, .NET equivalents). - Swap the import and client for Duta’s.
- Move your API key into
DUTA_API_KEY. - Rename
reply_totoreplyTo(and any other snake_case fields). - Send one test email to confirm.
Not yet supported
Section titled “Not yet supported”Whichever path you choose, these Resend features are on the roadmap and not available yet. The /emails endpoint returns a clear error if you send them, so nothing is ever silently dropped:
ccandbcc- Attachments
- Scheduled sending
- Batch send
Check that your sends do not rely on these before switching production traffic.
Rolling back
Section titled “Rolling back”Nothing is destructive. To switch back, revert the base URL and key to Resend’s. Your Resend account and setup are untouched.