auth.users table fire Brew automations. Send a real welcome email after the email is verified, or alert the user the moment their password changes. Account-suspension notices work the same way.
- Trigger automations from Supabase auth events. Real signups, email and phone confirmations, password changes, bans, invites.
- Auto-sync contacts into your audience. Every Supabase event upserts the user into Brew with
supabase-prefixed custom fields (supabaseUserId,supabaseAccountStatus,supabaseEmailVerifiedAt,supabasePhoneVerifiedAt,supabaseLastSignInAt, etc.) you can filter and segment on. - Get more than INSERT/UPDATE/DELETE. Brew classifies column-level changes into 9 specific events on top of the 3 raw ones (for example,
auth.user.email_confirmedfires the momentemail_confirmed_atflips from null to set). - Stay safe at scale. Postgres signs every webhook with a shared secret you control (pgcrypto and Vault handle the HMAC), and Brew verifies the signature on receipt.
How It Works
Supabase works like every other event source, except that a database trigger sends the events. Brew gives you a webhook URL and setup SQL to paste into your project. The SQL installspgcrypto and stores your shared secret in Supabase Vault. It adds a trigger on auth.users that signs each change, and pg_net posts it to Brew.
Brew checks the signature, then classifies each UPDATE. A column change can match one of the 9 specific events, such as email_confirmed_at going from null to set. Brew then fires that event instead of auth.user.updated.
Each verified event starts the matching Live automations and upserts the user into your audience with supabase-prefixed fields.
Connected-Source Events has the full model.
Setup
1
Generate your Brew webhook URL
In Brew, open Integrations, click the Supabase card, and click Generate webhook URL. The SQL block in step 3 pre-fills the URL for you.
2
Generate a shared secret
Run
openssl rand -hex 32 in your terminal to print a 64-character hex string. You’ll paste this same value into the SQL block (step 3) and the Brew connect form (step 4). You own this secret; Brew and Supabase don’t issue it.3
Run the setup SQL in Supabase
In your Supabase project, open SQL Editor → New query. Paste the SQL block that Brew shows in the connect dialog. Replace
<PASTE_YOUR_SECRET_HERE> with the secret from step 2, then click Run.The block installs the pgcrypto extension and stores your shared secret in Supabase Vault. It also creates a trigger on auth.users that signs every change with HMAC-SHA-256 before pg_net POSTs it to Brew.4
Paste the same secret into Brew
Paste the secret from step 2 into the Brew connect form and click Connect. Brew uses it to verify every webhook the new trigger sends.
5
Create a test user to verify
After you click Connect, create a test user in Supabase under Authentication → Users. The trigger the setup SQL installed signs and sends the event automatically; there’s no separate “send test” button.Within a few seconds the Supabase integration page in Brew changes from Waiting for test event to Connected. Manage → Recent events shows the delivery with signature ok.If it stays on Waiting for test event, check the setup SQL ran cleanly. Then check that the secret in the SQL block matches the one you pasted into Brew.Create the test user after clicking Connect. Before that, Brew has no connection to route the event to.
Re-running the SQL block after rotating the secret is safe. The block drops and re-creates the trigger idempotently.
Supported Events
Connecting created a trigger for every Supabase auth event below, with no extra setup. Each is on the Triggers page and in the automation builder. Until a Live automation uses one, its events show 0 matched / 0 started in Recent events, which is expected. The Manage tab shows:- Webhook URL: the URL your Supabase webhooks point at
- Supabase events: how many events Brew has received, and each event’s status
- Recent events: up to 25 of the newest deliveries that passed the signature check
auth.user.created: INSERT intoauth.usersauth.user.updated: UPDATE that didn’t match a synthetic classificationauth.user.deleted: DELETE fromauth.users
auth.user.email_confirmed:email_confirmed_attransitions from null to setauth.user.phone_confirmed:phone_confirmed_attransitions from null to setauth.user.email_changed:emailcolumn changes between rowsauth.user.password_changed:encrypted_passwordchanges between rowsauth.user.signed_in:last_sign_in_atchangesauth.user.banned:banned_untiltransitions from null to setauth.user.unbanned:banned_untiltransitions from set to nullauth.user.invited:invited_attransitions from null to setauth.user.upgraded_from_anonymous:is_anonymousflips from true to false
A single UPDATE only fires one synthetic event: the highest-priority classification wins. Email confirmation beats phone confirmation, which beats anonymous-to-real upgrade, and so on.
Common Patterns
Kind follows What You Can Send. Send transactional email (a direct response to something the person did) from a transactional-purpose domain. Marketing email needs the contact’s opt-in, and being synced from Supabase isn’t consent. Both means the confirmation is transactional and the follow-up is marketing.Personalization
These resolve as merge tags in the email body, subject line, and preview text. Use a fallback wherever an empty value would read badly, like{{ firstName | there }}. The trigger. prefix reads the same field, so {{ trigger.firstName }} and {{ firstName }} resolve alike; see Namespaces.
Each event declares its own fields, and an automation won’t publish with a tag its trigger doesn’t declare. Use only the variables listed for your event. Event names below drop the auth.user. prefix.
The Supabase user UUID is not available as a merge tag: it never reaches the trigger payload. Brew writes it to the synced contact as the
supabaseUserId custom field instead. Filter, segment, and join on it there.Troubleshooting
To check delivery, usecheck_trigger over MCP or GET /v1/automations/triggers/{triggerEventId}/readiness. Its delivery.status is one of:
received: Brew has seen the eventnever_received: Brew hasn’t seen itnone_recent: no event in the last 90 dayswaiting_for_test_event: the project hasn’t sent its first signed delivery
received, delivery.message names the setup step to check.
An event arrived but no automation fired
An event arrived but no automation fired
Open the canvas and confirm at least one automation bound to this event is set to Live (not Draft). The Brew integration’s Manage → Recent events panel confirms the webhook is arriving. If it isn’t there, the issue is upstream (pgcrypto trigger not installed, secret mismatch).If the event is there but no email sent, the automation may be unpublished, or the contact unsubscribed or suppressed. From an agent,
check_trigger lists what blocks the trigger, and list_trigger_events shows each event’s match state and its runs.A direct SQL update didn't sync the contact
A direct SQL update didn't sync the contact
Brew de-duplicates Supabase updates by the row’s
updated_at. An UPDATE on auth.users that leaves it unchanged can match an earlier event, so nothing syncs.When you edit users with SQL, set updated_at = now() in the same statement. Brew then fires a fresh auth.user.updated and syncs the contact.Webhooks aren't arriving at all
Webhooks aren't arriving at all
Re-run the setup SQL block from the integration page. The block is idempotent: it re-creates the trigger and re-writes the Vault entry.Confirm that
pgcrypto is installed (SELECT * FROM pg_extension WHERE extname = 'pgcrypto';). Then check that the secret in Vault matches the one pasted into Brew.auth.user.signed_in fires constantly
auth.user.signed_in fires constantly
Supabase token refreshes also bump
last_sign_in_at, which fires auth.user.signed_in alongside true sign-ins. Add a per-user wait or filter node in your automation to ignore repeats within a short window. For higher-signal events, rely on auth.user.email_confirmed / auth.user.upgraded_from_anonymous.I want to test before going live
I want to test before going live
Insert a test row into
auth.users (or sign up through your normal flow) and watch Manage → Recent events. Build your automation as a Draft and run a test send from the email editor. Publish it to Live once you’re happy.From an Agent or Code
Connecting Supabase, running the setup SQL, and pasting the shared secret are app-only. From an agent or code, the rest is readable and buildable:list_integrationsorGET /v1/integrationsconfirms Supabase is connected to the brand.check_triggerorGET /v1/automations/triggers/{triggerEventId}/readinessshows whether Brew has received an event and which Live automations consume it.list_trigger_eventslists recent deliveries, their match state, and the runs they started.save_automationorPOST /v1/automationsbuilds an automation on any event above, andtest_automationruns it to one address.
fire_trigger_event isn’t used here.
Requirements
- A Supabase project where you can run SQL against the
authschema - Permission to install extensions (
pgcrypto) and write to Supabase Vault
Need Help?
Our team is ready to support you at every step of your journey with Brew. Choose the option that works best for you:- Self-Service Tools
- Talk to Our Team
Search Documentation
Type in the “Ask any question” search bar at the top left to instantly find relevant documentation pages.
Ask ChatGPT or Claude
Click here to open the Copy page menu at the top of this page, then send the page to ChatGPT, Claude, or your editor.