Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.senderkit.com/llms.txt

Use this file to discover all available pages before exploring further.

By the end of this guide, an email sends automatically when a row in your Supabase database changes — using the example of an async export job: when its row flips to done, the user gets a “your export is ready” email with a download link. Supabase Auth already sends its own emails (confirmation, magic link, reset), so don’t rebuild those. The gap is app-domain notifications — “your export is ready,” “a new comment,” “someone joined your waitlist” — none of which any platform sends for you. They all reduce to the same pattern: a row changes, you call send().
You’ll need: a SenderKit account with an API key, a Supabase project, and the Supabase CLI. The example assumes an exports table with email, file_name, download_url, and status columns.
1

Author the template

Create an email template with the slug export-ready and the variables file_name and download_url:
Template copy (in the dashboard editor)
Subject: Your export is ready

{{file_name}} is ready to download:
{{download_url}}
2

Choose how the row change reaches SenderKit

Supabase can react to row changes two ways. Both are valid; pick based on whether you need to keep your API key server-side and shape the payload.
3

Create the Database Webhook

In the Supabase Studio, go to Integrations → Webhooks → Create a new hook:
  • Table: exports
  • Events: Update
  • Type: HTTP Request → POST
  • URL: your Edge Function URL (https://<project-ref>.supabase.co/functions/v1/notify-export) or your Next.js route
  • HTTP Headers: add x-webhook-secret with the value you generated above
The webhook POSTs the standard payload{ type, table, schema, record, old_record } — on every matching row change.
4

Verify it works

With an sk_test_ key set as the function secret, flip a row to done:
update exports set status = 'done',
  file_name = 'report.csv',
  download_url = 'https://files.example.com/report.csv'
where id = '...';
Watch the message appear in the SenderKit dashboard, running the full lifecycle in test mode. The idempotencyKey: export:${id} means a duplicate webhook delivery won’t email twice.
Database Webhook delivery is asynchronous and can lag a second or more behind the commit — fine for notifications, but don’t rely on it for anything that must be synchronous with the write.
5

Go live

Update the function secret to an sk_live_ key (supabase secrets set SENDERKIT_API_KEY=sk_live_... and redeploy). Same trigger, real delivery.

What’s next

Send team invites

Another app-domain email, triggered from your own data.

Recover failed payments

Lifecycle emails from Stripe webhooks.

Sending

Idempotency and the accept-now / deliver-later model.

Messages

Filter sends by the metadata you attached.