Skip to main content

Environment Variables

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.

Upload a .env File

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.

Default Environment Variables

Zeet provides a series of environment variables to your projects by default, for use with scripting or other Zeet-centric workflows. A table of Zeet-provided environment variables is below:

ZEET_DEPLOYMENT_URLThe fully-qualified domain that your application will be accessible will only contain the URL, no custom domains. This does not include a protocol
ZEET_PROJECT_NAMEThe name of the Zeet projectteam-zeet-example-nextjs-demo
ZEET_ENVIRONMENTThe name of the environment this Deployment is deployed within.mainIn most situations, this is equivalent to the actively deployed branch.
ZEET_VERSIONThe version of the currently deployed code42ae5b42c29e75ccfb5c21dc725f612734c52942In a Github-based project, this will mirror the Git Commit SHA
ZEET_DEPLOYMENT_IDThe internal ID for this Deployment. This can be used for Zeet scripting57a0e557-bb90-4b04-9d3c-b4e78909b959This may be asked for by Zeet Support Staff for debugging purposes.
ZEET_DEPLOYED_ATThe timestamp for when this Deployment was created.2022-06-14T19:28:39ZThis references when the Deployment was created, it will not update in case of a restart / crash within the same Deployment.