Menu

Post image 1
Post image 2
1 / 2
0

Supabase Webhooks Deep Dive — Database Triggers, pg_net & Edge Function Patterns

DEV Community·kanta13jp1·30 days ago
#eftnR7ss
Reading 0:00
15s threshold

Supabase Webhooks Deep Dive — Database Triggers, pg_net & Edge Function Patterns Supabase Webhooks let you react to INSERT/UPDATE/DELETE events on any table and call an external endpoint or an Edge Function automatically. Under the hood it uses the pg_net extension to fire non-blocking HTTP requests directly from PostgreSQL triggers. How it works DB change → pg_net (async HTTP) → Edge Function or external endpoint Enter fullscreen mode Exit fullscreen mode Configuring via Dashboard Database → Webhooks → Create a new hook Select table and events (INSERT / UPDATE / DELETE) Provide an endpoint URL Set HTTP method and headers Controlling pg_net directly in SQL create extension if not exists pg_net ; -- Fire a POST from within a SQL function select net . http_post ( url : = 'https://your-project.supabase.co/functions/v1/notify-user' , body : = json_build_object ( 'user_id' , NEW .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More