Set up Webhooks in the config file

Open
#1,190 46 comments 36 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
postgresql, typescript
Domain
cli, databases

Research direction

Start by tracing how config.toml is parsed and how project start and database reset flows are implemented. Compare those flows with the current manual database webhook setup, then define the configuration behavior for webhook creation, environment variables, and repeated resets. Done means a project can declare webhooks in config.toml and have them applied consistently on start or reset.

Written by the indexing model from the issue text.

Description

✨ Feature do-not-close supabase/cli

At the moment you have to manually setup database webhooks. You also need to redo the setup when you reset the DB. This becomes a problem when collaborating with others and sharing projects. It make it harder to provide a single command to setup and configure a project locally or remote.

It would be nice to be able to use the config.toml file to define webhooks that are automatically setup when you start or reset a project. Maybe something like this?

[[db.webhooks]]
name = "my_webhook"
table= "auth.users"
operation = ["INSERT", "UPDATE", "DELETE"]
url = "http://localhost:3000/webhook"
params = { key = "value" }
headers = { key = "value" }

You can use SQL to make custom webhooks with triggers. but then you can't easily use environment variables for things like the url, params or headers.

Dominant language
TypeScript
Stars
2.4k
Forks
523
Avg merge
21h 21m
Merged PRs (30d)
253

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/cli

All issues in supabase/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.