An environment variable is a key-value pair that your Project can access while it runs. They are useful for configuring applications, storing sensitive information, and adding feature flags.
Through your Project's dashboard, you can add, edit, and remove environment variables within your Project.
Note that saving your changes to the environment variables re-deploys your Project and creates a new deployment.
If you have too many environment variables to copy and paste by hand, use the "Upload .env file" button to add environment variables in bulk.
While .env files are a convenient way to store and transfer environment variables, be vigilant in ensuring that sensitive information like passwords, tokens, and private keys are not stored in files that get committed to your code's version control or are publicly accessible.
Copy Environment Variables from Another Project
If you have another Project on Zeet with environment variables that you wish to use, you can copy them over with the "Copy variables from another Project" button. This is an all-or-nothing operation, it will copy in every variable from the source Project and overwrite any existing variables in the current Project.
Sealing Environment Variables
If you have sensitive information in your Environment Variables, you can choose to seal the variable by using the Lockpad button next to the variable. Once sealed, nobody in your team can read the value. However, sealed secrets can be overriden with new values by unsealing it. Unsealing a variable will not reveal the old value.
Default Environment Variables
Zeet provides a series of environment variables to your Resources by default, for use with scripting or other Zeet-centric workflows. A table of Zeet-provided environment variables is below:
|ZEET_DEPLOYMENT_URL||The fully-qualified .zeet.app domain that your application will be accessible on.||team-zeet-example-nextjs-demo-main.zeet-example-usw2.zeet.app||This will only contain the .zeet.app URL, no custom domains. This does not include a protocol|
|ZEET_PROJECT_NAME||The name of the Zeet Project||team-zeet-example-nextjs-demo|
|ZEET_ENVIRONMENT||The name of the environment this Deployment is deployed within.||main||In most situations, this is equivalent to the actively deployed branch.|
|ZEET_VERSION||The version of the currently deployed code||42ae5b42c29e75ccfb5c21dc725f612734c52942||In a Github-based Project, this will mirror the Git Commit SHA|
|ZEET_DEPLOYMENT_ID||The internal ID for this Deployment. This can be used for Zeet scripting||57a0e557-bb90-4b04-9d3c-b4e78909b959||This may be asked for by Zeet Support Staff for debugging purposes.|
|ZEET_DEPLOYED_AT||The timestamp for when this Deployment was created.||2022-06-14T19:28:39Z||This references when the Deployment was created, it will not update in case of a restart / crash within the same Deployment.|