Auth provider email (password reset, magic links, verification)
Many auth stacks let you bring your own email for password reset, magic links, verification, and OTP messages. SuperSend TX is built for that traffic over the HTTP API, with SMTP relay when a provider only accepts custom SMTP.
For standalone send examples and copy patterns, see Password reset email best practices.
Pattern (all providers)
- Verify
yourdomain.com(or a sending subdomain likemail.yourdomain.com) in SuperSend TX - Create an
stx_...API key - In the auth provider’s email hook, custom mailer, or your app’s auth callback, send with SuperSend TX
- Keep
fromon your verified domain - Optionally subscribe to webhooks for delivery, bounce, and complaint events
import { SuperSendTX } from 'supersendtx'
const tx = new SuperSendTX(process.env.SUPERSENDTX_API_KEY)
export async function sendAuthEmail({
to,
subject,
html,
text,
}: {
to: string
subject: string
html: string
text?: string
}) {
return tx.emails.send({
from: '[email protected]',
to,
subject,
html,
text,
})
}Use this helper from password-reset, verification, and magic-link paths so every auth message shares one authenticated identity.
Supabase
Use the Send Email auth hook with an Edge Function that calls POST /emails, or configure Supabase custom SMTP with a SuperSend TX SMTP credential (host smtp.supersendtx.com, username supersendtx). Full hook setup: Supabase Auth email.
For local testing before your domain verifies, use the SuperSend TX sandbox sender limited to your account email (Quickstart).
Clerk
Clerk has no custom SMTP form for auth templates. Turn off Delivered by Clerk, listen for email.created, and deliver with supersendtx-clerk:
import { verifyWebhook } from '@clerk/nextjs/webhooks'
import { createClerkEmailDeliverer } from 'supersendtx-clerk'
const deliver = createClerkEmailDeliverer({
from: '[email protected]',
})
export async function POST(req: Request) {
const evt = await verifyWebhook(req)
if (evt.type === 'email.created') {
await deliver(evt.data)
}
return new Response('ok')
}Full walkthrough: Clerk email.
Auth.js (NextAuth)
Use the drop-in SuperSend TX email provider for magic links and verification flows:
import NextAuth from 'next-auth'
import SuperSendTX from 'supersendtx-authjs'
export const { handlers, auth, signIn, signOut } = NextAuth({
adapter: /* database adapter required */,
providers: [
SuperSendTX({ from: '[email protected]' }),
],
})Set AUTH_SUPERSENDTX_KEY or SUPERSENDTX_API_KEY. Full walkthrough: Auth.js / NextAuth email.
Better Auth
Better Auth uses sendVerificationEmail / sendResetPassword callbacks — wire those to POST /emails (or the npm SDK) with the same from domain as your other transactional mail. Full walkthrough: Better Auth email.
Checklist
- Domain verified in SuperSend TX (SPF / DKIM / return-path)
-
frommatches that domain (prefer a transactional subdomain) - Password reset, verification, and magic-link paths all use the same sender identity
- Secrets only in server env (
SUPERSENDTX_API_KEY) - HTML and plain-text bodies on auth sends
- Webhooks optional but recommended for delivery/bounce visibility
- Sandbox used only for self-tests before production cutover