From e74e16ab58250c3d5eb272bed503fd40fc1beb28 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:45:40 +0100 Subject: [PATCH 01/18] Added sync env vars docs example --- docs/guides/examples/vercel-sync-env-vars.mdx | 83 +++++++++++++++++++ docs/mint.json | 3 +- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 docs/guides/examples/vercel-sync-env-vars.mdx diff --git a/docs/guides/examples/vercel-sync-env-vars.mdx b/docs/guides/examples/vercel-sync-env-vars.mdx new file mode 100644 index 0000000000..713492e6ec --- /dev/null +++ b/docs/guides/examples/vercel-sync-env-vars.mdx @@ -0,0 +1,83 @@ +--- +title: "Syncing environment variables from your Vercel projects" +sidebarTitle: "Syncing Vercel env vars" +description: "This example demonstrates how to sync environment variables from your Vercel project to Trigger.dev." +--- + +## Overview + +This example shows how to automatically sync environment variables from your Vercel project to Trigger.dev. + +## Build configuration + +To sync environment variables from your Vercel project to Trigger.dev, you'll first need to add this build configuration to your `trigger.config.ts` file. This extension will then automatically run every time you deploy your project. + +This code syncs encrypted environment variables, filtering them based on the current environment (production, preview, or development). + +```ts trigger.config.ts +import { defineConfig } from "@trigger.dev/sdk/v3"; +import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/vercelSyncEnvVars"; + +export default defineConfig({ + build: { + extensions: + extensions: [ + syncVercelEnvVars(), + syncEnvVars(async (ctx) => { + const environmentMap = { + // Account for the different environment names used by Vercel + prod: "production", + staging: "preview", + dev: "development", + } as const; + + const vercelEnvironment = + environmentMap[ctx.environment as keyof typeof environmentMap]; + + const vercelApiUrl = + `https://api.vercel.com/v8/projects/${process.env.VERCEL_PROJECT_ID}/env?decrypt=true`; + + const response = await fetch(vercelApiUrl, { + headers: { + Authorization: `Bearer ${process.env.VERCEL_ACCESS_TOKEN}`, + }, + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const data = await response.json(); + + const filteredEnvs = data.envs + .filter( + (env: { type: string; value: string; target: string[] }) => + env.type === "encrypted" && + env.value && + env.target.includes(vercelEnvironment), + ) + .map((env: { key: string; value: string }) => ({ + name: env.key, + value: env.value, + })); + + return filteredEnvs; + }), + ],, + }, +}); +``` + + + [Build extensions](/config/config-file#extensions) allow you to hook into the build system and + customize the build process or the resulting bundle and container image (in the case of + deploying). You can use pre-built extensions or create your own. + + +## Running the sync operation + +To run the sync operation, simply run the `deploy` command. You should see some output in the console indicating that the environment variables have been synced, and they should now be available in the Trigger.dev dashboard. + +```bash +npx trigger.dev@latest deploy +``` diff --git a/docs/mint.json b/docs/mint.json index a04a4681ee..ecc596c539 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -316,7 +316,8 @@ "guides/examples/supabase-storage-upload", "guides/examples/react-pdf", "guides/examples/resend-email-sequence", - "guides/examples/vercel-ai-sdk" + "guides/examples/vercel-ai-sdk", + "guides/examples/vercel-sync-env-vars" ] }, { From 7e7c02b17c8bd58348d8eda42f9e3767786eb59b Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:52:20 +0100 Subject: [PATCH 02/18] Added links in the config + deploy files --- docs/config/config-file.mdx | 2 +- docs/deploy-environment-variables.mdx | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/config/config-file.mdx b/docs/config/config-file.mdx index 93fe8359a6..0b31a830c1 100644 --- a/docs/config/config-file.mdx +++ b/docs/config/config-file.mdx @@ -471,7 +471,7 @@ These environment variables are only used during the build process and are not e #### syncEnvVars -The `syncEnvVars` build extension replaces the deprecated `resolveEnvVars` export. Check out our [syncEnvVars documentation](/deploy-environment-variables#sync-env-vars-from-another-service) for more information. +The `syncEnvVars` build extension replaces the deprecated `resolveEnvVars` export. Check out our [syncEnvVars documentation](/deploy-environment-variables#sync-env-vars-from-another-service) for more information and example usage (including syncing environment variables from Infisical and Vercel). #### audioWaveform diff --git a/docs/deploy-environment-variables.mdx b/docs/deploy-environment-variables.mdx index d9d510bd8a..5dd0c1fc06 100644 --- a/docs/deploy-environment-variables.mdx +++ b/docs/deploy-environment-variables.mdx @@ -123,6 +123,10 @@ export default defineConfig({ }); ``` +#### Syncing environment variables from Vercel + +Check out our [syncing environment variables from Vercel example](/guides/examples/vercel-sync-env-vars) to see how to automatically sync environment variables from your Vercel projects to Trigger.dev. + #### Deploy When you run the [CLI deploy command](/cli-deploy) directly or using [GitHub Actions](/github-actions) it will sync the environment variables from [Infisical](https://infisical.com) to Trigger.dev. This means they'll appear on the Environment Variables page so you can confirm that it's worked. From ddc6b0f50bc64e14fe2193c5e2310ab73a7fbb1c Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 09:05:27 +0100 Subject: [PATCH 03/18] Updated copy --- docs/deploy-environment-variables.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deploy-environment-variables.mdx b/docs/deploy-environment-variables.mdx index 5dd0c1fc06..cb64ad05b0 100644 --- a/docs/deploy-environment-variables.mdx +++ b/docs/deploy-environment-variables.mdx @@ -125,7 +125,7 @@ export default defineConfig({ #### Syncing environment variables from Vercel -Check out our [syncing environment variables from Vercel example](/guides/examples/vercel-sync-env-vars) to see how to automatically sync environment variables from your Vercel projects to Trigger.dev. +To sync environment variables from your Vercel projects to Trigger.dev, check out our [syncing environment variables from Vercel example](/guides/examples/vercel-sync-env-vars). #### Deploy From e98e70139308484894ab6c78f3e34944e1835840 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 09:50:50 +0100 Subject: [PATCH 04/18] Added vercel docs cards and added them to all of the relevant docs pages --- docs/guides/examples/vercel-ai-sdk.mdx | 4 +++ docs/guides/examples/vercel-sync-env-vars.mdx | 6 +++- docs/guides/frameworks/nextjs-webhooks.mdx | 4 +++ docs/guides/frameworks/nextjs.mdx | 12 ++----- docs/snippets/vercel-docs-cards.mdx | 33 +++++++++++++++++++ 5 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 docs/snippets/vercel-docs-cards.mdx diff --git a/docs/guides/examples/vercel-ai-sdk.mdx b/docs/guides/examples/vercel-ai-sdk.mdx index 755b87859a..db4f7306a5 100644 --- a/docs/guides/examples/vercel-ai-sdk.mdx +++ b/docs/guides/examples/vercel-ai-sdk.mdx @@ -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). @@ -51,3 +53,5 @@ To test this task in the dashboard, you can use the following payload: "prompt": "What is the meaning of life?" } ``` + + diff --git a/docs/guides/examples/vercel-sync-env-vars.mdx b/docs/guides/examples/vercel-sync-env-vars.mdx index 713492e6ec..5fb39ab68d 100644 --- a/docs/guides/examples/vercel-sync-env-vars.mdx +++ b/docs/guides/examples/vercel-sync-env-vars.mdx @@ -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. @@ -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; @@ -81,3 +83,5 @@ To run the sync operation, simply run the `deploy` command. You should see some ```bash npx trigger.dev@latest deploy ``` + + diff --git a/docs/guides/frameworks/nextjs-webhooks.mdx b/docs/guides/frameworks/nextjs-webhooks.mdx index 4581450f9b..fbbfbf30e5 100644 --- a/docs/guides/frameworks/nextjs-webhooks.mdx +++ b/docs/guides/frameworks/nextjs-webhooks.mdx @@ -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) @@ -135,3 +137,5 @@ If you now go to your [Trigger.dev dashboard](https://cloud.trigger.dev), you sh + + diff --git a/docs/guides/frameworks/nextjs.mdx b/docs/guides/frameworks/nextjs.mdx index 6102526e3c..b344e9a245 100644 --- a/docs/guides/frameworks/nextjs.mdx +++ b/docs/guides/frameworks/nextjs.mdx @@ -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"; This guide can be followed for both App and Pages router as well as Server Actions. @@ -254,14 +255,5 @@ Here are the steps to trigger your task in the Next.js App and Pages router and -## Additional resources for Next.js - - - How to create a webhook handler in a Next.js app, and trigger a task from it. - - + diff --git a/docs/snippets/vercel-docs-cards.mdx b/docs/snippets/vercel-docs-cards.mdx new file mode 100644 index 0000000000..5317196fd1 --- /dev/null +++ b/docs/snippets/vercel-docs-cards.mdx @@ -0,0 +1,33 @@ +## Learn more about Vercel and Trigger.dev + +### Walk-through guides from development to deployment + + + + Learn how to setup Trigger.dev with Next.js, using either the pages or app router. + + + + Learn how to create a webhook handler for incoming webhooks in a Next.js app, and trigger a task from it. + + + +### Task examples with code you can copy and paste + + + + Learn how to automatically sync environment variables from your Vercel projects to Trigger.dev. + + + 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. + + From f701ea1eaadd55fe51936a72838e25e2362eea68 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:24:31 +0100 Subject: [PATCH 05/18] Added sync env vars to the intro page --- docs/guides/introduction.mdx | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/guides/introduction.mdx b/docs/guides/introduction.mdx index c2808715ff..62998b9f73 100644 --- a/docs/guides/introduction.mdx +++ b/docs/guides/introduction.mdx @@ -37,20 +37,21 @@ Get set up fast using our detailed walk-through guides. Tasks you can copy and paste to get started with Trigger.dev. They can all be extended and customized to fit your needs. -| Example task | Description | -| :---------------------------------------------------------------------------- | :----------------------------------------------------------------------------- | -| [DALL·E 3 image generation](/guides/examples/dall-e3-generate-image) | Use OpenAI's GPT-4o and DALL·E 3 to generate an image and text. | -| [Deepgram audio transcription](/guides/examples/deepgram-transcribe-audio) | Transcribe audio using Deepgram's speech recognition API. | -| [FFmpeg video processing](/guides/examples/ffmpeg-video-processing) | Use FFmpeg to process a video in various ways and save it to Cloudflare R2. | -| [OpenAI with retrying](/guides/examples/open-ai-with-retrying) | Create a reusable OpenAI task with custom retry options. | -| [PDF to image](/guides/examples/pdf-to-image) | Use `MuPDF` to turn a PDF into images and save them to Cloudflare R2. | -| [React to PDF](/guides/examples/react-pdf) | Use `react-pdf` to generate a PDF and save it to Cloudflare R2. | -| [Puppeteer](/guides/examples/puppeteer) | Use Puppeteer to generate a PDF or scrape a webpage. | -| [Resend email sequence](/guides/examples/resend-email-sequence) | Send a sequence of emails over several days using Resend with Trigger.dev. | -| [Sharp image processing](/guides/examples/sharp-image-processing) | Use Sharp to process an image and save it to Cloudflare R2. | -| [Supabase database operations](/guides/examples/supabase-database-operations) | Run basic CRUD operations on a table in a Supabase database using Trigger.dev. | -| [Supabase Storage upload](/guides/examples/supabase-storage-upload) | Download a video from a URL and upload it to Supabase Storage using S3. | -| [Vercel AI SDK](/guides/examples/vercel-ai-sdk) | Use Vercel AI SDK to generate text using OpenAI. | +| Example task | Description | +| :---------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | +| [DALL·E 3 image generation](/guides/examples/dall-e3-generate-image) | Use OpenAI's GPT-4o and DALL·E 3 to generate an image and text. | +| [Deepgram audio transcription](/guides/examples/deepgram-transcribe-audio) | Transcribe audio using Deepgram's speech recognition API. | +| [FFmpeg video processing](/guides/examples/ffmpeg-video-processing) | Use FFmpeg to process a video in various ways and save it to Cloudflare R2. | +| [OpenAI with retrying](/guides/examples/open-ai-with-retrying) | Create a reusable OpenAI task with custom retry options. | +| [PDF to image](/guides/examples/pdf-to-image) | Use `MuPDF` to turn a PDF into images and save them to Cloudflare R2. | +| [React to PDF](/guides/examples/react-pdf) | Use `react-pdf` to generate a PDF and save it to Cloudflare R2. | +| [Puppeteer](/guides/examples/puppeteer) | Use Puppeteer to generate a PDF or scrape a webpage. | +| [Resend email sequence](/guides/examples/resend-email-sequence) | Send a sequence of emails over several days using Resend with Trigger.dev. | +| [Sharp image processing](/guides/examples/sharp-image-processing) | Use Sharp to process an image and save it to Cloudflare R2. | +| [Supabase database operations](/guides/examples/supabase-database-operations) | Run basic CRUD operations on a table in a Supabase database using Trigger.dev. | +| [Supabase Storage upload](/guides/examples/supabase-storage-upload) | Download a video from a URL and upload it to Supabase Storage using S3. | +| [Vercel AI SDK](/guides/examples/vercel-ai-sdk) | Use Vercel AI SDK to generate text using OpenAI. | +| [Vercel sync environment variables](/guides/examples/vercel-sync-env-vars) | Automatically sync environment variables from your Vercel projects to Trigger.dev. | If you would like to see a guide for your framework, or an example task for your use case, please From f075499f62cfd40a84e0b029ae7296a9de59cf71 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:56:12 +0100 Subject: [PATCH 06/18] Added automatically sync env vars section to nextjs guide --- docs/guides/frameworks/nextjs.mdx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/guides/frameworks/nextjs.mdx b/docs/guides/frameworks/nextjs.mdx index b344e9a245..fa04c24aa8 100644 --- a/docs/guides/frameworks/nextjs.mdx +++ b/docs/guides/frameworks/nextjs.mdx @@ -245,6 +245,32 @@ Here are the steps to trigger your task in the Next.js App and Pages router and +## Automatically sync environment variables from your Vercel project (optional) + +If you want to automatically sync environment variables from your Vercel project to Trigger.dev, you can add our `vercelSyncEnvVars` build extension to your `trigger.config.ts` file. + + + You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass + in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. + + +```ts trigger.config.ts +import { defineConfig } from "@trigger.dev/sdk/v3"; +import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/vercelSyncEnvVars"; + +export default defineConfig({ + project: "", + build: { + extensions: [vercelSyncEnvVars()], + }, +}); +``` + + + For more information, see our [Vercel sync environment + variables](/guides/examples/vercel-sync-env-vars) guide. + + From 21d41f2a79f375943cd8a84d6d71fae27a640a8d Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:56:22 +0100 Subject: [PATCH 07/18] =?UTF-8?q?Added=20=E2=80=98Manually=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/snippets/add-environment-variables.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/snippets/add-environment-variables.mdx b/docs/snippets/add-environment-variables.mdx index b82a6c56fe..349cb5721e 100644 --- a/docs/snippets/add-environment-variables.mdx +++ b/docs/snippets/add-environment-variables.mdx @@ -1,4 +1,4 @@ -## Add your environment variables (optional) +## Manually add your environment variables (optional) If you have any environment variables in your tasks, be sure to add them in the dashboard so deployed code runs successfully. In Node.js, these environment variables are accessed in your code using `process.env.MY_ENV_VAR`. @@ -8,4 +8,4 @@ button. ![Environment variables page](/images/environment-variables-page.jpg) You can add values for your local dev environment, staging and prod. ![Environment variables page](/images/environment-variables-panel.jpg) -You can also add environment variables in code by following the steps on the [Environment Variables page](/deploy-environment-variables#in-your-code). \ No newline at end of file +You can also add environment variables in code by following the steps on the [Environment Variables page](/deploy-environment-variables#in-your-code). From d0fa0451f6bfef8a0596f067c25313098503cf5d Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:56:33 +0100 Subject: [PATCH 08/18] Removed code block and updated title --- docs/guides/examples/vercel-sync-env-vars.mdx | 57 ++++--------------- 1 file changed, 11 insertions(+), 46 deletions(-) diff --git a/docs/guides/examples/vercel-sync-env-vars.mdx b/docs/guides/examples/vercel-sync-env-vars.mdx index 5fb39ab68d..24d2760c5f 100644 --- a/docs/guides/examples/vercel-sync-env-vars.mdx +++ b/docs/guides/examples/vercel-sync-env-vars.mdx @@ -1,6 +1,6 @@ --- title: "Syncing environment variables from your Vercel projects" -sidebarTitle: "Syncing Vercel env vars" +sidebarTitle: "Vercel sync environment variables" description: "This example demonstrates how to sync environment variables from your Vercel project to Trigger.dev." --- @@ -12,60 +12,25 @@ This example shows how to automatically sync environment variables from your Ver ## Build configuration -To sync environment variables from your Vercel project to Trigger.dev, you'll first need to add this build configuration to your `trigger.config.ts` file. This extension will then automatically run every time you deploy your project. +To sync environment variables from your Vercel project to Trigger.dev, you just need to add this build configuration to your `trigger.config.ts` file. This extension will then automatically run every time you deploy your project. This code syncs encrypted environment variables, filtering them based on the current environment (production, preview, or development). + + You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass + in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. + + ```ts trigger.config.ts import { defineConfig } from "@trigger.dev/sdk/v3"; import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/vercelSyncEnvVars"; export default defineConfig({ + project: "", + // Your other config settings... build: { - extensions: - extensions: [ - syncVercelEnvVars(), - syncEnvVars(async (ctx) => { - const environmentMap = { - // Account for the different environment names used by Vercel - prod: "production", - staging: "preview", - dev: "development", - } as const; - - const vercelEnvironment = - environmentMap[ctx.environment as keyof typeof environmentMap]; - - const vercelApiUrl = - `https://api.vercel.com/v8/projects/${process.env.VERCEL_PROJECT_ID}/env?decrypt=true`; - - const response = await fetch(vercelApiUrl, { - headers: { - Authorization: `Bearer ${process.env.VERCEL_ACCESS_TOKEN}`, - }, - }); - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - - const data = await response.json(); - - const filteredEnvs = data.envs - .filter( - (env: { type: string; value: string; target: string[] }) => - env.type === "encrypted" && - env.value && - env.target.includes(vercelEnvironment), - ) - .map((env: { key: string; value: string }) => ({ - name: env.key, - value: env.value, - })); - - return filteredEnvs; - }), - ],, + // Add the vercelSyncEnvVars build extension + extensions: [vercelSyncEnvVars()], }, }); ``` From 08f1ddb2f30d1fc5ac2a3eba06ab8efd58e08abf Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:56:50 +0100 Subject: [PATCH 09/18] updated formatting and added vercelsyncenvvars to the config file --- docs/config/config-file.mdx | 98 +++++++++++++++++++++++++++++-------- 1 file changed, 77 insertions(+), 21 deletions(-) diff --git a/docs/config/config-file.mdx b/docs/config/config-file.mdx index 0b31a830c1..630a43267d 100644 --- a/docs/config/config-file.mdx +++ b/docs/config/config-file.mdx @@ -14,7 +14,7 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ //Your project ref (you can see it on the Project settings page in the dashboard) - project: "proj_gtcwttqhhtlasxgfuhxs", + project: "", //The paths for your trigger folders dirs: ["./trigger"], retries: { @@ -55,7 +55,8 @@ You can add lifecycle functions to get notified when any task starts, succeeds, import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... onSuccess: async (payload, output, { ctx }) => { console.log("Task succeeded", ctx.task.id); }, @@ -87,7 +88,8 @@ import { PrismaInstrumentation } from "@prisma/instrumentation"; import { OpenAIInstrumentation } from "@traceloop/instrumentation-openai"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... instrumentations: [new PrismaInstrumentation(), new OpenAIInstrumentation()], }); ``` @@ -115,7 +117,8 @@ We currently only officially support the `node` runtime, but you can try our exp import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... runtime: "bun", }); ``` @@ -130,7 +133,8 @@ You can specify the default machine for all tasks in your project: import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... defaultMachine: "large-1x", }); ``` @@ -145,7 +149,8 @@ You can set the log level for your project: import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... logLevel: "debug", }); ``` @@ -160,7 +165,8 @@ You can set the default `maxDuration` for all tasks in your project: import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... maxDuration: 60, // 60 seconds }); ``` @@ -175,7 +181,8 @@ You can customize the build process using the `build` option: import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { // Don't bundle these packages external: ["header-generator"], @@ -197,7 +204,8 @@ All code is bundled by default, but you can exclude some packages from the bundl import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { external: ["header-generator"], }, @@ -212,7 +220,8 @@ Each entry in the external should be a package name, not necessarily the import import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { external: ["ai"], }, @@ -232,7 +241,8 @@ You can customize the `jsx` options that are passed to `esbuild` using the `jsx` import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { jsx: { // Use the Fragment component instead of React.Fragment @@ -258,7 +268,8 @@ You can add custom [import conditions](https://esbuild.github.io/api/#conditions import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { conditions: ["react-server"], }, @@ -282,7 +293,8 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; import { additionalFiles } from "@trigger.dev/build/extensions/core"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { extensions: [ additionalFiles({ files: ["wrangler/wrangler.toml", "./assets/**", "./fonts/**"] }), @@ -304,7 +316,8 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; import { additionalPackages } from "@trigger.dev/build/extensions/core"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { extensions: [additionalPackages({ packages: ["wrangler"] })], }, @@ -317,7 +330,8 @@ This allows you to include additional packages in the build that are not automat import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { extensions: [additionalPackages({ packages: ["wrangler@1.19.0"] })], }, @@ -334,6 +348,7 @@ import { emitDecoratorMetadata } from "@trigger.dev/build/extensions/typescript" export default defineConfig({ project: "", + // Your other config settings... build: { extensions: [emitDecoratorMetadata()], }, @@ -365,6 +380,8 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; import { prismaExtension } from "@trigger.dev/build/extensions/prisma"; export default defineConfig({ + project: "", + // Your other config settings... build: { extensions: [ prismaExtension({ @@ -389,6 +406,7 @@ import { prismaExtension } from "@trigger.dev/build/extensions/prisma"; export default defineConfig({ project: "", + // Your other config settings... build: { extensions: [ prismaExtension({ @@ -431,6 +449,7 @@ import { prismaExtension } from "@trigger.dev/build/extensions/prisma"; export default defineConfig({ project: "", + // Your other config settings... build: { extensions: [ prismaExtension({ @@ -451,6 +470,7 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ project: "", + // Your other config settings... build: { extensions: [ prismaExtension({ @@ -471,7 +491,36 @@ These environment variables are only used during the build process and are not e #### syncEnvVars -The `syncEnvVars` build extension replaces the deprecated `resolveEnvVars` export. Check out our [syncEnvVars documentation](/deploy-environment-variables#sync-env-vars-from-another-service) for more information and example usage (including syncing environment variables from Infisical and Vercel). +The `syncEnvVars` build extension replaces the deprecated `resolveEnvVars` export. + +```ts +import { syncEnvVars } from "@trigger.dev/build/extensions/core"; + +export default defineConfig({ + project: "", + // Your other config settings... + build: { + extensions: [syncEnvVars()], + }, +}); +``` + +#### vercelSyncEnvVars + +The `vercelSyncEnvVars` build extension syncs environment variables from your Vercel project to Trigger.dev. + +```ts +import { defineConfig } from "@trigger.dev/sdk/v3"; +import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/vercelSyncEnvVars"; + +export default defineConfig({ + project: "", + // Your other config settings... + build: { + extensions: [vercelSyncEnvVars()], + }, +}); +``` #### audioWaveform @@ -482,7 +531,8 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; import { audioWaveform } from "@trigger.dev/build/extensions/audioWaveform"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { extensions: [audioWaveform()], // uses verson 1.1.0 of audiowaveform by default }, @@ -525,6 +575,7 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; import { ffmpeg } from "@trigger.dev/build/extensions/core"; export default defineConfig({ + project: "", // Your other config settings... build: { extensions: [ffmpeg()], @@ -539,7 +590,8 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; import { ffmpeg } from "@trigger.dev/build/extensions/core"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { extensions: [ffmpeg({ version: "6.0-4" })], }, @@ -561,6 +613,7 @@ import { sentryEsbuildPlugin } from "@sentry/esbuild-plugin"; export default defineConfig({ project: "", + // Your other config settings... build: { extensions: [ esbuildPlugin( @@ -586,7 +639,8 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; import { aptGet } from "@trigger.dev/build/extensions/core"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { extensions: [aptGet({ packages: ["ffmpeg"] })], }, @@ -599,7 +653,8 @@ If you want to install a specific version of a package, you can specify the vers import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { extensions: [aptGet({ packages: ["ffmpeg=6.0-4"] })], }, @@ -646,7 +701,8 @@ Instead of creating this function and worrying about types, you can define an ex import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //..other stuff + project: "", + // Your other config settings... build: { extensions: [ { From 45f3230ef245a1309d64d4d401421ff148b315b0 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:02:48 +0100 Subject: [PATCH 10/18] Added missing comment --- docs/guides/frameworks/nextjs.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/guides/frameworks/nextjs.mdx b/docs/guides/frameworks/nextjs.mdx index fa04c24aa8..66ca5b52d0 100644 --- a/docs/guides/frameworks/nextjs.mdx +++ b/docs/guides/frameworks/nextjs.mdx @@ -260,6 +260,7 @@ import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/vercelSyncEnvVa export default defineConfig({ project: "", + // Your other config settings... build: { extensions: [vercelSyncEnvVars()], }, From 8fbbfd1e50f440837dfc38b987230c85d03c663e Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:05:10 +0100 Subject: [PATCH 11/18] Updated imports to /core --- docs/config/config-file.mdx | 2 +- docs/guides/examples/vercel-sync-env-vars.mdx | 2 +- docs/guides/frameworks/nextjs.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/config/config-file.mdx b/docs/config/config-file.mdx index 630a43267d..7aa1c6dd56 100644 --- a/docs/config/config-file.mdx +++ b/docs/config/config-file.mdx @@ -511,7 +511,7 @@ The `vercelSyncEnvVars` build extension syncs environment variables from your Ve ```ts import { defineConfig } from "@trigger.dev/sdk/v3"; -import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/vercelSyncEnvVars"; +import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/core"; export default defineConfig({ project: "", diff --git a/docs/guides/examples/vercel-sync-env-vars.mdx b/docs/guides/examples/vercel-sync-env-vars.mdx index 24d2760c5f..68a6243b24 100644 --- a/docs/guides/examples/vercel-sync-env-vars.mdx +++ b/docs/guides/examples/vercel-sync-env-vars.mdx @@ -23,7 +23,7 @@ This code syncs encrypted environment variables, filtering them based on the cur ```ts trigger.config.ts import { defineConfig } from "@trigger.dev/sdk/v3"; -import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/vercelSyncEnvVars"; +import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/core"; export default defineConfig({ project: "", diff --git a/docs/guides/frameworks/nextjs.mdx b/docs/guides/frameworks/nextjs.mdx index 66ca5b52d0..850e3c50ca 100644 --- a/docs/guides/frameworks/nextjs.mdx +++ b/docs/guides/frameworks/nextjs.mdx @@ -256,7 +256,7 @@ If you want to automatically sync environment variables from your Vercel project ```ts trigger.config.ts import { defineConfig } from "@trigger.dev/sdk/v3"; -import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/vercelSyncEnvVars"; +import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/core"; export default defineConfig({ project: "", From 99507bad7c360f7e8abbfba675b4151ed9045ec5 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:20:23 +0100 Subject: [PATCH 12/18] Added sync env var docs link and note --- docs/config/config-file.mdx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/config/config-file.mdx b/docs/config/config-file.mdx index 7aa1c6dd56..0d62eaaa11 100644 --- a/docs/config/config-file.mdx +++ b/docs/config/config-file.mdx @@ -491,7 +491,7 @@ These environment variables are only used during the build process and are not e #### syncEnvVars -The `syncEnvVars` build extension replaces the deprecated `resolveEnvVars` export. +The `syncEnvVars` build extension replaces the deprecated `resolveEnvVars` export. Check out our [syncEnvVars documentation](/deploy-environment-variables#sync-env-vars-from-another-service) for more information. ```ts import { syncEnvVars } from "@trigger.dev/build/extensions/core"; @@ -509,6 +509,11 @@ export default defineConfig({ The `vercelSyncEnvVars` build extension syncs environment variables from your Vercel project to Trigger.dev. + + You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass + in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. + + ```ts import { defineConfig } from "@trigger.dev/sdk/v3"; import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/core"; From 478bdc67618a5944ccb428a050a3ebadf6bfbdd9 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:09:46 +0100 Subject: [PATCH 13/18] Improved the VERCEL_ACCESS_TOKEN note --- docs/config/config-file.mdx | 4 +++- docs/guides/examples/vercel-sync-env-vars.mdx | 4 +++- docs/guides/frameworks/nextjs.mdx | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/config/config-file.mdx b/docs/config/config-file.mdx index 0d62eaaa11..040f85c979 100644 --- a/docs/config/config-file.mdx +++ b/docs/config/config-file.mdx @@ -511,7 +511,9 @@ The `vercelSyncEnvVars` build extension syncs environment variables from your Ve You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass - in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. + in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. You can find + / generate the `VERCEL_ACCESS_TOKEN` in your Vercel dashboard under account settings / tokens. + Make sure the scope of the token covers the project you want to sync. ```ts diff --git a/docs/guides/examples/vercel-sync-env-vars.mdx b/docs/guides/examples/vercel-sync-env-vars.mdx index 68a6243b24..9185461897 100644 --- a/docs/guides/examples/vercel-sync-env-vars.mdx +++ b/docs/guides/examples/vercel-sync-env-vars.mdx @@ -18,7 +18,9 @@ This code syncs encrypted environment variables, filtering them based on the cur You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass - in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. + in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. You can find + / generate the `VERCEL_ACCESS_TOKEN` in your Vercel dashboard under account settings / tokens. + Make sure the scope of the token covers the project you want to sync. ```ts trigger.config.ts diff --git a/docs/guides/frameworks/nextjs.mdx b/docs/guides/frameworks/nextjs.mdx index 850e3c50ca..4c2abf6c56 100644 --- a/docs/guides/frameworks/nextjs.mdx +++ b/docs/guides/frameworks/nextjs.mdx @@ -251,7 +251,9 @@ If you want to automatically sync environment variables from your Vercel project You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass - in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. + in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. You can find + / generate the `VERCEL_ACCESS_TOKEN` in your Vercel dashboard under account settings / tokens. + Make sure the scope of the token covers the project you want to sync. ```ts trigger.config.ts From 4224813239cb502f146379f30aeca786f4ff5953 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:15:29 +0100 Subject: [PATCH 14/18] Added link to vercel --- docs/config/config-file.mdx | 5 +++-- docs/guides/examples/vercel-sync-env-vars.mdx | 5 +++-- docs/guides/frameworks/nextjs.mdx | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/config/config-file.mdx b/docs/config/config-file.mdx index 040f85c979..001d21bdb7 100644 --- a/docs/config/config-file.mdx +++ b/docs/config/config-file.mdx @@ -512,8 +512,9 @@ The `vercelSyncEnvVars` build extension syncs environment variables from your Ve You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. You can find - / generate the `VERCEL_ACCESS_TOKEN` in your Vercel dashboard under account settings / tokens. - Make sure the scope of the token covers the project you want to sync. + / generate the `VERCEL_ACCESS_TOKEN` in your Vercel + [dashboard](https://vercel.com/account/settings/tokens). Make sure the scope of the token covers + the project you want to sync. ```ts diff --git a/docs/guides/examples/vercel-sync-env-vars.mdx b/docs/guides/examples/vercel-sync-env-vars.mdx index 9185461897..7815d1534d 100644 --- a/docs/guides/examples/vercel-sync-env-vars.mdx +++ b/docs/guides/examples/vercel-sync-env-vars.mdx @@ -19,8 +19,9 @@ This code syncs encrypted environment variables, filtering them based on the cur You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. You can find - / generate the `VERCEL_ACCESS_TOKEN` in your Vercel dashboard under account settings / tokens. - Make sure the scope of the token covers the project you want to sync. + / generate the `VERCEL_ACCESS_TOKEN` in your Vercel + [dashboard](https://vercel.com/account/settings/tokens). Make sure the scope of the token covers + the project you want to sync. ```ts trigger.config.ts diff --git a/docs/guides/frameworks/nextjs.mdx b/docs/guides/frameworks/nextjs.mdx index 4c2abf6c56..40ed6b55c8 100644 --- a/docs/guides/frameworks/nextjs.mdx +++ b/docs/guides/frameworks/nextjs.mdx @@ -252,8 +252,9 @@ If you want to automatically sync environment variables from your Vercel project You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. You can find - / generate the `VERCEL_ACCESS_TOKEN` in your Vercel dashboard under account settings / tokens. - Make sure the scope of the token covers the project you want to sync. + / generate the `VERCEL_ACCESS_TOKEN` in your Vercel + [dashboard](https://vercel.com/account/settings/tokens). Make sure the scope of the token covers + the project you want to sync. ```ts trigger.config.ts From 2335d266f9ce805e95b1c3e47798e3608e151dee Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:24:07 +0000 Subject: [PATCH 15/18] Updated docs and improved formatting --- docs/guides/examples/vercel-sync-env-vars.mdx | 2 +- docs/guides/frameworks/nextjs.mdx | 19 ++++--------------- docs/guides/introduction.mdx | 2 +- docs/snippets/vercel-docs-cards.mdx | 2 +- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/docs/guides/examples/vercel-sync-env-vars.mdx b/docs/guides/examples/vercel-sync-env-vars.mdx index 7815d1534d..db39542571 100644 --- a/docs/guides/examples/vercel-sync-env-vars.mdx +++ b/docs/guides/examples/vercel-sync-env-vars.mdx @@ -46,7 +46,7 @@ export default defineConfig({ ## Running the sync operation -To run the sync operation, simply run the `deploy` command. You should see some output in the console indicating that the environment variables have been synced, and they should now be available in the Trigger.dev dashboard. +To sync the environment variables, all you need to do is run the `deploy` command. You should see some output in the console indicating that the environment variables have been synced, and they should now be available in your Trigger.dev dashboard. ```bash npx trigger.dev@latest deploy diff --git a/docs/guides/frameworks/nextjs.mdx b/docs/guides/frameworks/nextjs.mdx index 0a8bc6f82e..8cd8ac1583 100644 --- a/docs/guides/frameworks/nextjs.mdx +++ b/docs/guides/frameworks/nextjs.mdx @@ -281,12 +281,6 @@ export default defineConfig({ ## Troubleshooting & extra resources - - - - - - ### Revalidation from your Trigger.dev tasks [Revalidation](https://vercel.com/docs/incremental-static-regeneration/quickstart#on-demand-revalidation) allows you to purge the cache for an ISR route. To revalidate an ISR route from a Trigger.dev task, you have to set up a handler for the `revalidate` event. This is an API route that you can add to your Next.js app. @@ -431,14 +425,9 @@ You can test your revalidation task in the Trigger.dev dashboard on the testing } ``` -## Additional resources for Next.js - - - How to create a webhook handler in a Next.js app, and trigger a task from it. - + + + + diff --git a/docs/guides/introduction.mdx b/docs/guides/introduction.mdx index 5839ec3d83..df3f7239bd 100644 --- a/docs/guides/introduction.mdx +++ b/docs/guides/introduction.mdx @@ -54,8 +54,8 @@ Tasks you can copy and paste to get started with Trigger.dev. They can all be ex | [Sharp image processing](/guides/examples/sharp-image-processing) | Use Sharp to process an image and save it to Cloudflare R2. | | [Supabase database operations](/guides/examples/supabase-database-operations) | Run basic CRUD operations on a table in a Supabase database using Trigger.dev. | | [Supabase Storage upload](/guides/examples/supabase-storage-upload) | Download a video from a URL and upload it to Supabase Storage using S3. | -| [Vercel sync environment variables](/guides/examples/vercel-sync-env-vars) | Automatically sync environment variables from your Vercel projects to Trigger.dev. | | [Vercel AI SDK](/guides/examples/vercel-ai-sdk) | Use Vercel AI SDK to generate text using OpenAI. | +| [Vercel sync environment variables](/guides/examples/vercel-sync-env-vars) | Automatically sync environment variables from your Vercel projects to Trigger.dev. | If you would like to see a guide for your framework, or an example task for your use case, please diff --git a/docs/snippets/vercel-docs-cards.mdx b/docs/snippets/vercel-docs-cards.mdx index 5317196fd1..afc45ded47 100644 --- a/docs/snippets/vercel-docs-cards.mdx +++ b/docs/snippets/vercel-docs-cards.mdx @@ -16,7 +16,7 @@ -### Task examples with code you can copy and paste +### Task examples Date: Mon, 4 Nov 2024 14:28:53 +0000 Subject: [PATCH 16/18] Copy tweaks --- docs/guides/examples/vercel-sync-env-vars.mdx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/guides/examples/vercel-sync-env-vars.mdx b/docs/guides/examples/vercel-sync-env-vars.mdx index db39542571..8908d7ee28 100644 --- a/docs/guides/examples/vercel-sync-env-vars.mdx +++ b/docs/guides/examples/vercel-sync-env-vars.mdx @@ -12,16 +12,14 @@ This example shows how to automatically sync environment variables from your Ver ## Build configuration -To sync environment variables from your Vercel project to Trigger.dev, you just need to add this build configuration to your `trigger.config.ts` file. This extension will then automatically run every time you deploy your project. - -This code syncs encrypted environment variables, filtering them based on the current environment (production, preview, or development). +To sync environment variables, you just need to add our build extension to your `trigger.config.ts` file. This extension will then automatically run every time you deploy your Trigger.dev project. - You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass - in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. You can find - / generate the `VERCEL_ACCESS_TOKEN` in your Vercel + You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables in the + Trigger.dev dashboard, or pass in the token and project ID as arguments to the `vercelSyncEnvVars` + build extension. You can find / generate the `VERCEL_ACCESS_TOKEN` in your Vercel [dashboard](https://vercel.com/account/settings/tokens). Make sure the scope of the token covers - the project you want to sync. + the project with the environment variables you want to sync. ```ts trigger.config.ts @@ -46,7 +44,7 @@ export default defineConfig({ ## Running the sync operation -To sync the environment variables, all you need to do is run the `deploy` command. You should see some output in the console indicating that the environment variables have been synced, and they should now be available in your Trigger.dev dashboard. +To sync the environment variables, all you need to do is run our `deploy` command. You should see some output in the console indicating that the environment variables have been synced, and they should now be available in your Trigger.dev dashboard. ```bash npx trigger.dev@latest deploy From 9c402e0f4f10ae0602ce537e4af7ae25c90ee335 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:34:50 +0000 Subject: [PATCH 17/18] Added space --- docs/config/config-file.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config/config-file.mdx b/docs/config/config-file.mdx index 001d21bdb7..dfc95fcb1c 100644 --- a/docs/config/config-file.mdx +++ b/docs/config/config-file.mdx @@ -13,7 +13,7 @@ The `trigger.config.ts` file is used to configure your Trigger.dev project. It i import { defineConfig } from "@trigger.dev/sdk/v3"; export default defineConfig({ - //Your project ref (you can see it on the Project settings page in the dashboard) + // Your project ref (you can see it on the Project settings page in the dashboard) project: "", //The paths for your trigger folders dirs: ["./trigger"], From d3f6993fc25c972608b9ab3a37e97afcb4ce7c51 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:40:12 +0000 Subject: [PATCH 18/18] Updated deploy docs --- docs/deploy-environment-variables.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deploy-environment-variables.mdx b/docs/deploy-environment-variables.mdx index cb64ad05b0..3f67a5bb6a 100644 --- a/docs/deploy-environment-variables.mdx +++ b/docs/deploy-environment-variables.mdx @@ -125,7 +125,7 @@ export default defineConfig({ #### Syncing environment variables from Vercel -To sync environment variables from your Vercel projects to Trigger.dev, check out our [syncing environment variables from Vercel example](/guides/examples/vercel-sync-env-vars). +To sync environment variables from your Vercel projects to Trigger.dev, you can use our build extension. Check out our [syncing environment variables from Vercel guide](/guides/examples/vercel-sync-env-vars). #### Deploy