Database Webhooks and Edge Functions

preview_player
Показать описание
Edge Functions are now integrated with Database Webhooks[0] in the Supabase Dashboard. Using the UI, you can now easily trigger Edge Functions in real-time when there are changes to your Database tables.

## Chapters

00:00 Database Webhooks Intro
00:48 Create a Database Webhook Handler
02:14 Deploy Edge Function with JWT verification
03:22 Create a Database Webhook
04:48 Attach Authorization Header to Webhook
05:50 Trigger INSERT Database Webhook
06:28 Generate Webhook Payload Types
07:40 Generate TypeScript Types from Database

## About Edgy Edge Functions

Edgy Edge Functions is a video series where we explore Supabase Edge Functions[1] and Deno[2] functionality and features.

If there's something you'd like to learn about, please open an issue[3] and let me know on this Tweet thread[4].

Thanks for stopping by! Denosaur and I will see you soon \o/

Рекомендации по теме
Комментарии
Автор

This is the first source of information I found that explained how to protect a webhook url from non authorized webhook calls. Thank you!!

AnotherLeetcode
Автор

Amazing presenters of Supabase very informative videos!
Would you PLEASE make a video explaining best practices for handling time + timezones in & out of Supabase ?

If you could add some specifics regarding Flutterflow and how it handles the issue - and how the two could come together - apart from helping my particular non coder situation could be the ONE video on the internet that shows best practices and rules to handle the "time" issue once and for all.
PLEASE! 🤞 😅 🤕

loucasi
Автор

This is nice for trigger on each row.

Wish there was an easy way to do it for each statement and pass all newly inserted data as part of the POST body through the webhook UI.


It's already possible through creating a trigger with transition tables from SQL editor for a table, then creating a function that uses pg_net and setting custom body for POST request.

We first need support for creating triggers with transition tables as part of the database triggers ui to support this.

ajaychandrasekaran
Автор

Not sure I understand how the anon public key enforces authorization?
Anyone can access it and therefore anyone can trigger this edge function.

strangeQuirks
Автор

How do you manage the anon key when calling the function in the webhook when they are different between the local environment and the remote environment? I don't want to disable jwt-verification.

jetshu
Автор

Is this a real-time database or Postgres database? Does database web hooks work with both types?

timmanning
Автор

How is the email sending that you comment should be done? I found no information about it

sweeterasmus
Автор

Is there a sort of queuing ? Imagine, I insert 100 000 lines, are 100, 000 functions going to be launched at the same time?

OlivierMARTINEAU
Автор

I followed the SQL code on the docs to create a webhook that triggers an API. My problem is string concatenation don't work at API endpoint. I tried using NEW.column_name to get record which just added since my webhook listens for inserts but the code SQL compiler keeps giving a syntax error

carlafuh
Автор

the payload always returns undefined for me. Im using it on a table with multiple rows, web hook triggers on update. Any ideas why the body is failing to be passed in? I have the application/json header.

trevorwelsh
Автор

but this webhooks doesn't make any sense, if I make insert\update\delete into table more then 1 row in one time (insert many, update many), functions won't execute at all. they only handle one table changes per one moment

yourpc
Автор

I might be super wrong here, but isn't it a security issue to be able to pull all the database tables out of a project's id?
Can't you check someone's project id via dev tools?
Awesome video, regardless :)
Thank you very much!

YaronLavi
Автор

How the you avoid the red squiggly lines that appear when you import a deno package?

jobiej