Skip to main content

Environment Variables

This page documents the environment variables used by the ZeroAuth platform. These are internal configuration variables — as an API consumer, you only need an API key to get started.

info

If you are integrating with ZeroAuth's hosted API, you do not need to configure any of these variables. Just use your API key with https://zeroauth.dev. This page is provided for transparency and for contributors to the ZeroAuth platform.

Server and Runtime

VariableDefaultRequiredNotes
NODE_ENVdevelopmentNoWhen set to production, missing required secrets throw at startup.
PORT3000NoAPI listen port.
API_BASE_URLhttp://localhost:3000NoUsed in service metadata, OIDC discovery, and SAML callbacks. Production: https://zeroauth.dev

JWT

VariableDefaultRequiredNotes
JWT_SECRETdev-secret-change-meYes in productionSigning key for access and refresh tokens.
JWT_EXPIRES_IN1hNoSupports s, m, h, d units.
JWT_REFRESH_EXPIRES_IN7dNoSupports s, m, h, d units.

SAML

VariableDefaultRequiredNotes
SAML_ENTRY_POINThttps://idp.example.com/sso/samlNoIdP SSO endpoint returned by /v1/auth/saml/login.
SAML_ISSUERzeroauth-spNoSP entity ID used in login response and metadata XML.
SAML_CALLBACK_URLhttps://zeroauth.dev/v1/auth/saml/callbackNoAssertion Consumer Service URL in metadata XML.
SAML_CERTemptyNoIdP certificate for assertion validation.

OIDC

VariableDefaultRequiredNotes
OIDC_ISSUERhttps://accounts.google.comNoUsed to build the authorize URL.
OIDC_CLIENT_IDemptyNoIncluded in the authorize URL.
OIDC_CLIENT_SECRETemptyNoUsed for token exchange.
OIDC_REDIRECT_URIhttps://zeroauth.dev/v1/auth/oidc/callbackNoIncluded in the authorize URL.

Session and Admin

VariableDefaultRequiredNotes
SESSION_SECRETdev-session-secretYes in productionSession-related runtime security.
ADMIN_API_KEYdev-admin-keyYes in productionRequired for /api/admin/* internal routes.

Database

VariableDefaultRequiredNotes
POSTGRES_HOSTlocalhostNoPostgreSQL hostname.
POSTGRES_PORT5432NoPostgreSQL port.
POSTGRES_DBzeroauthNoDatabase name.
POSTGRES_USERzeroauthNoDatabase user.
POSTGRES_PASSWORDzeroauth-devYes in productionDatabase password.

Rate Limiting and Logging

VariableDefaultRequiredNotes
RATE_LIMIT_WINDOW_MS900000No15-minute default window (global rate limiter).
RATE_LIMIT_MAX_REQUESTS300NoMax requests per window (global). Per-tenant limits are plan-based.
LOG_LEVELinfoNoWinston log level.

Blockchain

VariableDefaultRequiredNotes
BLOCKCHAIN_RPC_URLhttps://sepolia.base.orgNoBase Sepolia RPC endpoint.
BLOCKCHAIN_CHAIN_ID84532NoBase Sepolia chain ID.
BLOCKCHAIN_PRIVATE_KEYemptyNeeded for blockchain featuresIf missing, blockchain initialization is skipped.
DID_REGISTRY_ADDRESSemptyNeeded for live DID writesEnables the DID registry contract client.
VERIFIER_CONTRACT_ADDRESSemptyNeeded for on-chain proof verificationEnables the verifier contract client.
VERIFY_ON_CHAINfalseNoAdds optional contract verification after off-chain verification.

ZKP Artifacts

VariableDefaultRequiredNotes
ZKP_WASM_PATHcircuits/build/identity_proof_js/identity_proof.wasmNoReturned by /v1/auth/zkp/circuit-info.
ZKP_ZKEY_PATHcircuits/build/circuit_final.zkeyNoProving key path.
ZKP_VKEY_PATHcircuits/build/verification_key.jsonNoLoaded at startup for off-chain proof verification.

Redis

VariableDefaultRequiredNotes
REDIS_URLredis://localhost:6379NoRedis connection URL.
USE_REDIS_SESSIONSfalseNoEnable Redis-backed session storage.