Skip to content

Commit 25c7ff1

Browse files
authored
Updated guides intro and side menu (#1398)
* Updated intro and moved stripe webhooks into the webhooks section * Added additional resources links to nextjs and remix * Updated intro page * Changed formatting to improve layout * Removed Supabase card from frameworks
1 parent a6dbf84 commit 25c7ff1

File tree

6 files changed

+77
-50
lines changed

6 files changed

+77
-50
lines changed

docs/guides/examples/stripe-webhook.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Trigger a task from Stripe webhook events"
3-
sidebarTitle: "Stripe webhook"
3+
sidebarTitle: "Stripe webhooks"
44
description: "This example demonstrates how to handle Stripe webhook events using Trigger.dev."
55
---
66

docs/guides/frameworks/nextjs.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,24 @@ Here are the steps to trigger your task in the Next.js App and Pages router and
244244

245245
</Tabs>
246246

247-
<AddEnvironmentVariables/>
247+
<AddEnvironmentVariables />
248248

249-
<DeployingYourTask/>
249+
<DeployingYourTask />
250250

251251
## Troubleshooting
252252

253253
<NextjsTroubleshootingMissingApiKey/>
254254
<NextjsTroubleshootingButtonSyntax/>
255255
<WorkerFailedToStartWhenRunningDevCommand/>
256256

257+
## Additional resources for Next.js
258+
259+
<Card
260+
title="Next.js - triggering tasks using webhooks"
261+
icon="N"
262+
href="/guides/frameworks/nextjs-webhooks"
263+
>
264+
How to create a webhook handler in a Next.js app, and trigger a task from it.
265+
</Card>
266+
257267
<UsefulNextSteps />

docs/guides/frameworks/remix.mdx

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ description: "This guide will show you how to setup Trigger.dev in your existing
55
icon: "r"
66
---
77

8-
import Prerequisites from '/snippets/framework-prerequisites.mdx';
9-
import CliInitStep from '/snippets/step-cli-init.mdx';
10-
import CliDevStep from '/snippets/step-cli-dev.mdx';
11-
import CliRunTestStep from '/snippets/step-run-test.mdx';
12-
import CliViewRunStep from '/snippets/step-view-run.mdx';
13-
import UsefulNextSteps from '/snippets/useful-next-steps.mdx';
8+
import Prerequisites from "/snippets/framework-prerequisites.mdx";
9+
import CliInitStep from "/snippets/step-cli-init.mdx";
10+
import CliDevStep from "/snippets/step-cli-dev.mdx";
11+
import CliRunTestStep from "/snippets/step-run-test.mdx";
12+
import CliViewRunStep from "/snippets/step-view-run.mdx";
13+
import UsefulNextSteps from "/snippets/useful-next-steps.mdx";
1414
import TriggerTaskRemix from "/snippets/trigger-tasks-remix.mdx";
1515
import AddEnvironmentVariables from "/snippets/add-environment-variables.mdx";
1616
import DeployingYourTask from "/snippets/deplopying-your-task.mdx";
@@ -20,10 +20,10 @@ import DeployingYourTask from "/snippets/deplopying-your-task.mdx";
2020
## Initial setup
2121

2222
<Steps>
23-
<CliInitStep />
24-
<CliDevStep />
25-
<CliRunTestStep />
26-
<CliViewRunStep />
23+
<CliInitStep />
24+
<CliDevStep />
25+
<CliRunTestStep />
26+
<CliViewRunStep />
2727
</Steps>
2828

2929
## Set your secret key locally
@@ -40,27 +40,24 @@ For more information on authenticating with Trigger.dev, see the [API keys page]
4040

4141
<Step title="Create an API route">
4242

43-
Create a new file called `api.hello-world.ts` (or `api.hello-world.js`) in the `app/routes` directory like this: `app/routes/api.hello-world.ts`.
43+
Create a new file called `api.hello-world.ts` (or `api.hello-world.js`) in the `app/routes` directory like this: `app/routes/api.hello-world.ts`.
4444

4545
</Step>
4646

4747
<Step title="Add your task">
4848

49-
Add this code to your `api.hello-world.ts` file which imports your task:
49+
Add this code to your `api.hello-world.ts` file which imports your task:
5050

51-
```ts app/routes/api.hello-world.ts
52-
import type { helloWorldTask } from "../../src/trigger/example";
53-
import { tasks } from "@trigger.dev/sdk/v3";
51+
```ts app/routes/api.hello-world.ts
52+
import type { helloWorldTask } from "../../src/trigger/example";
53+
import { tasks } from "@trigger.dev/sdk/v3";
5454

55-
export async function loader() {
56-
const handle = await tasks.trigger<typeof helloWorldTask>(
57-
"hello-world",
58-
"James"
59-
);
55+
export async function loader() {
56+
const handle = await tasks.trigger<typeof helloWorldTask>("hello-world", "James");
6057

61-
return new Response(JSON.stringify(handle), {
62-
headers: { "Content-Type": "application/json" },
63-
});
58+
return new Response(JSON.stringify(handle), {
59+
headers: { "Content-Type": "application/json" },
60+
});
6461
}
6562
```
6663

@@ -74,13 +71,14 @@ For more information on authenticating with Trigger.dev, see the [API keys page]
7471

7572
</Steps>
7673

77-
<AddEnvironmentVariables/>
74+
<AddEnvironmentVariables />
7875

79-
<DeployingYourTask/>
76+
<DeployingYourTask />
8077

8178
## Deploying to Vercel Edge Functions
8279

8380
Before we start, it's important to note that:
81+
8482
- We'll be using a type-only import for the task to ensure compatibility with the edge runtime.
8583
- The `@trigger.dev/sdk/v3` package supports the edge runtime out of the box.
8684

@@ -104,10 +102,7 @@ export const config = {
104102
export async function action({ request }: { request: Request }) {
105103
// This is where you'd authenticate the request
106104
const payload = await request.json();
107-
const handle = await tasks.trigger<typeof helloWorldTask>(
108-
"hello-world",
109-
payload
110-
);
105+
const handle = await tasks.trigger<typeof helloWorldTask>("hello-world", payload);
111106
return new Response(JSON.stringify(handle), {
112107
headers: { "Content-Type": "application/json" },
113108
});
@@ -155,7 +150,6 @@ Push your code to a Git repository and create a new project in the Vercel dashbo
155150

156151
</Step>
157152

158-
159153
<Step title="Add your Vercel environment variables">
160154

161155
In the Vercel project settings, add your Trigger.dev secret key:
@@ -174,7 +168,10 @@ You can find this key in the Trigger.dev dashboard under API Keys and select the
174168

175169
Once you've added the environment variable, deploy your project to Vercel.
176170

177-
<Note>Ensure you have also deployed your Trigger.dev task. See [deploy your task step](/guides/frameworks/remix#deploying-your-task-to-trigger-dev).</Note>
171+
<Note>
172+
Ensure you have also deployed your Trigger.dev task. See [deploy your task
173+
step](/guides/frameworks/remix#deploying-your-task-to-trigger-dev).
174+
</Note>
178175

179176
</Step>
180177

@@ -200,5 +197,14 @@ The `vercel-build` script in `package.json` is specific to Remix projects on Ver
200197

201198
The `runtime: "edge"` configuration in the API route allows for better performance on Vercel's Edge Network.
202199

200+
## Additional resources for Remix
201+
202+
<Card
203+
title="Remix - triggering tasks using webhooks"
204+
icon="R"
205+
href="/guides/frameworks/remix-webhooks"
206+
>
207+
How to create a webhook handler in a Remix app, and trigger a task from it.
208+
</Card>
203209

204210
<UsefulNextSteps />

docs/guides/frameworks/webhooks-guides-overview.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ A webhook handler is code that executes in response to an event. They can be end
2727
>
2828
How to create a webhook handler in a Remix app, and trigger a task from it.
2929
</Card>
30+
<Card title="Stripe webhooks" icon="webhook" href="/guides/examples/stripe-webhook">
31+
How to create a Stripe webhook handler and trigger a task when a 'checkout session completed'
32+
event is received.
33+
</Card>
34+
<Card
35+
title="Supabase database webhooks guide"
36+
icon="webhook"
37+
href="/guides/frameworks/supabase-edge-functions-database-webhooks"
38+
>
39+
Learn how to trigger a task from a Supabase edge function when an event occurs in your database.
40+
</Card>
3041
</CardGroup>
31-
32-
<Note>
33-
If you would like to see a webhook guide for your framework, please request it in our [Discord
34-
server](https://trigger.dev/discord).
35-
</Note>

docs/guides/introduction.mdx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@ import CardSupabase from "/snippets/card-supabase.mdx";
1717
<CardNodejs />
1818
<CardNextjs />
1919
<CardRemix />
20-
<CardSupabase />
2120
</CardGroup>
2221

2322
## Guides
2423

2524
Get set up fast using our detailed walk-through guides.
2625

27-
| Guide | Description |
28-
| :----------------------------------------------------------------------------------------- | :------------------------------------------------------------ |
29-
| [Prisma](/guides/frameworks/prisma) | How to setup Prisma with Trigger.dev |
30-
| [Sequin database triggers](/guides/frameworks/sequin) | How to trigger tasks from database changes using Sequin |
31-
| [Supabase edge function hello world](/guides/frameworks/supabase-edge-functions-basic) | How to trigger a task from a Supabase edge function |
32-
| [Supabase database webhooks](/guides/frameworks/supabase-edge-functions-database-webhooks) | How to trigger a task using a Supabase database webhook |
33-
| [Webhooks](/guides/frameworks/webhooks-guides-overview) | How to setup webhooks with Trigger.dev and various frameworks |
26+
| Guide | Description |
27+
| :----------------------------------------------------------------------------------------- | :------------------------------------------------ |
28+
| [Prisma](/guides/frameworks/prisma) | How to setup Prisma with Trigger.dev |
29+
| [Sequin database triggers](/guides/frameworks/sequin) | Trigger tasks from database changes using Sequin |
30+
| [Supabase edge function hello world](/guides/frameworks/supabase-edge-functions-basic) | Trigger tasks from Supabase edge function |
31+
| [Supabase database webhooks](/guides/frameworks/supabase-edge-functions-database-webhooks) | Trigger tasks using Supabase database webhooks |
32+
| [Using webhooks in Next.js](/guides/frameworks/nextjs-webhooks) | Trigger tasks from a webhook in Next.js |
33+
| [Using webhooks in Remix](/guides/frameworks/remix-webhooks) | Trigger tasks from a webhook in Remix |
34+
| [Stripe webhooks](/guides/examples/stripe-webhook) | Trigger tasks from incoming Stripe webhook events |
3435

3536
## Example tasks
3637

@@ -47,7 +48,11 @@ Tasks you can copy and paste to get started with Trigger.dev. They can all be ex
4748
| [Puppeteer](/guides/examples/puppeteer) | Use Puppeteer to generate a PDF or scrape a webpage. |
4849
| [Resend email sequence](/guides/examples/resend-email-sequence) | Send a sequence of emails over several days using Resend with Trigger.dev. |
4950
| [Sharp image processing](/guides/examples/sharp-image-processing) | Use Sharp to process an image and save it to Cloudflare R2. |
50-
| [Stripe webhook](/guides/examples/stripe-webhook) | Trigger a task from Stripe webhook events. |
5151
| [Supabase database operations](/guides/examples/supabase-database-operations) | Run basic CRUD operations on a table in a Supabase database using Trigger.dev. |
5252
| [Supabase Storage upload](/guides/examples/supabase-storage-upload) | Download a video from a URL and upload it to Supabase Storage using S3. |
5353
| [Vercel AI SDK](/guides/examples/vercel-ai-sdk) | Use Vercel AI SDK to generate text using OpenAI. |
54+
55+
<Note>
56+
If you would like to see a guide for your framework, or an example task for your use case, please
57+
request it in our [Discord server](https://trigger.dev/discord) and we'll add it to the list.
58+
</Note>

docs/mint.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@
293293
"pages": [
294294
"guides/frameworks/webhooks-guides-overview",
295295
"guides/frameworks/nextjs-webhooks",
296-
"guides/frameworks/remix-webhooks"
296+
"guides/frameworks/remix-webhooks",
297+
"guides/examples/stripe-webhook"
297298
]
298299
}
299300
]
@@ -308,7 +309,6 @@
308309
"guides/examples/pdf-to-image",
309310
"guides/examples/puppeteer",
310311
"guides/examples/sharp-image-processing",
311-
"guides/examples/stripe-webhook",
312312
"guides/examples/supabase-database-operations",
313313
"guides/examples/supabase-storage-upload",
314314
"guides/examples/react-pdf",

0 commit comments

Comments
 (0)