- Accordion
- Action Sheet
- Alert
- Alert Dialog
- Audio Player
- Audio Recorder
- Audio Waveform
- Avatar
- AvoidKeyboard
- Badge
- BottomSheet
- Button
- Camera
- Camera Preview
- Card
- Carousel
- Checkbox
- Collapsible
- Color Picker
- Combobox
- Date Picker
- File Picker
- Gallery
- Hello Wave
- Icon
- Image
- Input
- Input OTP
- Link
- MediaPicker
- Mode Toggle
- Onboarding
- ParallaxScrollView
- Picker
- Popover
- Progress
- Radio
- ScrollView
- SearchBar
- Separator
- Share
- Sheet
- Skeleton
- Spinner
- Switch
- Table
- Tabs
- Text
- Toast
- Toggle
- Video
- View
Overview
This guide will walk you through setting up Resend email service for your BNA UI Convex Auth Starter application. By the end of this setup, your users will be able to:
- Sign up and sign in using email and password
- Receive email OTP (One-Time Password) for passwordless authentication
- Get password reset emails
- Receive account verification emails
Prerequisites
Before starting, ensure you have:
- A Resend account (create one at Resend.com)
- A domain you own and can verify
- A BNA UI Convex Auth Starter project set up
- Access to your domain's DNS settings
Step 1: Create a Resend Account
- Navigate to Resend.com
- Click "Sign Up" to create a new account
- Verify your email address through the confirmation email
- Complete your account setup


Step 2: Domain Verification
Add Your Domain
- In your Resend dashboard, navigate to Domains in the left sidebar
- Click "Add Domain"
- Enter your domain name (e.g.,
yourdomain.com
) - Click "Add"


Configure DNS Records
Resend will provide you with DNS records that you need to add to your domain:
SPF Record
Add this TXT record to your domain:
Name: @
Type: TXT
Value: v=spf1 include:_spf.resend.com ~all
DKIM Records
Add the DKIM records provided by Resend (you'll get specific values):
Name: resend._domainkey
Type: TXT
Value: [Provided by Resend - specific to your domain]
DMARC Record (Recommended)
Add a DMARC policy for additional security:
Name: _dmarc
Type: TXT
Value: v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com

Verify Domain
- After adding DNS records, return to your Resend dashboard
- Click "Verify" next to your domain
- Wait for verification to complete (this may take a few minutes to 24 hours)
Step 3: Create API Key
Generate API Key
- In your Resend dashboard, navigate to API Keys
- Click "Create API Key"
- Configure your API key:
- Name: Enter a descriptive name (e.g., "BNA UI Auth Production")
- Permission: Select "Full access" for complete functionality
- Domain: Select your verified domain (optional but recommended)



Copy API Key
- Click "Add" to generate the key
- Important: Copy the API key immediately - you won't be able to see it again
- Store it securely (you'll add it to your environment variables)

Step 4: Configure Environment Variables
Set Convex Environment Variables
You can configure environment variables using either the Convex CLI or dashboard.
Option 1: Using Convex CLI (Recommended)
Open your terminal in your BNA UI project directory and run:
# Set Resend API Key
npx convex env set AUTH_RESEND_KEY re_your_resend_api_key_here
Option 2: Using Convex Dashboard
- Open your Convex dashboard
- Navigate to Settings > Environment Variables
- Add the following variable:
- Variable Name:
AUTH_RESEND_KEY
, Value: Your Resend API key
- Variable Name:
Step 6: Test Email Configuration
Test Email Sending
-
Deploy your Convex functions:
pnpm dlx convex dev
-
Test the authentication flow:
- Try signing up with email/password
- Test email OTP authentication
- Verify password reset functionality
Monitor Email Delivery
- In your Resend dashboard, go to Logs
- Monitor email delivery status
- Check for any delivery issues or bounces
Step 7: Production Configuration
Separate API Keys for Environments
For production applications, create separate API keys:
Development Environment
pnpm dlx convex env set AUTH_RESEND_KEY re_dev_api_key_here
Production Environment
pnpm dlx convex env set AUTH_RESEND_KEY re_prod_api_key_here --prod
Common Issues and Solutions
Email Not Delivering
Issue: Users not receiving authentication emails
Solutions:
- Verify your domain is properly configured
- Check Resend logs for delivery status
- Ensure your "from" address uses your verified domain
- Check recipient's spam folder
SPF/DKIM Failures
Issue: Emails marked as spam or rejected
Solutions:
- Verify all DNS records are correctly configured
- Wait up to 24 hours for DNS propagation
- Use DNS lookup tools to verify record configuration
- Consider adding DMARC policy
API Key Issues
Issue: Authentication failing with API errors
Solutions:
- Verify API key is correctly set in environment variables
- Ensure API key has "Full access" permissions
- Check that the key hasn't expired
- Regenerate API key if necessary
Rate Limiting
Issue: Hitting email sending limits
Solutions:
- Implement client-side rate limiting for resend requests
- Upgrade to higher-tier Resend plan
- Cache OTP codes server-side to reduce duplicate sends
- Add cooldown periods between email requests
Security Best Practices
API Key Security
- Store API keys in environment variables only
- Never commit API keys to version control
- Rotate API keys regularly
- Use different keys for development and production
Email Security
- Always use your verified domain for "from" addresses
- Implement proper DMARC policies
- Monitor bounce rates and spam reports
- Use HTTPS for all authentication links
Support and Resources
For additional help:
Secure email authentication made simple with Resend and BNA UI! 📧✨
On This Page
OverviewPrerequisitesStep 1: Create a Resend AccountStep 2: Domain VerificationAdd Your DomainConfigure DNS RecordsSPF RecordDKIM RecordsDMARC Record (Recommended)Verify DomainStep 3: Create API KeyGenerate API KeyCopy API KeyStep 4: Configure Environment VariablesSet Convex Environment VariablesOption 1: Using Convex CLI (Recommended)Option 2: Using Convex DashboardStep 6: Test Email ConfigurationTest Email SendingMonitor Email DeliveryStep 7: Production ConfigurationSeparate API Keys for EnvironmentsDevelopment EnvironmentProduction EnvironmentCommon Issues and SolutionsEmail Not DeliveringSPF/DKIM FailuresAPI Key IssuesRate LimitingSecurity Best PracticesAPI Key SecurityEmail SecuritySupport and Resources