Supabase allows configuring Database Webhooks triggered automatically by PostgreSQL
row-level changes (INSERT, UPDATE, DELETE) via pg_net and Supabase Edge Functions.
Whether you are syncing database mutations to search indexes (Algolia, Typesense), triggering asynchronous background jobs, or notifying external partner services, reliable delivery of Supabase Database Webhooks is essential.
How Supabase Database Webhooks work
When a row in a specified table changes, PostgreSQL triggers an HTTP request via the pg_net extension:
type: Change type (INSERT,UPDATE,DELETE).table: Table name that triggered the event.schema: Database schema (typicallypublic).record: The new row data (present onINSERTandUPDATE).old_record: The previous row data (present onUPDATEandDELETE).
Securing Supabase webhook endpoints
Supabase webhooks can be configured with custom HTTP request headers for authentication.
The standard practice is to pass a shared secret token in an Authorization header:
Authorization: Bearer sb_sec_YOUR_WEBHOOK_SECRET Your receiver must validate this header before executing database queries or business logic.
Common failure modes with Database Webhooks
- pg_net timeout on bulk writes: Large batch updates (e.g.
UPDATE orders SET status = 'processed' WHERE ...) can trigger hundreds of simultaneous webhook HTTP requests. If your server is not scaled for concurrency, requests will queue up and time out. - Infinite update loops: If your webhook handler updates the same Supabase table that triggered the webhook, it can cause an infinite cascade of database events.
- Out-of-order execution: Two rapid updates to the same row can arrive at your receiver out of order due to network latency. Always check row timestamps or version columns.
Capturing and Replaying with HookWatch
HookWatch acts as a resilient buffer and inspector in front of your internal workers:
- Catch every database event payload from Supabase with low latency.
- Protect your primary backend from spikes with smooth queuing.
- Group repeated endpoint errors into incidents and replay failed deliveries after schema migrations.