Environment variables
Configuration and secrets per environment, at build time or at run time.
Add a variable#
Open a project → Environment variables and add a name and a value. Names use letters, numbers and underscores and cannot start with a number (for example API_URL or MAIL_API_KEY). Values can be up to 32 KB.
Environments#
Choose where each variable applies:
- Production: the live app.
- Preview: preview deployments, such as pull requests.
- Development: for your own tooling.
Build time and run time#
A variable can be available while building, while running, or both (the default). Frameworks that inline variables into the browser code at build time (for example NEXT_PUBLIC_* in Next.js or VITE_* in Vite) need them at build time.
Secrets#
Variables are secret by default: the value is encrypted and can never be shown again, only replaced. Turn off secret for values that are safe to read back, such as a public URL.
Set by the platform#
PORT and names starting with CLOUDVEA_ are set by Cloudvea and cannot be changed, for example CLOUDVEA_STORAGE_URL for a connected bucket or CLOUDVEA_CRON_SECRET for cron jobs. Connecting a database adds its connection string (DATABASE_URL by default) as a secret variable.