Clerk email with SuperSend TX
Clerk has no custom SMTP form for auth mail. To send verification codes, magic links, and similar templates through SuperSend TX:
- Turn off Delivered by Clerk on the templates you want to own
- Subscribe to the
email.createdwebhook - Deliver with
supersendtx-clerk(alsosupersendtx/clerk)
Prerequisites
- SuperSend TX account +
stx_…API key - Verified sending domain (or Sandbox for self-tests — see Quickstart)
- Clerk app with webhook signing secret
npm install supersendtx-clerk supersendtx @clerk/nextjsSUPERSENDTX_API_KEY=stx_your_key_here
SUPERSENDTX_FROM_EMAIL=noreply@yourdomain.comWebhook route
// app/api/webhooks/clerk/route.ts
import { verifyWebhook } from '@clerk/nextjs/webhooks'
import { createClerkEmailDeliverer } from 'supersendtx-clerk'
const deliver = createClerkEmailDeliverer({
from: process.env.SUPERSENDTX_FROM_EMAIL!,
// apiKey: process.env.SUPERSENDTX_API_KEY,
})
export async function POST(req: Request) {
const evt = await verifyWebhook(req)
if (evt.type === 'email.created') {
await deliver(evt.data)
}
return new Response('ok')
}When delivered_by_clerk is still true, the helper returns null and does not send (avoids double delivery). Turn delivery off in the Clerk dashboard for each template you want SuperSend TX to own.
Point the Clerk webhook endpoint at this route and subscribe to email.created.
Options
| Option | Default | Purpose |
|---|---|---|
from |
— (required) | Verified sender |
apiKey |
SUPERSENDTX_API_KEY |
API key |
baseUrl |
https://api.supersendtx.com |
API base URL |
skipIfDeliveredByClerk |
true |
Skip when Clerk still delivers |
force |
false |
Send even when delivered_by_clerk is true |
client |
— | Inject a SuperSendTX instance (tests) |
Sends are tagged auth=clerk-<slug> (or clerk-email) and use idempotency key clerk-email-<id> when Clerk provides an email id.
SMTP alternative
If you only need SMTP fields somewhere else in your stack, create a SuperSend TX SMTP credential (smtp.supersendtx.com). Clerk auth templates themselves still go through the webhook path above.