Skip to content

Commit f075499

Browse files
committed
Added automatically sync env vars section to nextjs guide
1 parent f701ea1 commit f075499

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/guides/frameworks/nextjs.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,32 @@ Here are the steps to trigger your task in the Next.js App and Pages router and
245245

246246
</Tabs>
247247

248+
## Automatically sync environment variables from your Vercel project (optional)
249+
250+
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.
251+
252+
<Note>
253+
You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass
254+
in the token and project ID as arguments to the `vercelSyncEnvVars` build extension.
255+
</Note>
256+
257+
```ts trigger.config.ts
258+
import { defineConfig } from "@trigger.dev/sdk/v3";
259+
import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/vercelSyncEnvVars";
260+
261+
export default defineConfig({
262+
project: "<project ref>",
263+
build: {
264+
extensions: [vercelSyncEnvVars()],
265+
},
266+
});
267+
```
268+
269+
<Note>
270+
For more information, see our [Vercel sync environment
271+
variables](/guides/examples/vercel-sync-env-vars) guide.
272+
</Note>
273+
248274
<AddEnvironmentVariables />
249275

250276
<DeployingYourTask />

0 commit comments

Comments
 (0)