posthog/ai-plugin

setting-up-supabase-auth-emails

Connect a Supabase project so its auth emails send through PostHog email templates via the Supabase Send Email Hook, in an order that never breaks a sign-up.

Zobacz źródło

Jak używać

  1. Skopiuj polecenie instalacji i sprawdź źródła przed instalacją we własnym środowisku agenta.
  2. W oryginale sprawdź wymagane narzędzia, dane dostępowe i obsługiwane środowiska.
  3. Opisz dane wejściowe i oczekiwany rezultat; porównaj wynik ze źródłami.
npx skills add https://github.com/posthog/ai-plugin --skill setting-up-supabase-auth-emails

Przed rozpoczęciem

  • Instalacja nie obejmuje subskrypcji modelu, limitu API ani uprawnień do plików.
  • Gwiazdki i instalacje pokazują aktywność, a nie niezależny test jakości lub bezpieczeństwa.
Oryginalny dokument Skill

Treść z repozytorium z zachowaniem nagłówków, przykładów, kodu, tabel, linków i obrazów.

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

  1. Read the current state. Call supabase-auth-emails-settings-get. Keep the hook_url, the email_types list and the current templates mapping. If the project is already set up, change only what the user asked for.
  2. 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.
  1. Check the email sender. The templates need an email channel with a verified sending domain. Follow the setup check in the building-workflows skill's onboarding reference.
  2. Save the project URL. With the Supabase MCP, call get_project_url. Otherwise it is https://<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 with supabase-auth-emails-settings-update.
  3. 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_url and 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.
  1. Save the hook secret. Never invent a hook secret. If a secret is already stored, leave hook_secret out 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=supabase in their PostHog app. It opens the Supabase setup. They paste the secret and click Save connection. Then call supabase-auth-emails-settings-get and confirm has_hook_secret is true.
  1. 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 with has_starter_template that 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 the designing-email-templates skill.
  • 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 with supabase-auth-emails-settings-update. Build templates from 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.
  1. Check before the hook goes live. In the response of your last call, confirm supabase_url is set, has_hook_secret is true, and every core email type in the email_types list 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.
  2. 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.
  3. 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.
  4. 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 showsCauseFix
"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 hookThe 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 placeThe project URL is wrong.Save the right URL.
z tego samego repozytorium

Więcej Skills

Wszystkie Skills
posthog
Oficjalne

composing-grid-canvases

Compose PostHog grid canvases — widget grids (including the user's home canvas) built from reusable component canvases. Use when a task asks to add, fill, move, resize, or remove a widget on a grid or home canvas, to compose a whole canvas of widgets from one ask, to build a reusable widget/component, or when a placement id or grid canvas id is the target. Covers the component store search → configure → fork → build ladder, the component placement contract (size, configSchema), the placement lif

Instalacje / 1h
1
GitHub Stars
96
Aktualizacja
31 paź
posthog
Oficjalne

consuming-endpoints-from-client-code

Wire a PostHog endpoint into a client app or SDK. Covers fetching the OpenAPI spec, generating a typed client with openapi-generator or @hey-api/openapi-ts, sending the right auth header, shaping the variables payload (HogQL codename vs insight breakdown property), handling rate-limit and materialised-endpoint error responses. Use when the user says "how do I call my endpoint", "generate a client for this", or "what auth header do I use".

Instalacje / 1h
1
GitHub Stars
96
Aktualizacja
31 paź
posthog
Oficjalne

designing-email-templates

Author, save, and edit email templates in the PostHog workflows library — compose email design JSON with Liquid personalization and create and round-trip-edit templates over MCP. Use when asked to design, build, update, or fix an email template for workflows, broadcasts, or campaigns.

Instalacje / 1h
1
GitHub Stars
96
Aktualizacja
31 paź
posthog
Oficjalne

exploring-llm-evaluations

Investigate AI observability evaluations — hog (deterministic code-based), llmjudge (LLM-prompt-based), and sentiment (user-message sentiment). Find existing evaluations, inspect their configuration, run them against specific generations, query individual results, and set up scheduled reports on an evaluation. Use when the user asks to debug why an evaluation is failing, surface common failure modes, compare results across filters, dry-run a Hog evaluator, prototype a new LLM-judge prompt, inspe

Instalacje / 1h
1
GitHub Stars
96
Aktualizacja
31 paź