# 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. - Company: Supabase (https://www.justpush.io/recipes/supabase) - Event: `INSERT` (Insert on auth.users) - Tags: Backend & auth, Sign-ups & users - Install: https://studio.justpush.io/recipes/supabase/new-user - Web page: https://www.justpush.io/recipes/supabase/new-user ## Setup 1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL. 2. In the Supabase dashboard, open Integrations > Database Webhooks (enable it if asked) and click Create a new hook. 3. Pick the table and the Insert on auth.users event, and choose HTTP Request with method POST. 4. Paste your webhook URL (shown in Studio after install) as the URL, adding any options from the setup notes below, and create the webhook. 5. 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: 6. ```sql 7. create extension if not exists pg_net with schema extensions; 8. create or replace function public.justpush_new_user() 9. returns trigger 10. language plpgsql 11. security definer 12. set search_path = '' 13. as $$ 14. begin 15. perform net.http_post( 16. url := 'your webhook URL (shown in Studio after install)', 17. body := jsonb_build_object( 18. 'type', tg_op, 19. 'table', tg_table_name, 20. 'schema', tg_table_schema, 21. 'record', jsonb_build_object( 22. 'id', new.id, 23. 'email', new.email, 24. 'phone', new.phone, 25. 'created_at', new.created_at, 26. 'raw_app_meta_data', new.raw_app_meta_data, 27. 'raw_user_meta_data', new.raw_user_meta_data 28. ), 29. 'old_record', null 30. ), 31. headers := '{"Content-Type": "application/json"}'::jsonb, 32. timeout_milliseconds := 5000 33. ); 34. return new; 35. exception when others then 36. -- Never block a signup because the notification couldn't be queued. 37. return new; 38. end; 39. $$; 40. create trigger justpush_new_user 41. after insert on auth.users 42. for each row execute function public.justpush_new_user(); 43. ``` 44. `pg_net` sends the request in the background after the signup commits, so it doesn't slow sign-ups down. 45. To name your app in the title ("👤 New Acme user"), end the URL in the SQL with `?app=Acme`. 46. To remove it: 47. ```sql 48. drop trigger if exists justpush_new_user on auth.users; 49. drop function if exists public.justpush_new_user(); 50. ``` 51. The request isn't signed, so keep your endpoint URL private. ## Code Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing. ```js // Supabase → new Auth user (INSERT on auth.users) // Fires when someone signs up with Supabase Auth, via a database trigger on auth.users // that posts the Database Webhook payload (see INSTALL.md for the SQL). // Docs: https://supabase.com/docs/guides/database/webhooks // Sign-in providers, and how to name them. const PROVIDERS = { email: "email", phone: "phone", google: "Google", github: "GitHub", apple: "Apple", azure: "Microsoft", facebook: "Facebook", discord: "Discord", twitter: "X (Twitter)", gitlab: "GitLab", bitbucket: "Bitbucket", slack_oidc: "Slack", linkedin_oidc: "LinkedIn", spotify: "Spotify", twitch: "Twitch", notion: "Notion", zoom: "Zoom", figma: "Figma", kakao: "Kakao", keycloak: "Keycloak", workos: "WorkOS", sso: "SSO", } // Supabase sends plain strings; treat blanks as missing. function text(value) { return typeof value === "string" && value.trim() ? value.trim() : null } function pick(table, key, fallback) { return typeof key === "string" && Object.prototype.hasOwnProperty.call(table, key) ? table[key] : fallback } function handleRequest(request) { const body = request.body && typeof request.body === "object" ? request.body : {} const user = body.record // Guard: only new rows in auth.users. if (body.type !== "INSERT" || body.schema !== "auth" || body.table !== "users" || !user || typeof user !== "object") { console.log(`Ignoring Supabase ${body.type ?? "unknown"} on ${body.schema ?? "?"}.${body.table ?? "?"}`) return null } const meta = user.raw_user_meta_data && typeof user.raw_user_meta_data === "object" ? user.raw_user_meta_data : {} const app = user.raw_app_meta_data && typeof user.raw_app_meta_data === "object" ? user.raw_app_meta_data : {} const name = text(meta.full_name) ?? text(meta.name) ?? text(meta.user_name) const contact = text(user.email) ?? text(user.phone) const anonymous = user.is_anonymous === true || (!contact && !name) const who = anonymous ? "An anonymous user" : name && contact ? `${name} (${contact})` : name || contact const raw = text(app.provider) const provider = raw ? pick(PROVIDERS, raw, raw) : null // ?app=MyApp names your project in the title. const project = text(request.query?.app) return { title: `👤 New ${project ? `${project} ` : ""}user`, message: `${who} signed up` + (provider && !anonymous ? ` with ${provider}` : ""), topic: "Supabase", priority: -1, // Low — good news, nothing to do } } ``` ## Supabase INSERT webhook payload (sample) ```json { "type": "INSERT", "table": "users", "record": { "id": "8f6a1c2e-0000-4000-8000-000000000001", "email": "ada@example.com", "phone": null, "created_at": "2026-09-29T09:20:31.118Z", "raw_app_meta_data": { "provider": "github", "providers": [ "github" ] }, "raw_user_meta_data": { "full_name": "Ada Lovelace", "user_name": "ada" } }, "schema": "auth", "old_record": null } ``` ## FAQ ### 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.