Resend
Setting up emails with Resend and Supabase integration
Resend is a modern email API built for developers. It offers a generous free tier and has a native integration with Supabase, making it an excellent choice for SvelteShip projects.
Create a Resend Account
- Go to Resend and create an account
- The free tier includes 3,000 emails/month and 100 emails/day
Add and Verify Your Domain
- In the Resend dashboard, go to Domains and click Add Domain
- Enter your domain (e.g.,
yourdomain.com) - Add the DNS records provided by Resend to your Cloudflare DNS settings
- Wait for verification (usually takes a few minutes)
TIPGo to the Deploy section to see how to setup Cloudflare if you do not have a Cloudflare account yet.
Get Your API Key
- Go to API Keys in the Resend dashboard
- Click Create API Key
- Give it a name and select the appropriate permissions
- Copy the API key and save it in your
.env.localfile:
Configure Supabase with Resend (Built-in Integration)
Supabase has a native integration with Resend for authentication emails. To enable it:
- Go to your Supabase project dashboard
- Navigate to Project Settings > Authentication
- Scroll down to SMTP Settings and enable Custom SMTP
- Enter the following settings:
NOTEYou can customize the email templates in the Supabase Auth console to include your product name and branding.
Enable Supabase Integration in Resend
For enhanced deliverability and easier management, enable the native Supabase integration:
- In Resend dashboard, go to Integrations
- Find Supabase and click Enable
- Enter your Supabase project URL and service role key
- This allows Resend to automatically handle auth emails from Supabase
WARNINGKeep your service role key secure. Only use it server-side and never expose it in client code.
Sending Emails from Your App
Create a server-side function to send emails using the Resend API:
Example: Send a Welcome Email
Use the function in your SvelteKit server routes or actions:
Why Choose Resend?
Resend also supports React Email for building beautiful email templates with React components, which can be rendered to HTML for sending.
