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 adapter → paired Tempx inbox → inspect / assert
1. Create the credential
- Sign in to your Tempx account and open API keys.
- Name the connection (for example Resend development) and select the inbox that should receive captures.
- Enable the send permission and pick an expiry; add read/search/wait only if an agent will also inspect the inbox.
- 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
- Accepted fields:
to,cc,bcc,subject,text,html, plus base64 attachments (filename,content,content_type). - Up to 10 recipients per message; 30 captures per connection per 5 minutes; request cap 8 MiB.
- Truncation: subject 500 chars, text 64k, HTML 128k, attachments 2 MiB each (max 10).
- The captured From is your inbox address; the requested
fromand all recipients are preserved in the headers.
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