Skip to main content

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.

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.

Custom Environment Variables

You can manage your project's Environment Variables in the Nhost Dashboard or by using the configuration file.

Dashboard

Environment Variables

Environment Variables can be managed in the Nhost Dashboard under Settings Environment Variables.

Configuration File

Environment Variables can also be managed by adding new [[global.environment]] sections to the nhost.toml file.

[global]
[[global.environment]]
name = 'MY_ENV_VAR'
value = '<first-value>'

[[global.environment]]
name = 'MY_OTHER_ENV_VAR'
value = '<second-value>'

# ... omitted for brevity

These environment variables will also be available on the Nhost Dashboard after committing and pushing the changes to your Git repository.

System Environment Variables

System environment variables are automatically generated from the configuration file and your project's subdomain and region.

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

NHOST_ADMIN_SECRET, NHOST_WEBHOOK_SECRET and NHOST_JWT_SECRET are populated with values from the configuration file. The rest of the system environment variables are populated with values from your project's subdomain and region.

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"}