Resend integration

If your application sends through the Resend SDK, Tempx can capture those sends without you touching the calling code: point the SDK's base URL at the Tempx adapter and use a Tempx connection token as the API key. resend.emails.send() returns the same { data, error } shape it always did — but the message is stored in your Tempx inbox instead of being transmitted.

resend.emails.send()https://tempx.uk/resend adapterpaired Tempx inboxinspect / assert

1. Create the credential

  1. Sign in to your Tempx account and open API keys.
  2. Name the connection (for example Resend development) and select the inbox that should receive captures.
  3. Enable the send permission and pick an expiry; add read/search/wait only if an agent will also inspect the inbox.
  4. Create the key and copy the full tmcp_… token — it is shown once.

2. Point the SDK at Tempx

npm install resend

Local .env (keep it out of version control):

RESEND_BASE_URL=https://tempx.uk/resend
RESEND_API_KEY=tmcp_REPLACE_WITH_YOUR_FULL_TEMPX_TOKEN
if (!process.env.RESEND_API_KEY?.startsWith("tmcp_")) {
  throw new Error("Set RESEND_API_KEY to your Tempx connection token");
}
const { Resend } = await import("resend");
const resend = new Resend(process.env.RESEND_API_KEY);

const { data, error } = await resend.emails.send({
  from: "Demo App <app@example.com>",
  to: "customer@example.com",   // preserved on the capture, not delivered
  subject: "Welcome to the test",
  html: "<p>Your code is <b>123456</b>.</p>",
  text: "Your code is 123456.",
});
console.log("Captured:", data.id);

3. Check it with curl first

curl --request POST "https://tempx.uk/resend/emails" \
  --header "Authorization: Bearer tmcp_YOUR_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"from":"app@example.com","to":"customer@example.com",
           "subject":"Capture check","text":"Hello from curl"}'

Fields and limits

For per-error troubleshooting (401/403/404/422/429) and the capture behavior in detail, see the dedicated article Test Resend Emails with Tempx: Base URL and Credentials.

Capture your first Resend send

Create a send-enabled connection token and flip the base URL — your code stays, the risk goes.

Create a connection

Related