Skip to content

Commit abd3dfe

Browse files
committed
Copy updates
1 parent 781284f commit abd3dfe

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

docs/guides/frameworks/supabase-edge-functions-database-webhooks.mdx

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,24 @@ Install the "Hello World" example task when prompted. We'll use this task to tes
9595
<CliViewRunStep />
9696
</Steps>
9797

98-
## Create and deploy a new Supabase edge function and database webhook
98+
## Create and deploy a new Supabase edge function and database webhook
9999

100100
<Steps>
101101

102+
<Step title="Add your Trigger.dev prod secret key in Supabase">
103+
104+
First, go to your Trigger.dev project and copy the `prod` secret key from the API keys page.
105+
106+
![How to find your prod secret key](/images/api-key-prod.png)
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.
109+
110+
Add `TRIGGER_SECRET_KEY` with the pasted value of your Trigger.dev `prod` secret key.
111+
112+
![Add secret key in Supabase](/images/supabase-keys-1.png)
113+
114+
</Step>
115+
102116
<Step title="Create a new edge function using the Supabase CLI">
103117

104118
We will call this example edge function `database-webhook`.
@@ -116,6 +130,7 @@ Replace the `database-webhook` placeholder code with the following:
116130
```ts database-webhook/index.ts
117131
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
118132
import { tasks } from "npm:@trigger.dev/[email protected]/v3";
133+
// Import your task type from your /trigger folder
119134
import { helloWorldTask } from "../../../src/trigger/example.ts";
120135

121136
console.log("Hello from 'database-webhook' function!");
@@ -139,23 +154,37 @@ Deno.serve(async (req) => {
139154

140155
</Step>
141156

157+
<Step title="Deploy your edge function using the Supabase CLI">
158+
159+
Go back to your project, and deploy your edge function with the following command:
160+
161+
```bash
162+
supabase functions deploy edge-function-trigger
163+
```
164+
165+
Follow the CLI instructions and once complete you should now see your new edge function deployment in your Supabase edge functions dashboard.
166+
167+
</Step>
168+
142169
<Step title="Create a new database">
143170

144-
In your Supabase dashboard, click on 'Table Editor' in the left-hand menu.
171+
Next, in your Supabase dashboard, click on 'Table Editor' in the left-hand menu.
145172

146173
[How to create a new table]()
147174

148175
Create a new table called `skynet`.
149176

150177
Add a new column called `name` with the type `text`.
151178

179+
[How to add a new column]()
180+
152181
</Step>
153182

154183
<Step title="Configure JWT settings">
155184

156185
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.
157186

158-
First, go to your Supabase dashboard, click 'Project settings', 'API' tab, and copy the `anon` `public` API key from the table.
187+
Go to your Supabase dashboard, click 'Project settings', 'API' tab, and copy the `anon` `public` API key from the table.
159188

160189
[How to find your Supabase API keys]()
161190

0 commit comments

Comments
 (0)