# Resend Emulator (service host) Create an instance: curl -s -X POST https://resend.emulators.dev/_emulate/instances # Hosted deployments create instances lazily when the returned URL is first used. The instance URL is a capability: anyone who has it can read and modify the instance, so save the returned URLs. Never store real secrets in an emulator. # The server generates an unguessable name. An optional {"instance":""} body adds a readable prefix. Then use the returned providerBaseUrl / controlBaseUrl. Example below uses a sample instance. # Resend Emulator Stateful Resend emulator for email sending, domains, contacts, audiences, API keys, and an inbox UI. Provider base URL: https://resend.your-instance.emulators.dev Control base URL: https://resend.your-instance.emulators.dev/_emulate Supported surfaces: - REST API: partial at / - Inbox UI: supported at /_inbox - Webhooks: partial Control endpoints: - https://resend.your-instance.emulators.dev/_emulate/manifest - https://resend.your-instance.emulators.dev/_emulate/coverage - https://resend.your-instance.emulators.dev/_emulate/connections - https://resend.your-instance.emulators.dev/_emulate/state - https://resend.your-instance.emulators.dev/_emulate/ledger - https://resend.your-instance.emulators.dev/_emulate/faults - POST https://resend.your-instance.emulators.dev/_emulate/credentials - POST https://resend.your-instance.emulators.dev/_emulate/seed - POST https://resend.your-instance.emulators.dev/_emulate/reset Fault injection: Arm a one-shot provider failure with a glob pathPattern, then inspect /ledger for faulted: true. curl -s -X POST https://resend.your-instance.emulators.dev/_emulate/faults \ -H "content-type: application/json" \ -d '{"match":{"method":"GET","pathPattern":"/v1/*"},"response":{"status":503,"body":{"error":"temporary"}}}' Connect: ## Resend SDK (TypeScript) import { Resend } from "resend"; // The Resend SDK honors RESEND_BASE_URL for the API host. process.env.RESEND_BASE_URL = "https://resend.your-instance.emulators.dev"; const resend = new Resend(""); await resend.emails.send({ from: "onboarding@example.com", to: "test@example.com", subject: "Hello from the emulator", html: "

It works.

", }); ## Resend env RESEND_BASE_URL=https://resend.your-instance.emulators.dev RESEND_API_KEY= ## curl curl -s -X POST https://resend.your-instance.emulators.dev/emails \ -H "authorization: Bearer " \ -H "content-type: application/json" \ -d '{"from":"onboarding@example.com","to":"test@example.com","subject":"Hello","html":"

Hi

"}' ## Base URL (env) RESEND_BASE_URL=https://resend.your-instance.emulators.dev ## Create a credential curl -s -X POST https://resend.your-instance.emulators.dev/_emulate/credentials \ -H "content-type: application/json" \ -d '{"type":"api-key"}' ## Inspect requests curl -s https://resend.your-instance.emulators.dev/_emulate/ledger