Environment Variables
Environment Variables are key-value pairs configured outside your source code. They are used to store environment-specific values such as API keys.
You can manage your project's Environment Variables in Nhost Dashboard under Variables. When you define a new variable, you can set one value for production and one for development.
Environment Variables are available for:
When an Environment Variable has updated the changes happen immediately for Hasura GraphQL Engine. For Serverless Functions, a new deployment via Git is required.
System Environment Variables
System Environment Variables are automatically available in production and during local development. The following system Environment Variables are available:
NHOST_ADMIN_SECRET
NHOST_WEBHOOK_SECRET
NHOST_BACKEND_URL
(deprecated)NHOST_SUBDOMAIN
NHOST_REGION
NHOST_HASURA_URL
NHOST_AUTH_URL
NHOST_GRAPHQL_URL
NHOST_STORAGE_URL
NHOST_FUNCTIONS_URL
NHOST_JWT_SECRET
Example values:
NHOST_ADMIN_SECRET=e7w36ag287qn5qry795f6ymm57qgvqup
NHOST_WEBHOOK_SECRET=ns3sfjgdw4y6zeqthwnnw347dzh8wyj4
NHOST_BACKEND_URL=https://abc123abc.nhost.run
NHOST_SUBDOMAIN=abv123abc
NHOST_REGION=eu-central-1
NHOST_HASURA_URL=https://abc123abc.hasura.eu-central-1.nhost.run/console
NHOST_AUTH_URL=https://abc123abc.auth.eu-central-1.nhost.run/v1
NHOST_GRAPHQL_URL=https://abc123abc.graphql.eu-central-1.nhost.run/v1
NHOST_STORAGE_URL=https://abc123abc.storage.eu-central-1.nhost.run/v1
NHOST_FUNCTIONS_URL=https://abc123abc.functions.eu-central-1.nhost.run/v1
NHOST_JWT_SECRET={"type": "HS256", "key": "vumpbe2w2mgaqj5yqfp7dvxu6kywtvsgb68ejpdaqxerea8jwrsszdp2dhkjxsh4df69pzm3ja6ukedx8ja43zdt6q9kgbgg2w9vh2sedeppukud9a2qzy29v3afdn7m"}
Development Environment Variables
When developing locally using the CLI, Environment Variables set in .env.development
are available in your local environment. There are two ways to manage them:
- Edit the
.env.development
file manually. - Add development Environment Variables in the Nhost Dashboard and use
nhost env pull
to sync them. This way, your team members will also have access to the same Environment Variables.