How to send database webhook to discord with supabase
how do i add my json body? like this example for a webhook https://gist.github.com/Birdie0/78ee79402a4301b1faf412ab5f1cdcf9#example-for-a-webhook
Gist
How to use Discord Webhooks
How to use Discord Webhooks. GitHub Gist: instantly share code, notes, and snippets.

6 Replies
When you set up the Webhook in Supabase, you choose the database table that it "listens" to. When a new row is inserted (or updated, if you've set it up that way), the contents of that row are sent as the body of the webhook as JSON.
oh okay, that tells me its not possible to send a custom message to discord when a row gets inserted, or should i try with a custom trigger?
Yes, just use a trigger with the http or pg_net extension.
where do i see the functions error log `?
my function definition looks like this
i have linked it to a trigger, but it does not send any webhook to my discord channel
@garyaustin
The logs for functions are in the Postgres logs.
You can use
raise log 'say something and var = %',var;
between begin and end to debug a bit.This shows using jsonb for the values not text or strings...
