Skip to content

Environment variables ​

Frontend variables are Vite env (VITE_…). Backend variables are Nest/.env (X_…). Auth modes on both sides must match.

Frontend (@chilibase/frontend/env-vars) ​

Enum XEnvVar (re-export of EnvVar) and ViteAuth.

VariableRole
VITE_BACKEND_URLBackend origin used by the client
VITE_AUTHOFF / LOCAL / AUTH0 / MS_ENTRA_ID
VITE_AUTH_OFF_USERNAMEUsername in x_user when auth is off
VITE_AUTH0_DOMAINAuth0 tenant domain
VITE_AUTH0_CLIENT_IDAuth0 application client id
VITE_AUTH0_AUDIENCEAPI audience
VITE_MS_ENTRA_ID_TENANT_IDEntra tenant
VITE_MS_ENTRA_ID_CLIENT_IDEntra app registration
VITE_MS_ENTRA_ID_BACKEND_SCOPEScope requested for the API
VITE_LEGACY_OBJECT_LOADINGWhen true, forms without createObject / assocList still load the old way

Backend (@chilibase/backend/env-vars) ​

Enums EnvVar, Auth, Protocol.

VariableRole
X_PROTOCOLHTTP or HTTPS
X_DOMAINPublic host name
X_PORTPort
X_AUTHSame values as VITE_AUTH
X_AUTH_LOCAL_JWT_SECRETHMAC secret for local JWT (required if LOCAL)
X_AUTH0_DOMAINAuth0 tenant (JWKS / issuer)
X_AUTH0_AUDIENCEJWT audience
X_MS_ENTRA_ID_TENANT_IDEntra tenant
X_MS_ENTRA_ID_AUDIENCEJWT audience
X_DATABASE_URLPostgreSQL connection URL
X_STRING_DB_SEARCH_AI_CIString search accent/case behaviour
X_LOG_SQLLog SQL (including execution time)

Missing required variables throw at runtime (Environment variable … value not found).

Released under the MIT License.