RefactKit sends transactional emails — team invitations, password resets, and email verification links — through Resend, a developer-first email platform. Better Auth handles the trigger points automatically: whenever an invitation is created or a user requests a password reset, it calls theDocumentation Index
Fetch the complete documentation index at: https://docs.refactkit.com/llms.txt
Use this file to discover all available pages before exploring further.
sendEmail utility without any extra wiring on your part. Your job is to configure Resend and set the right environment variables.
How email sending works
RefactKit uses the Resend REST API to send emails. ThesendEmail utility reads your API key from the RESEND_API_KEY environment variable and the sender address from EMAIL_FROM, then calls the Resend /emails endpoint:
Emails sent automatically
| Trigger | Email type |
|---|---|
| User invites a team member | Organization invitation |
| User requests a password reset | Password reset link |
| New user registers | Email verification link |
sendEmail directly for these flows — Better Auth handles all three.
Configure Resend
Create a Resend account
Go to resend.com and sign up for a free account.
Verify your sending domain
In the Resend dashboard, navigate to Domains and add your domain. Resend will give you DNS records (TXT and MX) to add through your DNS provider. Wait for verification to complete — this typically takes a few minutes to a few hours depending on your DNS TTL.
During development you can send from Resend’s shared
onboarding@resend.dev address without domain verification. This is not suitable for production because emails will show as coming from Resend’s domain, not yours.Generate an API key
Navigate to API Keys in the Resend dashboard and create a new key with Sending access. Copy the key — it starts with
re_.Environment variables reference
| Variable | Required | Description |
|---|---|---|
RESEND_API_KEY | Yes | Your Resend API key (re_...) |
EMAIL_FROM | Yes | Sender address shown to recipients |
Call sendEmail directly
If you need to send a custom email outside of the auth flows — for example, a welcome email after onboarding or a notification when a new gallery image is uploaded — call sendEmail from a server function:
sendEmail only runs on the server — RESEND_API_KEY is not exposed to the browser — so always call it from a createServerFn handler or another server-only module.
Test email delivery locally
Resend provides a test mode for local development. Use your Resend API key in.env and send to any address — Resend will deliver the email through their sandbox without hitting your sending limits. Check the Emails section of your Resend dashboard to inspect sent emails and their delivery status.
