Skip to content

Commit 511a24b

Browse files
committed
Supabase docs improvements
1 parent 7ca2b62 commit 511a24b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ import "jsr:@supabase/functions-js/edge-runtime.d.ts";
6666
import { tasks } from "npm:@trigger.dev/sdk@<your-sdk-version>/v3";
6767
// Import your task type from your /trigger folder
6868
import type { helloWorldTask } from "../../../src/trigger/example.ts";
69+
// 👆 **type-only** import
6970

7071
Deno.serve(async () => {
7172
await tasks.trigger<typeof helloWorldTask>(

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ import "jsr:@supabase/functions-js/edge-runtime.d.ts";
7777
import { tasks } from "npm:@trigger.dev/sdk@<your-sdk-version>/v3";
7878
// Import your task type from your /trigger folder
7979
import type { helloWorldTask } from "../../../src/trigger/example.ts";
80+
// 👆 **type-only** import
8081

8182
console.log("Hello from 'database-webhook' function!");
8283

@@ -87,8 +88,8 @@ Deno.serve(async (req) => {
8788
await tasks.trigger<typeof helloWorldTask>(
8889
// Your task id
8990
"hello-world",
90-
// Your task payload
91-
"hello from a Supabase Edge Function!"
91+
// Your task payload. This will be the data you receive from the database webhook
92+
payload
9293
);
9394
return new Response("ok");
9495
});
@@ -222,6 +223,8 @@ Go back to your edge function dashboard <Icon icon="circle-1" iconType="solid" s
222223

223224
Then, check your [cloud.trigger.dev](http://cloud.trigger.dev) project 'Runs' list <Icon icon="circle-1" iconType="solid" size={20} color="A8FF53" /> and you should see a successful `hello-world` task <Icon icon="circle-2" iconType="solid" size={20} color="A8FF53" /> which has been triggered when you added a new row with the `name` `Sarah Connor` to your `skynet` Supabase table.
224225

226+
Inside that run you will see the payload that was sent from the database webhook, including the `name` and other table information.
227+
225228
![How to insert a new row 2](/images/supabase-trigger-screenshot.png)
226229

227230
**Congratulations, you have successfully triggered a task from a Supabase edge function using a database webhook!**

docs/snippets/supabase-prerequisites.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Both of these files are required for the Trigger.dev SDK to work correctly.
2727
{
2828
"devDependencies": {
2929
// This should be the version of typescript you are using
30-
"typescript": "^5.3.3"
30+
"typescript": "^5.6.2"
3131
}
3232
}
3333
```

0 commit comments

Comments
 (0)