Skip to content

Commit dc65d3b

Browse files
[docs]: Clarify astro:env/server variable evaluation and secret handling (#12818)
Co-authored-by: Sarah Rainsberger <[email protected]>
1 parent bc3e7f7 commit dc65d3b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/content/docs/en/guides/environment-variables.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ There are three kinds of environment variables, determined by the combination of
279279
import { API_SECRET } from "astro:env/server";
280280
```
281281
282-
By default, secrets are only validated at runtime. You can enable validating private variables on start by [configuring `validateSecrets: true`](/en/reference/configuration-reference/#envvalidatesecrets).
282+
By default, all secrets are validated whenever anything is imported from the `astro:env/server` module. This means, secrets may be validated even when they are not imported. You may need to [pass dummy environment variables](#setting-environment-variables) to satisfy this validation during the build.
283+
284+
You can also enable validating secrets on start by [configuring `validateSecrets: true`](/en/reference/configuration-reference/#envvalidatesecrets).
283285
284286
:::note
285287
**Secret client variables** are not supported because there is no safe way to send this data to the client. Therefore, it is not possible to configure both `context: "client"` and `access: "secret"` in your schema.

0 commit comments

Comments
 (0)