Skip to content

Commit 102e614

Browse files
committed
docs: tidy up sync env vars note blocks
1 parent 71279a7 commit 102e614

File tree

1 file changed

+55
-44
lines changed

1 file changed

+55
-44
lines changed

docs/config/extensions/syncEnvVars.mdx

Lines changed: 55 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,40 @@ export default defineConfig({
7171

7272
The `syncVercelEnvVars` build extension syncs environment variables from your Vercel project to Trigger.dev.
7373

74-
<Note>
75-
You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass
76-
in the token and project ID as arguments to the `syncVercelEnvVars` build extension. If you're
77-
working with a team project, you'll also need to set `VERCEL_TEAM_ID`, which can be found in your
78-
team settings. You can find / generate the `VERCEL_ACCESS_TOKEN` in your Vercel
79-
[dashboard](https://vercel.com/account/settings/tokens). Make sure the scope of the token covers
80-
the project with the environment variables you want to sync.
81-
</Note>
82-
83-
<Note>
84-
When running the build from a Vercel build environment (e.g., during a Vercel deployment), the
85-
environment variable values will be read from `process.env` instead of fetching them from the
86-
Vercel API. This is determined by checking if the `VERCEL` environment variable is present. The
87-
API is still used to determine which environment variables are configured for your project, but
88-
the actual values come from the local environment. Reading values from `process.env` allows the
89-
extension to use values that Vercel integrations (such as the Neon integration) set per preview
90-
deployment in the "Provisioning Integrations" phase that happens just before the Vercel build
91-
starts.
92-
</Note>
93-
94-
<Note>
95-
If you have the Neon database Vercel integration installed and are running builds outside of the
96-
Vercel environment, we recommend using `syncNeonEnvVars` in addition to `syncVercelEnvVars` for your
97-
database environment variables. This ensures that the correct database connection strings are used for your
98-
selected environment and current branch, as `syncVercelEnvVars` may not accurately reflect
99-
branch-specific database credentials when run locally.
100-
</Note>
74+
<AccordionGroup>
75+
<Accordion title="Setting up authentication including team projects">
76+
You need to set the `VERCEL_ACCESS_TOKEN` and `VERCEL_PROJECT_ID` environment variables, or pass
77+
in the token and project ID as arguments to the `syncVercelEnvVars` build extension. If you're
78+
working with a team project, you'll also need to set `VERCEL_TEAM_ID`, which can be found in your
79+
team settings.
80+
81+
You can find / generate the `VERCEL_ACCESS_TOKEN` in your Vercel
82+
[dashboard](https://vercel.com/account/settings/tokens). Make sure the scope of the token covers
83+
the project with the environment variables you want to sync.
84+
</Accordion>
85+
86+
<Accordion title="Running in Vercel build environment">
87+
When running the build from a Vercel build environment (e.g., during a Vercel deployment), the
88+
environment variable values will be read from `process.env` instead of fetching them from the
89+
Vercel API. This is determined by checking if the `VERCEL` environment variable is present.
90+
91+
The API is still used to determine which environment variables are configured for your project, but
92+
the actual values come from the local environment. Reading values from `process.env` allows the
93+
extension to use values that Vercel integrations (such as the Neon integration) set per preview
94+
deployment in the "Provisioning Integrations" phase that happens just before the Vercel build
95+
starts.
96+
</Accordion>
97+
98+
<Accordion title="Using with Neon database Vercel integration">
99+
If you have the Neon database Vercel integration installed and are running builds outside of the
100+
Vercel environment, we recommend using `syncNeonEnvVars` in addition to `syncVercelEnvVars` for your
101+
database environment variables.
102+
103+
This ensures that the correct database connection strings are used for your
104+
selected environment and current branch, as `syncVercelEnvVars` may not accurately reflect
105+
branch-specific database credentials when run locally.
106+
</Accordion>
107+
</AccordionGroup>
101108

102109
```ts
103110
import { defineConfig } from "@trigger.dev/sdk";
@@ -138,25 +145,29 @@ export default defineConfig({
138145

139146
The `syncNeonEnvVars` build extension syncs environment variables from your Neon database project to Trigger.dev. It automatically detects branches and builds the appropriate database connection strings for your environment.
140147

141-
<Note>
142-
You need to set the `NEON_ACCESS_TOKEN` and `NEON_PROJECT_ID` environment variables, or pass them
143-
as arguments to the `syncNeonEnvVars` build extension. You can generate a `NEON_ACCESS_TOKEN` in
144-
your Neon [dashboard](https://console.neon.tech/app/settings/api-keys).
145-
</Note>
148+
<AccordionGroup>
149+
<Accordion title="Setting up authentication">
150+
You need to set the `NEON_ACCESS_TOKEN` and `NEON_PROJECT_ID` environment variables, or pass them
151+
as arguments to the `syncNeonEnvVars` build extension.
146152

147-
<Note>
148-
When running the build from a Vercel environment (determined by checking if the `VERCEL`
149-
environment variable is present), this extension is skipped entirely. This is because Neon's
150-
Vercel integration already handles environment variable synchronization in Vercel environments.
151-
</Note>
153+
You can generate a `NEON_ACCESS_TOKEN` in your Neon [dashboard](https://console.neon.tech/app/settings/api-keys).
154+
</Accordion>
152155

153-
<Note>
154-
If you have the Neon database Vercel integration installed and are running builds outside of the
155-
Vercel environment, we recommend using `syncNeonEnvVars` in addition to `syncVercelEnvVars` for your
156-
database environment variables. This ensures that the correct database connection strings are used for your
157-
selected environment and current branch, as `syncVercelEnvVars` may not accurately reflect
158-
branch-specific database credentials when run locally.
159-
</Note>
156+
<Accordion title="Running in Vercel environment">
157+
When running the build from a Vercel environment (determined by checking if the `VERCEL`
158+
environment variable is present), this extension is skipped entirely.
159+
160+
This is because Neon's Vercel integration already handles environment variable synchronization in Vercel environments.
161+
</Accordion>
162+
163+
<Accordion title="Using with Neon database Vercel integration">
164+
If you have the Neon database Vercel integration installed and are running builds outside of the
165+
Vercel environment, we recommend using `syncNeonEnvVars` in addition to `syncVercelEnvVars` for your
166+
database environment variables.
167+
168+
This ensures that the correct database connection strings are used for your selected environment and current branch, as `syncVercelEnvVars` may not accurately reflect branch-specific database credentials when run locally.
169+
</Accordion>
170+
</AccordionGroup>
160171

161172
<Note>
162173
This extension is skipped for `prod` environments. It is designed to sync branch-specific

0 commit comments

Comments
 (0)