Environment variables
Configure build-time and runtime values for Preview and Production deployments.
Environment variables provide configuration to builds and Functions without committing values to source control.
Environment scopes
Easel separates Preview and Production values. A deployment receives values from the environment used to build it.
| Scope | Used by |
|---|---|
| Preview | Branch, pull-request, and other Preview deployments |
| Production | Production deployments |
Changing a variable does not mutate an existing immutable deployment. Create a new deployment for the change to take effect.
Build-time variables
Build tools and frameworks can read variables while compiling the application.
Public prefixes such as NEXT_PUBLIC_, VITE_, and framework equivalents can embed values into browser JavaScript. Never place secrets in public variables.
Runtime variables
Server-side routes and Functions can read environment variables at runtime through the framework's normal API.
Treat all secret values as sensitive even when they are only available server-side.
Variable names and values
Use descriptive uppercase names. Avoid storing large files or structured credentials when a dedicated secret mechanism is required.
Combined environment variable names and values are subject to the Function environment size limit. See Function limits.
Local development
Keep local values in the framework's supported local environment files and exclude secret-bearing files from Git. Easel does not automatically synchronize local files with project settings unless a documented CLI command provides that behavior.
Rotation
To rotate a credential:
- Create the replacement credential at the provider.
- Update Preview and validate a new Preview deployment.
- Update Production and create a Production deployment.
- Promote the new deployment.
- Revoke the previous credential after rollback risk has passed.
Troubleshooting
When a value is missing or stale, verify:
- The correct Easel project
- Preview versus Production scope
- Exact variable name and capitalization
- Whether the variable is required during build or runtime
- Whether a new deployment was created after the change
- Whether the framework embeds public variables at build time