Setting Up Supabase Auth Emails
PostHogOfficialPublished by PostHog
- Skill
- Workflow
- Automation and integrations
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured procedure for connecting a Supabase project to PostHog using the Supabase Send Email Hook. It ensures that authentication emails, such as sign-up confirmations and password resets, are handled by PostHog templates. The workflow emphasizes a safe setup order to prevent authentication failures and includes troubleshooting steps for common errors like rate limits or hook configuration issues.
What it does
- Configures the Supabase Send Email Hook to route traffic to PostHog.
- Maps specific authentication email types to corresponding PostHog email templates.
- Provides instructions for verifying email sender domains and managing hook secrets.
- Guides users through raising Supabase email rate limits to accommodate external hooks.
- Offers a diagnostic framework for resolving common hook call failures and errors.
- Ensures safe disconnection procedures to maintain authentication service continuity.
When to use it
- When you need to route Supabase authentication emails through PostHog.
- When troubleshooting 'email rate limit exceeded' errors in Supabase.
- When authentication emails are failing or not being delivered as expected.
- When setting up new email templates for user sign-ups or password resets.
Advantages
- Prevents sign-up interruptions by following a specific, safe configuration order.
- Centralizes email template management within PostHog.
- Provides clear diagnostic steps for common Supabase auth hook errors.
- Ensures proper mapping of core email types to avoid delivery failures.
Usage examples
- “Help me set up my Supabase auth emails to use PostHog templates.”
- The agent will initiate the setup workflow, starting by reading current settings and guiding you through the hook creation and template mapping process.
- “My Supabase auth emails are failing with a 401 error.”
- The agent will investigate the hook secret configuration and guide you through re-syncing the secret between Supabase and PostHog.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/posthog/setting-up-supabase-auth-emails/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip setting-up-supabase-auth-emails.zip -d .agents/skills
Documentation by PostHog
Setting up Supabase auth emails
Supabase calls PostHog's Send Email Hook for each auth email. The user does the Supabase steps by hand, so tell them exactly what to click, and keep the order below.
If the Supabase MCP server is connected, use it to read the project URL (step 4) and the logs (when a hook call fails). It has no tools for Auth settings. Leave the hook and the rate limit to the user even if you have other Supabase access, because those settings send every sign-up email.
The tools are behind a beta flag. If supabase-auth-emails-settings-get isn't available, tell the user the feature isn't enabled for their project yet and stop.
The setup
Read the current state. Call
supabase-auth-emails-settings-get. Keep thehook_url, theemail_typeslist and the currenttemplatesmapping. If the project is already set up, change only what the user asked for.Ask the user's choices in one go. Ask these together, before any change. Use the client's multiple-choice question tool if it has one. Skip any question the state from step 1 already answers.
Project: with no Supabase MCP, ask for the Supabase dashboard link of the project (
supabase.com/dashboard/project/<project-ref>).Templates: create PostHog's starter templates, or use templates they already have.
Hook secret: paste it into the chat, or enter it in PostHog themselves.
Check the email sender. The templates need an email channel with a verified sending domain. Follow the setup check in the
building-workflowsskill's onboarding reference.Save the project URL. With the Supabase MCP, call
get_project_url. Otherwise it ishttps://<project-ref>.supabase.co. For a self-hosted project or a custom domain, ask the user for the URL their app uses to reach Supabase Auth. Save it withsupabase-auth-emails-settings-update.Have the user create the hook in Supabase, switched off. While the hook is on, any hook failure fails the user's sign-up or password reset. Give them the
hook_urland these steps:Open Authentication > Hooks, add a Send Email hook, and choose HTTPS.
Paste the hook URL as the endpoint.
Click Generate secret and copy the whole value.
Leave Enable Send Email hook off, and save.
Save the hook secret. Never invent a hook secret. If a secret is already stored, leave
hook_secretout to keep it, and ask before you replace it. Never send it blank, because a blank value clears it.In the chat: save it with
supabase-auth-emails-settings-update. Don't repeat it back in your reply.In PostHog: give the user a link to
/workflows/channels?setup=supabasein their PostHog app. It opens the Supabase setup. They paste the secret and click Save connection. Then callsupabase-auth-emails-settings-getand confirmhas_hook_secretis true.
Map the templates, as the user chose in step 2:
Starter templates. Call
supabase-auth-emails-starter-templates-create. It creates and maps a template for each email type withhas_starter_templatethat has no usable one yet. If it fails for want of a verified sender, go back to step 3. To change a template's copy or styling, use thedesigning-email-templatesskill.Existing templates. List them with
workflows-list-email-templates, keep the ones that are transactional and marked sensitive, and ask the user which one sends each email. A template that is neither can't be mapped yet. Ask before you make one transactional, because that can't be undone. Send the mapping withsupabase-auth-emails-settings-update. Buildtemplatesfrom the step 1 mapping with your changes merged in, because the field replaces the whole mapping. Ask before you unmap a template that already sends.
Check before the hook goes live. In the response of your last call, confirm
supabase_urlis set,has_hook_secretis true, and every core email type in theemail_typeslist from step 1 has a template. The write responses leave that list out. Core types are the ones that don't end in_notification. A core type with no template fails the user's action. A notification with no template is skipped.Have the user turn the hook on. In Supabase, edit the Send Email hook, switch on Enable Send Email hook, and save. PostHog can't see whether the hook is on, so the Connected status on the Supabase card only means the connection is saved.
Have the user raise Supabase's email rate limit. Supabase checks its own hourly email limit before it calls PostHog. The built-in mailer allows 2 per hour. Once the hook sends the emails, the user can raise the limit under Authentication > Rate Limits. Ask them to check the value there.
Test it. Ask the user to invite a user (Authentication > Users > Add user > Send invitation) or request a password reset, to an address they can read. The email should arrive from the mapped template.
Report done only after the user confirms a test email arrived. Name any email type you left without a template.
To disconnect, the user turns the hook off in Supabase first, then clicks Disconnect in the PostHog setup window. In the other order, every auth email fails in between.
When a hook call fails
The user sees these in Supabase, in the app's error or under Logs > Auth. With the Supabase MCP, find the failed call yourself with its query_logs tool before you ask the user. That tool reads Supabase's logs. PostHog's query-logs tool can't see them.
| What Supabase shows | Cause | Fix |
|---|---|---|
| "email rate limit exceeded" | Supabase's own hourly limit. PostHog never got the call. | Raise the limit (step 10). |
| Supabase's generic hook error, with a 401 from the hook | The hook secret doesn't match. | Have the user copy the full secret again and save it with supabase-auth-emails-settings-update. |
| "No PostHog template is set for the ... email." | A core email type has no template. | Map one (step 7). |
| "We couldn't send your email. Try again in a few minutes." | No project URL saved, a mapped template that is deleted or no longer transactional and sensitive, no verified sender, the email quota, or a slow send. | Check the settings and each mapped template. If they are fine, retry. |
| Links in the email go to the wrong place | The project URL is wrong. | Save the right URL. |
Files
- ATTRIBUTION.mdAdded by AutoGineer881 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md8.0 KiB
LICENSE
MIT License Copyright (c) 2025 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- PostHog
- Publisher
- PostHog (Official)
- Source
- PostHog/skills · skills/omnibus/setting-up-supabase-auth-emails · commit a5d30e7
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by PostHog.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download setting-up-supabase-auth-emails.zip