Skip to content

Commit af5ea89

Browse files
committed
Copy updates
1 parent ffdfe05 commit af5ea89

File tree

2 files changed

+36
-7
lines changed

2 files changed

+36
-7
lines changed

docs/guides/frameworks/supabase-edge-functions-basic.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Your new `edge-function-trigger` edge function is now ready to trigger your `hel
239239

240240
</Step>
241241

242-
<Step title="Deploy your hello-world task">
242+
<Step title="Deploy your 'Hello World' task">
243243

244244
Deploy your `hello-world` task to [Trigger.dev cloud](https://cloud.trigger.dev).
245245

@@ -273,7 +273,7 @@ Once loaded you should see ‘OK’ on the new screen.
273273

274274
The task will be triggered when your edge function URL is accessed.
275275

276-
Check the terminal to see if the task has run. You can also check the [cloud.trigger.dev](http://cloud.trigger.dev) dashboard for any successful runs.
276+
Check your [cloud.trigger.dev](http://cloud.trigger.dev) dashboard and you should see a succesful `hello-world` task.
277277

278278
**Congratulations, you have run a simple Hello World task from a Supabase edge function!**
279279

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

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,17 @@ Replace the `database-webhook` placeholder code with the following:
118118
```ts database-webhook/index.ts
119119
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
120120
import { tasks } from "npm:@trigger.dev/[email protected]/v3";
121-
// Import your task type from your /trigger folder
122-
import type { helloWorldTask } from "../../../src/trigger/example.ts";
121+
import { helloWorldTask } from "../../../src/trigger/example.ts";
122+
123+
console.log("Hello from 'database-webhook' function!");
123124

124125
Deno.serve(async (req) => {
125-
// @ts-expect-error: Ignoring Task type mismatch and RunHandle incompatibility
126-
await tasks.trigger<typeof helloWorldTask>("database-webhook", "hello");
127-
return new Response("OK");
126+
const payload = await req.json();
127+
128+
await tasks.trigger<typeof helloWorldTask>("hello-world", "hello");
129+
console.log(payload ?? "No name provided");
130+
131+
return new Response("ok");
128132
});
129133
```
130134

@@ -173,6 +177,29 @@ Call the hook `edge-function-hook`:
173177
[How to configure the webhook]()
174178

175179
</Step>
180+
181+
<Step title="Deploy your 'Hello World' task">
182+
183+
Go back to your project and deploy your `hello-world` task to [Trigger.dev cloud](https://cloud.trigger.dev).
184+
185+
<CodeGroup>
186+
187+
```bash npm
188+
npx trigger.dev@beta deploy
189+
```
190+
191+
```bash pnpm
192+
pnpm dlx trigger.dev@beta deploy
193+
```
194+
195+
```bash yarn
196+
yarn dlx trigger.dev@beta deploy
197+
```
198+
199+
</CodeGroup>
200+
201+
</Step>
202+
176203
<Step title="Trigger your new database webhook edge function">
177204

178205
Go back to your Supabase dashboard, click on 'Table Editor' in the left-hand menu, and then click on the `skynet` table.
@@ -185,6 +212,8 @@ Go back to your edge function dashboard, and you should see a new run of your ed
185212

186213
[How to view the logs]()
187214

215+
Check your [cloud.trigger.dev](http://cloud.trigger.dev) dashboard and you should see a succesful `hello-world` task.
216+
188217
Congratulations, you have successfully triggered a task from a Supabase edge function using a database webhook!
189218

190219
</Step>

0 commit comments

Comments
 (0)