supabase-webhooks-events

Featured

Implement Supabase database webhooks, pg_net async HTTP, LISTEN/NOTIFY, and Edge Function event handlers with signature verification. Use when setting up database webhooks for INSERT/UPDATE/DELETE events, sending HTTP requests from PostgreSQL triggers, handling Realtime postgres_changes as an event source, or building event-driven architectures. Trigger with phrases like "supabase webhook", "database events", "pg_net trigger", "supabase LISTEN NOTIFY", "webhook signature verify", "supabase event-driven", "supabase_functions.http_request".

AI & Automation 2,359 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Supabase Webhooks & Database Events ## Overview Supabase offers four complementary event mechanisms: **Database Webhooks** (trigger-based HTTP calls via `pg_net`), **`supabase_functions.http_request()`** (call Edge Functions from triggers), **Postgres LISTEN/NOTIFY** (lightweight pub/sub), and **Realtime `postgres_changes`** (client-side event subscriptions). This skill covers all four patterns with production-ready code including signature verification, idempotency, and retry handling. ## Prerequisites - Supabase project (local or hosted) with `supabase` CLI installed - `pg_net` extension enabled: Dashboard > Database > Extensions > search "pg_net" > Enable - `@supabase/supabase-js` v2+ installed for client-side patterns - Edge Functions deployed for webhook receiver patterns ## Step 1 — Database Webhooks with `pg_net` and Trigger Functions Database webhooks fire HTTP requests when rows change. Under the hood, Supabase uses the `pg_net` extension to make async, non-blocking HTTP calls from within PostgreSQL. ### Enable pg_net and Create the Trigger Function ```sql -- Enable the pg_net extension (one-time) CREATE EXTENSION IF NOT EXISTS pg_net WITH SCHEMA extensions; -- Trigger function: POST to an Edge Function on every new order CREATE OR REPLACE FUNCTION public.notify_order_created() RETURNS trigger AS $$ BEGIN PERFORM net.http_post( url := 'https://<project-ref>.supabase.co/functions/v1/on-order-created', headers := jsonb_build_object( 'Conte...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category