You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/frameworks/supabase-edge-functions-database-webhooks.mdx
+12-13Lines changed: 12 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ First, go to your Trigger.dev project and copy the `prod` secret key from the AP
105
105
106
106

107
107
108
-
Then, in Supabase, navigate to your settings page, click 'Edge functions' in the configurations menu, and then click the 'Add new secret' button.
108
+
Then, in Supabase, navigate to your 'Project settings' page, click 'Edge functions' in the configurations menu, and then click the 'Add new secret' button.
109
109
110
110
Add `TRIGGER_SECRET_KEY` with the pasted value of your Trigger.dev `prod` secret key.
111
111
@@ -115,7 +115,7 @@ Add `TRIGGER_SECRET_KEY` with the pasted value of your Trigger.dev `prod` secret
115
115
116
116
<Steptitle="Create a new edge function using the Supabase CLI">
117
117
118
-
We will call this example edge function `database-webhook`.
118
+
Go back to your project, and create a new edge function. We will call it`database-webhook`.
119
119
120
120
```bash
121
121
supabase functions new database-webhook
@@ -127,7 +127,7 @@ supabase functions new database-webhook
127
127
128
128
Replace the `database-webhook` placeholder code with the following:
<Steptitle="Deploy your edge function using the Supabase CLI">
158
157
159
-
Go back to your project, and deploy your edge function with the following command:
158
+
Now deploy your edge function with the following command:
160
159
161
160
```bash
162
161
supabase functions deploy edge-function-trigger
163
162
```
164
163
165
-
Follow the CLI instructions and once complete you should now see your new edge function deployment in your Supabase edge functions dashboard.
164
+
Follow the CLI instructions and once complete you should see your new edge function deployment in your Supabase edge functions dashboard.
166
165
167
166
</Step>
168
167
169
168
<Steptitle="Create a new database">
170
169
171
-
Next, in your Supabase dashboard, click on 'Table Editor' in the left-hand menu.
170
+
Next, in your Supabase dashboard, click on 'Table Editor' in the left-hand menu and create a new table. In this example we will call our table `skynet`.
171
+
172
172
173
173
[How to create a new table]()
174
174
175
-
Create a new table called `skynet`.
176
175
177
176
Add a new column called `name` with the type `text`.
178
177
@@ -184,17 +183,17 @@ Add a new column called `name` with the type `text`.
184
183
185
184
By default, Supabase edge functions require a JSON Web Token (JWT) in the authorization header. This is to ensure that only authorized users can access your edge functions.
186
185
187
-
Go to your Supabase dashboard, click 'Project settings', 'API' tab, and copy the `anon``public` API key from the table.
186
+
In your Supabase dashboard, click 'Project settings', then the 'API' tab, and copy the `anon``public` API key from the table.
188
187
189
188
[How to find your Supabase API keys]()
190
189
191
-
Then, go to 'Database' in the Supabase dashboard, click on 'Webhooks', and then click 'Create a new hook'.
190
+
Then, go to 'Database' click on 'Webhooks', and then click 'Create a new hook'.
192
191
193
192
[How to create a new webhook]()
194
193
195
194
Call the hook `edge-function-hook`:
196
195
197
-
1. Select the new table you have created: `public``skynet`.
196
+
1. Select the new table you have created: `public``skynet`.
198
197
2. Choose the `insert` event.
199
198
3. Under 'Webhook configuration', select 'Supabase Edge functions'
200
199
4. Under 'Edge function', choose `POST` and select the edge function you have created: `database-webhook`.
0 commit comments