Agent skill

Supabase Webhooks Events

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Implement Supabase database webhooks, pgnet async HTTP, LISTEN/NOTIFY, and Edge Function event handlers with signature verification.

MITAuto-check passedBackend & APIs

Install Supabase Webhooks Events

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-webhooks-events -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-webhooks-events --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/supabase-webhooks-events .claude/skills/supabase-webhooks-events && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
supabase-webhooks-events
GitHub stars
2.8k
Token cost
~2.2k tokens
SKILL.md length
665 words
Files
8 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Implement Supabase database webhooks, pgnet async HTTP, LISTEN/NOTIFY, and Edge Function event handlers with signature verification.

  • Works in 3 steps: Database Webhooks with pg_net and… → Edge Function Webhook Receivers with… → Postgres LISTEN/NOTIFY and Realtime as…
  • Setting up database webhooks for INSERT/UPDATE/DELETE events
  • SKILL.md covers Overview, Prerequisites, Authentication and Instructions, plus 5 more sections
  • Calls supabase; needs WEBHOOK_SECRET

What it does

Supabase Webhooks Events is an agent skill from jeremylongshore/tons-of-skills-marketplace. Implement Supabase database webhooks, pgnet 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 postgreschanges as an event source, or building event-driven architectures. Trigger with phrases like "supabase webhook", "database events", "pgnet trigger", "supabase LISTEN NOTIFY", "webhook signature verify", "supabase event-driven"…

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/database-webhooks.md`, `references/edge-function-receivers.md` and `references/errors.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Webhooks and Event-driven systems. It works with Supabase and PostgreSQL. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Setting up database webhooks for INSERT/UPDATE/DELETE events
  • Sending HTTP requests from PostgreSQL triggers
  • Handling Realtime postgreschanges as an event source
  • Building event-driven architectures

Example prompts

  • “supabase webhook”
  • “database events”
  • “pgnet trigger”
  • “/supabase-webhooks-events”

Requirements

  • Node.js
  • A credential in WEBHOOK_SECRET
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Write, Bash(supabase:*), Bash(curl:*), Bash(psql:*)

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Database Webhooks with pg_net and Trigger Functions
  2. Edge Function Webhook Receivers with Signature Verification
  3. Postgres LISTEN/NOTIFY and Realtime as Event Source

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Write
    • Bash(supabase:*)
    • Bash(curl:*)
    • Bash(psql:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • supabase

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • supabase.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • WEBHOOK_SECRET

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Supabase Webhooks Events loads about 2.2k tokens when it runs, and up to ~8.6k if it reads all its reference files. Until then it costs about 142 tokens; SKILL.md has 665 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~142
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 665 words, ~2,195 tokens.

Download SKILL.mdSave it as .claude/skills/supabase-webhooks-events/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
supabase-webhooks-events
description
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".
allowed-tools
Write, Bash(supabase:*), Bash(curl:*), Bash(psql:*)
compatibility
Designed for Claude Code
version
1.54.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, supabase, webhooks, events, triggers, pg_net, realtime

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

Authentication

Both directions of a webhook are authenticated:

  • Outbound (trigger → Edge Function): the trigger sends an Authorization: Bearer <service_role_key> header. Store the key in a Postgres setting (app.settings.service_role_key) or Supabase Vault — never inline it in a committed migration.
  • Inbound (Edge Function receiver): verify an HMAC-SHA256 signature against a shared WEBHOOK_SECRET (read from Deno.env) using a constant-time comparison, and reject mismatches with 401. See signature-verification.md.

Instructions

Pick the mechanism that fits the consumer: pg_net triggers for server-side HTTP fan-out, Edge Function receivers for signed processing, LISTEN/NOTIFY for in-database pub/sub, and Realtime for client UI. Write each SQL trigger to a supabase/migrations/ file and each handler to supabase/functions/<name>/index.ts, then apply and deploy with the supabase CLI.

Step 1 — Database Webhooks with pg_net and Trigger Functions

Enable pg_net, then write a trigger function that POSTs the changed row to an Edge Function. Attach it AFTER INSERT/UPDATE/DELETE. Full trigger set (conditional status-change trigger, the supabase_functions.http_request() built-in helper, and net._http_response inspection queries) is in database-webhooks.md.

sql
CREATE EXTENSION IF NOT EXISTS pg_net WITH SCHEMA extensions;

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('Content-Type', 'application/json'),
    body    := jsonb_build_object('type', TG_OP, 'record', row_to_json(NEW)::jsonb)
  );
  RETURN NEW;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;

CREATE TRIGGER on_order_created
  AFTER INSERT ON public.orders
  FOR EACH ROW EXECUTE FUNCTION public.notify_order_created();
Step 2 — Edge Function Webhook Receivers with Signature Verification

Write an Edge Function that reads the raw body, verifies the HMAC signature, parses the typed payload, and routes by event type. Guard against duplicate delivery with a processed_events idempotency table. The complete receiver, the idempotent-handler variant, and the idempotency table DDL are in edge-function-receivers.md.

typescript
// supabase/functions/on-order-created/index.ts
serve(async (req) => {
  const rawBody = await req.text();
  const secret = Deno.env.get("WEBHOOK_SECRET");
  if (secret) {
    const sig = req.headers.get("x-webhook-signature") ?? "";
    if (!(await verifySignature(rawBody, sig, secret)))
      return new Response(JSON.stringify({ error: "Invalid signature" }), { status: 401 });
  }
  const payload = JSON.parse(rawBody); // { type, table, record, old_record }
  // route by payload.type: INSERT | UPDATE | DELETE
  return new Response(JSON.stringify({ received: true }));
});
Step 3 — Postgres LISTEN/NOTIFY and Realtime as Event Source

Use pg_notify from a trigger for lightweight, non-persistent pub/sub consumed by a backend LISTEN; use Realtime postgres_changes for client-side UI subscriptions (keep NOTIFY payloads to IDs — they truncate past 8000 bytes). The backend listener, the full Realtime subscription with event routing, and the combined event-driven architecture diagram are in listen-notify-realtime.md.

typescript
const channel = supabase
  .channel("orders-events")
  .on("postgres_changes",
    { event: "*", schema: "public", table: "orders" },
    (payload) => console.log(payload.eventType, payload.new))
  .subscribe();

Output

These patterns produce:

  • Database trigger functions calling Edge Functions via pg_net on row changes
  • Conditional triggers that fire only when specific columns change
  • Edge Function webhook receivers with HMAC signature verification
  • Idempotent event processing preventing duplicate side effects
  • LISTEN/NOTIFY channels for lightweight inter-service communication
  • Realtime subscriptions for live client-side UI updates
  • An event-driven architecture combining server and client patterns
Show full SKILL.md (250 more words)Show less

Error Handling

ErrorCauseFix
pg_net returns 404Edge Function not deployed or wrong URLRun supabase functions deploy <name> and verify the URL matches
Webhook not firingTrigger not attached or table not in publicationCheck SELECT * FROM pg_trigger WHERE tgrelid = 'orders'::regclass;
Duplicate events processedNo idempotency layerAdd processed_events table with unique event_id constraint
Realtime not receivingTable not added to Realtime publicationDashboard > Database > Replication > enable the table
net._http_response shows 401Invalid or missing auth headerVerify service_role_key is set in app.settings or vault
NOTIFY payload truncatedPayload exceeds 8000 bytesSend only IDs in NOTIFY, fetch full record in the listener
Auth hook errorsFunction raises exceptionCheck Dashboard > Logs > Auth; ensure function returns valid JSONB
Trigger silently failsSECURITY DEFINER without search_pathAdd SET search_path = public, extensions; to function

Examples

Resources

Next Steps

For performance optimization of triggers and queries, see supabase-performance-tuning. For production hardening including RLS policies on webhook-accessed tables, see supabase-security-basics.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in skills/.curated/supabase-webhooks-events of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/database-webhooks.md
  • references/edge-function-receivers.md
  • references/errors.md
  • references/event-handler-pattern.md
  • references/examples.md
  • references/listen-notify-realtime.md
  • references/signature-verification.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Supabase Webhooks Events next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Supabase Webhooks Events compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Supabase Webhooks Events this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.2kAutomated safety check: PassMIT
Supabase Development and Debuggingsupabase/agent-skills2.7k3 repos~3.6kAutomated safety check: PassMIT
Stripe Projectsfossasia/eventyay1.7k5 repos~2kAutomated safety check: NotesApache-2.0
Supabasecurvenote/curvenote1705 repos~2.2kAutomated safety check: PassCustom licence
Golivemikehasa/golive-skill1.3k—~13kAutomated safety check: NotesMIT
Windmill Trigger Type Checklistwindmill-labs/windmill18k—~4.7kAutomated safety check: PassCustom licence

Similar skills

  • Official

    General Supabase skill for database, auth, Edge Functions, Realtime and storage work, plus client libraries, migrations, security audits, debugging and reading logs.

    2.7k GitHub starsUsed in 3 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • Stripe Projects

    fossasia/eventyay

    A skill your agent uses when the user wants to provision infrastructure or third-party services using Stripe Projects.

    1.7k GitHub starsUsed in 5 repos~2k tokens
    Backend & APIsAuto-check: notes
  • Supabase

    curvenote/curvenote

    A skill your agent uses when doing ANY task involving Supabase.

    170 GitHub starsUsed in 5 repos~2.2k tokens
    Backend & APIsAuto-check passed
  • Golive

    mikehasa/golive-skill

    Take an agent-written app from repo to live production on the user's OWN accounts, with providers they choose (hosting, database, auth, payments, email, domain/DNS).

    1.3k GitHub stars~13k tokensUpdated 7 days ago
    Backend & APIsAuto-check: notes
  • Windmill Trigger Type Checklist

    windmill-labs/windmill

    Checklist of every backend, frontend, CLI and capture change needed to add a new TriggerCrud-based trigger type, such as Azure, GCP or Kafka, to Windmill.

    18k GitHub stars~4.7k tokensUpdated today
    Backend & APIsAuto-check passed
  • Nubase

    OtterMind/Nubase

    A skill your agent uses when the user mentions Nubase broadly, wants a backend for an AI-generated app, or needs to deploy/publish generated code online — across Database, Auth, Storage, Assets…

    622 GitHub stars~2.2k tokensUpdated 13 days ago
    Backend & APIsAuto-check: notes

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Supabase Webhooks Events

What does Supabase Webhooks Events do?

Implement Supabase database webhooks, pgnet async HTTP, LISTEN/NOTIFY, and Edge Function event handlers with signature verification. Supabase Webhooks Events is an agent skill from jeremylongshore/tons-of-skills-marketplace. Implement Supabase database webhooks, pgnet async HTTP, LISTEN/NOTIFY, and Edge Function event handlers with signature verification.

When should I use Supabase Webhooks Events?

Supabase Webhooks Events fits situations like: setting up database webhooks for INSERT/UPDATE/DELETE events; sending HTTP requests from PostgreSQL triggers; handling Realtime postgreschanges as an event source; building event-driven architectures.

How do I install Supabase Webhooks Events in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-webhooks-events -a claude-code`. Or copy the skill folder (skills/.curated/supabase-webhooks-events in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/supabase-webhooks-events in your project. Claude Code loads it when a task matches its description.

How do I install Supabase Webhooks Events in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-webhooks-events -a codex`. Or copy the skill folder (skills/.curated/supabase-webhooks-events in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/supabase-webhooks-events in your project. Codex loads it when a task matches its description.

Can I use Supabase Webhooks Events in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-webhooks-events -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/supabase-webhooks-events, .gemini/skills/supabase-webhooks-events, .github/skills/supabase-webhooks-events and .opencode/skills/supabase-webhooks-events in your project.

What does Supabase Webhooks Events need to run?

Going by SKILL.md and its folder, Supabase Webhooks Events needs the command-line tools its instructions call (supabase) and credentials named WEBHOOK_SECRET. Our summary lists: Node.js; A credential in WEBHOOK_SECRET. Its frontmatter pre-approves these tools: Write, Bash(supabase:*), Bash(curl:*), Bash(psql:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Supabase Webhooks Events access the network?

SKILL.md names 1 domain. As links in the text: supabase.com. This is read from the text; nothing was executed.

Is Supabase Webhooks Events safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Supabase Webhooks Events use?

Supabase Webhooks Events is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Supabase Webhooks Events use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.4k tokens, read only when the agent opens those files.

What are the alternatives to Supabase Webhooks Events?

Skills that share tags, products or a category with Supabase Webhooks Events: Supabase Development and Debugging (supabase/agent-skills, 2.7k stars), Stripe Projects (fossasia/eventyay, 1.7k stars), Supabase (curvenote/curvenote, 170 stars) and Golive (mikehasa/golive-skill, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Supabase Webhooks Events?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.