Email branding
Configure application-specific OTP emails and a verified sender domain.
Better Auth generates and verifies login codes. Resend delivers them. The backend resolves the email's application name from the registered appId; browser-provided appName changes the modal only.
Templates
Applications do not upload email HTML or configure provider template IDs. The backend uses the registered application name, not arbitrary browser HTML.
The existing src/server/email-template.ts uses a neutral white card, a prominent selectable code, a ten-minute expiry notice, an ignore-if-not-requested message, and a plaintext alternative. Better Auth supplies the code; the template does not generate or verify it.
Sending or resending in App B does not replace App A's code for the same email. SDK developers do not need to run a template export command or configure Resend.
Sender domain (operator setup)
- Add
auth.ckbkeyway.devto Resend and enable sending. Receiving email is not required. - Review and approve the exact generated DKIM and SPF/return-path records (TXT, MX, or CNAME). Do not invent values or replace website/docs DNS. CNAME records must not be proxied.
- Wait for Resend to verify the domain.
- Create a sending-only key restricted to this domain; configure server-only
RESEND_API_KEY. - Set
KEYWAY_AUTH_EMAIL_FROMtoCKB KeyWay <login@auth.ckbkeyway.dev>and disable open/click tracking. - Optionally add an approved DMARC TXT record at
_dmarc.auth.ckbkeyway.dev, initiallyv=DMARC1; p=none;. This is recommended but does not block Resend setup. Add reporting only with a working reporting address. - Test a disposable account; inspect received-message SPF, DKIM, DMARC and desktop/mobile rendering.
No subscription or DNS modification is automatic. Provider acceptance does not guarantee inbox delivery. Provider errors fail the request rather than reporting a false delivery success. See Resend domain setup.