Skip to content

docs: send Supabase auth emails through SESKit - #64

Merged
Otitodev merged 2 commits into
mainfrom
feat/supabase-auth-emails
Oct 5, 2026
Merged

Otitodev merged 2 commits into
mainfrom
feat/supabase-auth-emails

Conversation

@Otitodev

@Otitodev Otitodev commented Oct 5, 2026

Copy link
Copy Markdown
Owner

What and why

Supabase Auth sends its own emails from a shared mailer meant for development. This adds a guide and a small Supabase Edge Function that hand those emails to SESKit instead, so they go out from the user's domain and appear in the dashboard, events and suppression list.

  • The function (docs/guides/supabase/send-email.ts) checks Supabase's Standard Webhooks signature, builds the confirmation link, and calls POST /v1/emails with an Idempotency-Key. Templates cover signup, invite, magic link, recovery, email change (two emails when secure), email OTP and reauthentication.
  • The guide (docs/guides/supabase-auth-emails.md) covers setup, what is sent, and how failures behave.

What to review hardest:

  • Failure behaviour. Supabase allows the hook 5 seconds and retries a 503. SESKit being slow or down gives 503, and the idempotency key makes the retry safe. A refusal gives 400.
  • email_change. Supabase names its token pairs backwards. The code follows their documented mapping, and a test covers the case where the unused pair arrives as empty strings.
  • Nothing sensitive in logs (no address, token or link), and every value in the HTML is escaped.

Not done, and worth knowing:

  • Not run against a live Supabase project. The guide says so in a caution box, to be removed after a real signup, reset and magic link.
  • The function is TypeScript, because Supabase Edge Functions run on Deno. AGENTS.md says no Node.js; this runs on Supabase and needs no toolchain here, but it is a judgement call.
  • No tests in the repo. CI cannot run TypeScript. I ran 18 tests locally with Node's built-in runner, outside the repo. The code has not been type-checked.
  • Unverified: whether enabling the hook lifts Supabase's own email rate limits; the docs do not say.
  • May conflict slightly with feat: turn receiving on, and read it in the dashboard (inbound Phase D) #63 in mkdocs.yml.

Checks

  • Docs: updated, and uv run --group docs mkdocs build --strict is clean

🤖 Generated with Claude Code

@Otitodev
Otitodev merged commit ec29902 into main Oct 5, 2026
7 checks passed
@Otitodev
Otitodev deleted the feat/supabase-auth-emails branch October 5, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant