configure-env-exposure
Configure Environment Variable Exposure
Control which environment variables are exposed to the frontend via env.js.
Prefix and allowlist
Only OS variables starting with JSENV_ are considered. You can allowlist specific names (without the JSENV_ prefix):
If you don’t provide an allowlist, all JSENV_* variables are exposed by default.
Exposure modes
Choose how variables appear in env.js:
EnvModeGlobals(default): each variable aswindow.NAME = "value".EnvModeObject: a single objectwindow.__ENV__ = { NAME: "value" }.EnvModeBoth: emit both forms.
Tip: If you use the object form, you can freeze it in app code to avoid accidental mutation: