Get started with SendDart and Supabase
Send Supabase Auth and Edge Function emails through SendDart: verify your domain and call the HTTPS Email API from a Deno Edge Function or Auth Hook.
This guide gets you sending with SendDart from a Supabase project — first your Auth emails (password resets, confirmations), then arbitrary mail from Edge Functions (notifications, account activity).
Set up SendDart
Before sending you must verify a domain. In the dashboard, add your domain — we recommend a subdomain like updates.example.com — publish the generated DNS records with your provider, and wait for verification (usually a few minutes).
Send Auth emails through SendDart
Supabase rate-limits its built-in auth mailer. Route Supabase Auth email through a Send Email Hook that calls the SendDart HTTPS API:
- Auth Hooks — use a Supabase Send Email Hook to call SendDart yourself, giving you full control of the template (e.g. via React Email or SendDart Templates).
Send email from a Supabase Edge Function
For non-auth mail, call the SendDart API directly from an Edge Function with native fetch. First create the function with the Supabase CLI:
supabase functions new senddartThen paste the handler into index.ts. Read the API key from an Edge Function secret rather than hard-coding it:
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts';
const SENDDART_API_KEY = Deno.env.get('SENDDART_API_KEY')!;
serve(async (_req: Request): Promise<Response> => {
const res = await fetch('https://www.senddart.com/api/emails', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${SENDDART_API_KEY}`,
},
body: JSON.stringify({
from: 'Acme <hello@yourdomain.com>',
to: ['delivered@yourdomain.com'],
subject: 'hello world',
html: '<strong>it works!</strong>',
}),
});
const data = await res.json();
return new Response(JSON.stringify(data), {
status: res.status,
headers: { 'Content-Type': 'application/json' },
});
});Set the secret, run the function locally, then deploy:
# store the key as a secret (never commit it)
supabase secrets set SENDDART_API_KEY=mb_xxxxxxxxx
# run locally
supabase functions serve senddart --no-verify-jwt
# deploy
supabase functions deploy senddartfrom address must be on a verified domain. Keep your mb_ key in a secret, not in source — see Handling API keys securely.For the request and response shape, see the emails API.