Supabase new user notifications on your phone.
Get a low-priority push notification when someone signs up to your app with Supabase Auth, with their name and sign-in method.
Three steps to your first push
Install the recipe
One click in Studio gives you a personal webhook URL.
Paste your URL into Supabase
Add it as a webhook for Insert on auth.users.
Get a push on your phone
With the text, sound and buttons from the recipe.
How to set up the Supabase insert on auth.users webhook
- Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
- In the Supabase dashboard, open Integrations > Database Webhooks (enable it if asked) and click Create a new hook.
- Pick the table and the Insert on auth.users event, and choose HTTP Request with method POST.
- Paste your webhook URL as the URL, adding any options from the setup notes below, and create the webhook.https://••••••••/•••••••• your personal URL, shown after install
- New Supabase Auth users are rows in the `auth.users` table. Instead of the dashboard form (which would send the whole row, password hash and tokens included), run this once in the **SQL Editor**. It posts the same payload as a Database Webhook, but only with the columns the push needs:
- ```sql
- create extension if not exists pg_net with schema extensions;
- create or replace function public.justpush_new_user()
- returns trigger
- language plpgsql
- security definer
- set search_path = ''
- as $$
- begin
- perform net.http_post(
- url := 'your webhook URL',
- body := jsonb_build_object(
- 'type', tg_op,
- 'table', tg_table_name,
- 'schema', tg_table_schema,
- 'record', jsonb_build_object(
- 'id', new.id,
- 'email', new.email,
- 'phone', new.phone,
- 'created_at', new.created_at,
- 'raw_app_meta_data', new.raw_app_meta_data,
- 'raw_user_meta_data', new.raw_user_meta_data
- ),
- 'old_record', null
- ),
- headers := '{"Content-Type": "application/json"}'::jsonb,
- timeout_milliseconds := 5000
- );
- return new;
- exception when others then
- -- Never block a signup because the notification couldn't be queued.
- return new;
- end;
- $$;
- create trigger justpush_new_user
- after insert on auth.users
- for each row execute function public.justpush_new_user();
- ```
- `pg_net` sends the request in the background after the signup commits, so it doesn't slow sign-ups down.
- To name your app in the title ("👤 New Acme user"), end the URL in the SQL with `?app=Acme`.
- To remove it:
- ```sql
- drop trigger if exists justpush_new_user on auth.users;
- drop function if exists public.justpush_new_user();
- ```
- The request isn't signed, so keep your endpoint URL private.
What runs when the webhook arrives
Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.
The Supabase INSERT webhook
This is what Supabase sends to your URL for insert on auth.users. It is a sample, trimmed to the fields recipes use.
Supabase new user notifications: questions
Does this work on iPhone and Android?
Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.
Do I need to write code?
No. Install the recipe in Studio, paste your webhook URL into Supabase and you are done. The code is there if you want to change the text, the sound or the buttons.
Can I change what the notification says?
Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.
What does it cost?
JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.
Supabase on your phone in two minutes.
Install the recipe, paste one URL, done. Free for 30 days, no credit card required.