SU

supabase-webhooks-events

Set up database webhooks, LISTEN/NOTIFY, and event handlers with signature verification in Supabase.

Install

mkdir -p .claude/skills/supabase-webhooks-events && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4808" && unzip -o skill.zip -d .claude/skills/supabase-webhooks-events && rm skill.zip

Installs to .claude/skills/supabase-webhooks-events

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Implement Supabase database webhooks, pg_net async HTTP, LISTEN/NOTIFY,
71 charsno explicit “when” trigger
Advanced

Key capabilities

  • →Implement database webhooks using pg_net
  • →Call Edge Functions from PostgreSQL triggers
  • →Utilize Postgres LISTEN/NOTIFY for pub/sub
  • →Handle Realtime postgres_changes for client-side events
  • →Verify HMAC-SHA256 signatures for inbound webhooks
  • →Implement idempotency for webhook event handling

How it works

The skill uses database triggers with `pg_net` or `LISTEN/NOTIFY` to send events, and Edge Functions or Realtime for event reception and processing.

Inputs & outputs

You give it
Supabase database events (INSERT/UPDATE/DELETE)
You get back
Processed webhook events, client-side event subscriptions, or backend pub/sub messages

When to use supabase-webhooks-events

  • →Setting up database webhooks
  • →Implementing signature verification
  • →Configuring pg_net triggers
  • →Handling Realtime event streams

About this skill

Supabase Webhooks and Database Events

Overview

Choose Database Webhooks/pg_net for configured outbound HTTP, LISTEN/NOTIFY for lightweight database notifications, or Realtime Postgres Changes for UI updates. These mechanisms have different durability, authentication, replay and failure contracts. This skill's concrete signed receiver illustrates accepted inbox INGESTION, not complete business processing or exactly-once delivery.

Prerequisites

  • A reviewed producer/receiver contract and intended project identity
  • Reviewed migrations, endpoint configuration and secret provisioning
  • A durable producer event ID/outbox if reliable signed ingestion is required
  • An explicitly authorized deployment workflow; reading this skill deploys nothing

Authentication

Native Database Webhooks send the HTTP headers you configure. They do not implicitly generate the custom HMAC protocol below. Do not send a project service-role key to an arbitrary outbound URL as a generic webhook secret. Use a receiver-specific credential or the documented intended gateway identity, kept in an appropriate secret store, with minimal capability and rotation scope.

For the application-owned HMAC example, the sender and receiver BOTH implement the exact raw-byte and timestamp contract. Missing receiver configuration, invalid signature, stale/future timestamp or malformed input is rejected before inbox insertion. Timestamp freshness alone is not durable replay prevention.

The gateway and handler must agree: a JWT-protected Edge Function needs the actual supported gateway authentication identity; an HMAC-only endpoint requires a consciously configured dedicated route that permits that sender and enforces HMAC inside the handler. Do not blindly disable JWT checks on other functions or claim that HMAC headers satisfy JWT verification. A receiver's server-only database key is not an outbound sender credential and must never appear in delivery headers.

Instructions

Step 1: Select One Delivery Contract

Inventory the event source, authorized endpoint, payload fields, producer identity, retries, timeout, dead-letter path and protected evidence. Review any trigger SQL before applying it. A Database Webhook payload (type, table, record, old_record) is not automatically the custom signed inbox envelope. The legacy Database Webhook reference describes transport mechanics; its SQL alone does not provide this custom signature/outbox guarantee. Do not connect an unsigned trigger to the signed receiver and weaken verification to make it pass.

Step 2: Authenticate and Persist an Inbox Record

Use the bounded receiver and explicit inbox schema with the matching sender/verifier. The producer supplies a unique event ID for each distinct event and retains it across retries. The receiver authenticates raw bytes before strict JSON/schema validation, then attempts one unique-key insert. No SELECT-then-side-effect-INSERT sequence and no row-ID/type-derived deduplication key is used.

202 means accepted into the inbox, with processingComplete: false. 409 means the ID already exists and requires producer-receipt reconciliation, not proof of completed effects or identical payload. A lost response after commit requires reconciliation of that SAME ID. Build a separate authorized worker with durable lease/retry/dead-letter and effect-idempotency semantics before enabling business actions. No executable business stub is supplied here.

Step 3: Treat Notifications as Hints, Not Durable Work Completion

LISTEN/NOTIFY is not a persistent queue. Its payload size has a strict byte limit; oversized payloads fail rather than being safely truncated. Send minimal IDs and re-read authorized state. Realtime subscriptions similarly need correct user/RLS and publication setup plus reconciliation after reconnect. Do not log changed rows or infer guaranteed event recovery from a successful subscription.

See notification and Realtime mechanics, reviewing authentication, lifecycle cleanup and evidence boundaries for the actual application before adopting any example.

Output

  • Explicit transport and authentication contracts, with native/custom boundaries
  • Unique producer event IDs and durable accepted-inbox receipts
  • Separate worker/retry/reconciliation requirements and unresolved processing state
  • Operational evidence without payloads, tokens or secret headers

Error Handling

ObservationRequired check
HTTP 401/403Match actual gateway and handler authentication; never bypass verification to resolve it
Missing HMAC configurationFail closed; do not insert or acknowledge acceptance
Duplicate event IDReconcile durable producer/inbox receipts; do not invent a new ID for the retry
Inbox error/timeoutNo completed-effects claim; reconcile possible commit before retry
Realtime silenceCheck identity, policies, publication, connectivity and reconciliation
NOTIFY oversizeReduce to IDs; no truncation guarantee

Examples

Resources

Next Steps

Review worker authorization, durable delivery/processing receipts, replay horizons and failure recovery before enabling side effects or claiming production readiness.

Prerequisites

Supabase project with `supabase` CLI installed`pg_net` extension enabled@supabase/supabase-js v2+ installedEdge Functions deployed for webhook receiver patterns

Limitations

  • →NOTIFY payload truncated if it exceeds 8000 bytes

How it compares

This provides production-ready patterns for event-driven architectures, unlike basic webhook setup.

Compared to similar skills

supabase-webhooks-events side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
supabase-webhooks-events (this skill)14moCautionAdvanced
local-cluster-manager24moReviewIntermediate
create-example07moReviewAdvanced
comparing-database-schemas14moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore →

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry