Supabase: push notifications for errors and new rows
July 14, 2026 · 4 min read
Supabase can call any URL when something happens – from Edge Functions and from the database itself. Point it at a Webhooky endpoint and your phone knows about errors and new rows before you open the dashboard.
Edge Functions: alert on every exception
Deno has fetch built in, so the error pattern is three lines:
Deno.serve(async (req) => {
try {
return await handle(req);
} catch (err) {
await fetch("https://api.webhooky.app/ERROR_KEY", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
title: "🚨 Edge function failed",
message: String(err).slice(0, 400),
}),
}).catch(() => {});
throw err;
}
});
title and message override the endpoint's defaults per request, so the notification itself tells you what broke. Store the URL in a secret (supabase secrets set WEBHOOKY_URL=…) rather than hardcoding it.
Database Webhooks: a push for every new row
The part most people miss: Supabase has Database Webhooks built in. In the dashboard, go to Database → Webhooks → Create a new hook:
- Table: e.g.
orders, events:INSERT - Type: HTTP Request, method POST
- URL: your Webhooky endpoint
Done – every new order row rings your phone with the endpoint's configured text and sound. No function, no code. The full row payload is stored with the event if you enable store payload in the app.
Postgres triggers for custom messages
Want the row's data in the notification text? Use a trigger with pg_net and build the JSON yourself:
select net.http_post(
url := 'https://api.webhooky.app/YOUR_KEY',
body := jsonb_build_object(
'title', '🛒 New order',
'message', 'Order #' || new.id || ' · ' || new.total || ' €'
)
);
What to watch
- One endpoint per signal (errors, orders, signups) – each with its own sound.
- Don't put personal data in the notification text if you don't need it; the payload can stay in the app history instead.
Get Webhooky
Free for your first 100 notifications – set up your endpoint in two minutes.