Skip to content

Commit 2e273e8

Browse files
committed
Updated vercel env vars instructions and naming
1 parent a5d59de commit 2e273e8

File tree

5 files changed

+35
-28
lines changed

5 files changed

+35
-28
lines changed

docs/config/config-file.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -505,27 +505,28 @@ export default defineConfig({
505505
});
506506
```
507507

508-
#### vercelSyncEnvVars
508+
#### syncVercelEnvVars
509509

510-
The `vercelSyncEnvVars` build extension syncs environment variables from your Vercel project to Trigger.dev.
510+
The `syncVercelEnvVars` build extension syncs environment variables from your Vercel project to Trigger.dev.
511511

512512
<Note>
513513
You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass
514-
in the token and project ID as arguments to the `vercelSyncEnvVars` build extension. If you're
515-
working with a team project, you'll also need to set `VERCEL_TEAM_ID`. You can find / generate
516-
the `VERCEL_ACCESS_TOKEN` in your Vercel [dashboard](https://vercel.com/account/settings/tokens).
517-
Make sure the scope of the token covers the project you want to sync.
514+
in the token and project ID as arguments to the `syncVercelEnvVars` build extension. If you're
515+
working with a team project, you'll also need to set `VERCEL_TEAM_ID`, which can be found in your
516+
team settings. You can find / generate the `VERCEL_ACCESS_TOKEN` in your Vercel
517+
[dashboard](https://vercel.com/account/settings/tokens). Make sure the scope of the token covers
518+
the project with the environment variables you want to sync.
518519
</Note>
519520

520521
```ts
521522
import { defineConfig } from "@trigger.dev/sdk/v3";
522-
import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/core";
523+
import { syncVercelEnvVars } from "@trigger.dev/build/extensions/core";
523524

524525
export default defineConfig({
525526
project: "<project ref>",
526527
// Your other config settings...
527528
build: {
528-
extensions: [vercelSyncEnvVars()],
529+
extensions: [syncVercelEnvVars()],
529530
},
530531
});
531532
```

docs/guides/examples/vercel-sync-env-vars.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ import VercelDocsCards from "/snippets/vercel-docs-cards.mdx";
1111
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.
1212

1313
<Note>
14-
You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables in the
15-
Trigger.dev dashboard, or pass in the token and project ID as arguments to the `vercelSyncEnvVars`
16-
build extension. If you're working with a team project, you'll also need to set `VERCEL_TEAM_ID`.
17-
You can find / generate the `VERCEL_ACCESS_TOKEN` in your Vercel
14+
You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass
15+
in the token and project ID as arguments to the `syncVercelEnvVars` build extension. If you're
16+
working with a team project, you'll also need to set `VERCEL_TEAM_ID`, which can be found in your
17+
team settings. You can find / generate the `VERCEL_ACCESS_TOKEN` in your Vercel
1818
[dashboard](https://vercel.com/account/settings/tokens). Make sure the scope of the token covers
1919
the project with the environment variables you want to sync.
2020
</Note>
2121

2222
```ts trigger.config.ts
2323
import { defineConfig } from "@trigger.dev/sdk/v3";
24-
import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/core";
24+
import { syncVercelEnvVars } from "@trigger.dev/build/extensions/core";
2525

2626
export default defineConfig({
2727
project: "<project ref>",
2828
// Your other config settings...
2929
build: {
30-
// Add the vercelSyncEnvVars build extension
31-
extensions: [vercelSyncEnvVars()],
30+
// Add the syncVercelEnvVars build extension
31+
extensions: [syncVercelEnvVars()],
3232
},
3333
});
3434
```

docs/guides/frameworks/nextjs.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,25 +247,26 @@ Here are the steps to trigger your task in the Next.js App and Pages router and
247247

248248
## Automatically sync environment variables from your Vercel project (optional)
249249

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.
250+
If you want to automatically sync environment variables from your Vercel project to Trigger.dev, you can add our `syncVercelEnvVars` build extension to your `trigger.config.ts` file.
251251

252252
<Note>
253253
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. If you're
255-
working with a team project, you'll also need to set `VERCEL_TEAM_ID`. You can find / generate
256-
the `VERCEL_ACCESS_TOKEN` in your Vercel [dashboard](https://vercel.com/account/settings/tokens).
257-
Make sure the scope of the token covers the project you want to sync.
254+
in the token and project ID as arguments to the `syncVercelEnvVars` build extension. If you're
255+
working with a team project, you'll also need to set `VERCEL_TEAM_ID`, which can be found in your
256+
team settings. You can find / generate the `VERCEL_ACCESS_TOKEN` in your Vercel
257+
[dashboard](https://vercel.com/account/settings/tokens). Make sure the scope of the token covers
258+
the project with the environment variables you want to sync.
258259
</Note>
259260

260261
```ts trigger.config.ts
261262
import { defineConfig } from "@trigger.dev/sdk/v3";
262-
import { vercelSyncEnvVars } from "@trigger.dev/build/extensions/core";
263+
import { syncVercelEnvVars } from "@trigger.dev/build/extensions/core";
263264

264265
export default defineConfig({
265266
project: "<project ref>",
266267
// Your other config settings...
267268
build: {
268-
extensions: [vercelSyncEnvVars()],
269+
extensions: [syncVercelEnvVars()],
269270
},
270271
});
271272
```

packages/build/src/extensions/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export * from "./core/additionalPackages.js";
33
export * from "./core/syncEnvVars.js";
44
export * from "./core/aptGet.js";
55
export * from "./core/ffmpeg.js";
6-
export * from "./core/vercelSyncEnvVars.js";
6+
export * from "./core/syncVercelEnvVars.js";

packages/build/src/extensions/core/vercelSyncEnvVars.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { BuildExtension } from "@trigger.dev/core/v3/build";
22
import { syncEnvVars } from "../core.js";
33

4-
export function vercelSyncEnvVars(
5-
options?: { projectId?: string; vercelAccessToken?: string; vercelTeamId?: string },
4+
export function syncVercelEnvVars(
5+
options?: {
6+
projectId?: string;
7+
vercelAccessToken?: string;
8+
vercelTeamId?: string;
9+
},
610
): BuildExtension {
711
const sync = syncEnvVars(async (ctx) => {
812
const projectId = options?.projectId ?? process.env.VERCEL_PROJECT_ID ??
@@ -15,13 +19,13 @@ export function vercelSyncEnvVars(
1519

1620
if (!projectId) {
1721
throw new Error(
18-
"vercelSyncEnvVars: you did not pass in a projectId or set the VERCEL_PROJECT_ID env var.",
22+
"syncVercelEnvVars: you did not pass in a projectId or set the VERCEL_PROJECT_ID env var.",
1923
);
2024
}
2125

2226
if (!vercelAccessToken) {
2327
throw new Error(
24-
"vercelSyncEnvVars: you did not pass in a vercelAccessToken or set the VERCEL_ACCESS_TOKEN env var.",
28+
"syncVercelEnvVars: you did not pass in a vercelAccessToken or set the VERCEL_ACCESS_TOKEN env var.",
2529
);
2630
}
2731

@@ -41,7 +45,8 @@ export function vercelSyncEnvVars(
4145
}
4246
const params = new URLSearchParams({ decrypt: "true" });
4347
if (vercelTeamId) params.set("teamId", vercelTeamId);
44-
const vercelApiUrl = `https://api.vercel.com/v8/projects/${projectId}/env?${params}`;
48+
const vercelApiUrl =
49+
`https://api.vercel.com/v8/projects/${projectId}/env?${params}`;
4550

4651
try {
4752
const response = await fetch(vercelApiUrl, {

0 commit comments

Comments
 (0)