Skip to content

Commit

Permalink
Added vercel docs cards and added them to all of the relevant docs pages
Browse files Browse the repository at this point in the history
  • Loading branch information
D-K-P committed Oct 23, 2024
1 parent 9341e95 commit e98e701
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
4 changes: 4 additions & 0 deletions docs/guides/examples/vercel-ai-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ sidebarTitle: "Vercel AI SDK"
description: "This example demonstrates how to use the Vercel AI SDK with Trigger.dev."
---

import VercelDocsCards from "/snippets/vercel-docs-cards.mdx";

## Overview

The [Vercel AI SDK](https://www.npmjs.com/package/ai) is a simple way to use AI models from many different providers, including OpenAI, Microsoft Azure, Google Generative AI, Anthropic, Amazon Bedrock, Groq, Perplexity and [more](https://sdk.vercel.ai/providers/ai-sdk-providers).
Expand Down Expand Up @@ -51,3 +53,5 @@ To test this task in the dashboard, you can use the following payload:
"prompt": "What is the meaning of life?"
}
```

<VercelDocsCards />
6 changes: 5 additions & 1 deletion docs/guides/examples/vercel-sync-env-vars.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ sidebarTitle: "Syncing Vercel env vars"
description: "This example demonstrates how to sync environment variables from your Vercel project to Trigger.dev."
---

import VercelDocsCards from "/snippets/vercel-docs-cards.mdx";

## Overview

This example shows how to automatically sync environment variables from your Vercel project to Trigger.dev.
Expand All @@ -26,7 +28,7 @@ export default defineConfig({
syncEnvVars(async (ctx) => {
const environmentMap = {
// Account for the different environment names used by Vercel
prod: "production",
prod: "production",
staging: "preview",
dev: "development",
} as const;
Expand Down Expand Up @@ -81,3 +83,5 @@ To run the sync operation, simply run the `deploy` command. You should see some
```bash
npx trigger.dev@latest deploy
```

<VercelDocsCards />
4 changes: 4 additions & 0 deletions docs/guides/frameworks/nextjs-webhooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ sidebarTitle: "Next.js webhooks"
description: "Learn how to trigger a task from a webhook in a Next.js app."
---

import VercelDocsCards from "/snippets/vercel-docs-cards.mdx";

## Prerequisites

- [A Next.js project, set up with Trigger.dev](/guides/frameworks/nextjs)
Expand Down Expand Up @@ -135,3 +137,5 @@ If you now go to your [Trigger.dev dashboard](https://cloud.trigger.dev), you sh
</Step>

</Steps>

<VercelDocsCards />
12 changes: 2 additions & 10 deletions docs/guides/frameworks/nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import NextjsTroubleshootingButtonSyntax from "/snippets/nextjs-button-syntax.md
import WorkerFailedToStartWhenRunningDevCommand from "/snippets/worker-failed-to-start.mdx";
import AddEnvironmentVariables from "/snippets/add-environment-variables.mdx";
import DeployingYourTask from "/snippets/deplopying-your-task.mdx";
import VercelDocsCards from "/snippets/vercel-docs-cards.mdx";

<Note>This guide can be followed for both App and Pages router as well as Server Actions.</Note>

Expand Down Expand Up @@ -254,14 +255,5 @@ Here are the steps to trigger your task in the Next.js App and Pages router and
<NextjsTroubleshootingButtonSyntax/>
<WorkerFailedToStartWhenRunningDevCommand/>

## Additional resources for Next.js

<Card
title="Next.js - triggering tasks using webhooks"
icon="N"
href="/guides/frameworks/nextjs-webhooks"
>
How to create a webhook handler in a Next.js app, and trigger a task from it.
</Card>

<VercelDocsCards />
<UsefulNextSteps />
33 changes: 33 additions & 0 deletions docs/snippets/vercel-docs-cards.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Learn more about Vercel and Trigger.dev

### Walk-through guides from development to deployment

<CardGroup cols={2}>
<Card title="Next.js - setup guide" icon="N" href="/guides/frameworks/nextjs">
Learn how to setup Trigger.dev with Next.js, using either the pages or app router.
</Card>

<Card
title="Next.js - triggering tasks using webhooks"
icon="N"
href="/guides/frameworks/nextjs-webhooks"
>
Learn how to create a webhook handler for incoming webhooks in a Next.js app, and trigger a task from it.
</Card>
</CardGroup>

### Task examples with code you can copy and paste

<CardGroup cols={2}>
<Card
title="Vercel sync environment variables"
icon="code"
href="/guides/examples/vercel-sync-env-vars"
>
Learn how to automatically sync environment variables from your Vercel projects to Trigger.dev.
</Card>
<Card title="Vercel AI SDK" icon="code" href="/guides/examples/vercel-ai-sdk">
Learn how to use the Vercel AI SDK, which is a simple way to use AI models from different
providers, including OpenAI, Anthropic, Amazon Bedrock, Groq, Perplexity etc.
</Card>
</CardGroup>

0 comments on commit e98e701

Please sign in to comment.