Environment Variables
Environment variables are a crucial part of configuring your Envio blockchain indexer. They allow you to manage sensitive information and configuration settings without hardcoding them in your codebase.
Naming Convention
HyperIndex reads the variables listed below. Most start with ENVIO_; the logging and Hasura ones keep their own names.
Your own variables (RPC URLs, API keys) can use any name locally, both in config.yaml and in handler code. Envio Cloud only accepts variables prefixed with ENVIO_, so use the prefix for anything you deploy.
Envio API Token (required for HyperSync)
To ensure continued access to HyperSync, set an Envio API token in your environment.
- Use
ENVIO_API_TOKENto provide your token at runtime - See the API Tokens guide for how to generate a token: API Tokens
- A token is only required when using Envio as the data provider (HyperSync). Indexers that source data from an external RPC don't need one.
Envio-specific environment variables
The following variables are used by HyperIndex. Defaults marked "dev" apply only while NODE_ENV is not production (see Production mode).
General
| Variable | Default | Description |
|---|---|---|
ENVIO_API_TOKEN | - | API token for HyperSync (required when any chain uses HyperSync - get one at envio.dev/app/api-tokens). envio init also reads it in place of --api-token. |
ENVIO_CONFIG | config.yaml | Config file path, relative to the project directory. Same as the CLI's --config flag. |
ENVIO_INDEXER_PORT | 9898 | Port of the indexer's HTTP server, which serves /metrics, /metrics/runtime and /healthz - see Observability |
ENVIO_TUI | auto | false disables the terminal UI, true forces it on (replaces the V2 TUI_OFF=true flag). Without it, the TUI is off when stdout is not a terminal, in CI (CI set), under Claude Code (CLAUDECODE set) or with TERM=dumb. |
ENVIO_HASURA | true | false skips Hasura: envio dev doesn't start the container and the indexer doesn't track tables |
Postgres
| Variable | Default | Description |
|---|---|---|
ENVIO_PG_HOST | localhost (dev) | Postgres host. Setting it at all tells envio dev you run Postgres yourself, so it doesn't start a container. |
ENVIO_PG_PORT | 5433 (dev) | Postgres port. For envio dev it is the host port of the container, which itself always listens on 5432. |
ENVIO_PG_USER | postgres (dev) | Postgres username |
ENVIO_PG_PASSWORD | testing | Postgres password |
ENVIO_PG_DATABASE | envio-dev (dev) | Postgres database name |
ENVIO_PG_SCHEMA | public | Postgres schema the indexer writes to (replaces ENVIO_PG_PUBLIC_SCHEMA; the old name is still accepted until v4). Give each indexer sharing a database its own schema. |
ENVIO_PG_SSL_MODE | false (dev) | true, false, require, allow, prefer or verify-full |
ENVIO_PG_MAX_CONNECTIONS | 2 | Postgres connection budget for the whole run. With 4 or more, an indexer whose entities are all per-chain (no @crossChain entity) splits its chains across up to 4 worker processes, with at least 2 connections each. |
Hasura
| Variable | Default | Description |
|---|---|---|
HASURA_GRAPHQL_ENDPOINT | http://localhost:8080/v1/metadata (dev) | Hasura metadata endpoint the indexer uses to track tables |
HASURA_GRAPHQL_ADMIN_SECRET | testing (dev) | Hasura admin secret. envio dev also sets it on the container it starts. |
HASURA_GRAPHQL_ROLE | admin (dev) | Role used for metadata calls |
HASURA_EXTERNAL_PORT | 8080 | Host port of the Hasura container started by envio dev |
ENVIO_HASURA_RESPONSE_LIMIT | none | Maximum rows the public role can read per query (old name HASURA_RESPONSE_LIMIT still works) |
ENVIO_HASURA_PUBLIC_AGGREGATE | [] | JSON array of entity names whose aggregate queries are open to the public role, e.g. ["Transfer","Account"] |
ClickHouse
When the indexer also writes to ClickHouse (storage.clickhouse in config.yaml), envio start reads the connection from ENVIO_CLICKHOUSE_HOST (a URL such as http://localhost:8123), ENVIO_CLICKHOUSE_DATABASE, ENVIO_CLICKHOUSE_USERNAME and ENVIO_CLICKHOUSE_PASSWORD, plus the optional ENVIO_CLICKHOUSE_REPLICATED (only true is accepted) and ENVIO_CLICKHOUSE_DATABASE_ENGINE for high-availability setups. envio dev spins up its own container and injects these for you, using the default user with no password and the default database. Setting ENVIO_CLICKHOUSE_HOST makes envio dev use your server instead.