Environment Variables

This page provides a comprehensive list of all environment variables that can be configured for LangWatch self-hosting deployments. These variables control various aspects of the application including authentication, database connections, external services, and feature flags.

Environment Variables Reference

VariableDescriptionRequiredDefault
Core Configuration
DATABASE_URLPostgreSQL database connection URLYes-
NODE_ENVApplication environment (development, test, production)Yes-
BASE_HOSTBase URL of the applicationYes-
API_TOKEN_JWT_SECRETSecret key for JWT token signingYes-
CREDENTIALS_SECRETSecret for credential encryption, Base16 encodedYes-
Authentication (NextAuth)
NEXTAUTH_PROVIDERAuthentication provider (azure-ad, okta, auth0, etc.)Noemail
NEXTAUTH_SECRETSecret for NextAuth.js session encryptionYes-
NEXTAUTH_URLURL of the authentication serviceYes-
Search & Storage
ELASTICSEARCH_NODE_URLElasticsearch/OpenSearch cluster endpointYes-
ELASTICSEARCH_API_KEYElasticsearch/OpenSearch API key for authenticationYes-
IS_OPENSEARCHFlag to indicate OpenSearch instead of ElasticsearchNofalse
IS_QUICKWITFlag to indicate Quickwit instead of ElasticsearchNofalse
REDIS_URLRedis connection URLNo-
REDIS_CLUSTER_ENDPOINTSIf using Redis cluster, specify the endpoints (comma-separated)No-
S3 Storage
USE_S3_STORAGEEnable S3-compatible storage for datasetsNofalse
S3_ENDPOINTS3-compatible storage endpointNo-
S3_ACCESS_KEY_IDS3 access key IDNo-
S3_SECRET_ACCESS_KEYS3 secret access keyNo-
S3_BUCKET_NAMES3 bucket name for dataset storageNo-
S3_KEY_SALTSalt for S3 key encryptionNo-
Evaluation Providers
AZURE_OPENAI_ENDPOINTAzure OpenAI endpoint URL for jailbreak and content safety evaluatorsNo-
AZURE_OPENAI_KEYAzure OpenAI API key for jailbreak and content safety evaluatorsNo-
GOOGLE_APPLICATION_CREDENTIALSGoogle Cloud service account credentials for PII detection fallback (when internal Presidio check fails)No-
NLP Services
LANGWATCH_NLP_SERVICECustom NLP service endpointYes-
TOPIC_CLUSTERING_SERVICETopic clustering service endpointYes-
LANGEVALS_ENDPOINTLangEvals evaluation service endpointNo-
LANGWATCH_NLP_LAMBDA_CONFIGLambda configuration for NLP servicesNo-
Email Services
SENDGRID_API_KEYSendGrid API key for email deliveryNo-
EMAIL_DEFAULT_FROMDefault sender email addressNo-
Analytics & Monitoring
DISABLE_USAGE_STATSDisable usage statistics collectionNofalse
SENTRY_DSNSentry DSN for error trackingNo-
SSO Providers
AUTH0_CLIENT_IDAuth0 client IDNo-
AUTH0_CLIENT_SECRETAuth0 client secretNo-
AUTH0_ISSUERAuth0 issuer URLNo-
AZURE_CLIENT_IDAzure AD client IDNo-
AZURE_CLIENT_SECRETAzure AD client secretNo-
AZURE_TENANT_IDAzure AD tenant IDNo-
COGNITO_CLIENT_IDAWS Cognito client IDNo-
COGNITO_ISSUERAWS Cognito issuer URLNo-
COGNITO_CLIENT_SECRETAWS Cognito client secretNo-
GITHUB_CLIENT_IDGitHub OAuth client IDNo-
GITHUB_CLIENT_SECRETGitHub OAuth client secretNo-
GITLAB_CLIENT_IDGitLab OAuth client IDNo-
GITLAB_CLIENT_SECRETGitLab OAuth client secretNo-
GOOGLE_CLIENT_IDGoogle OAuth client IDNo-
GOOGLE_CLIENT_SECRETGoogle OAuth client secretNo-
OKTA_CLIENT_IDOkta client IDNo-
OKTA_CLIENT_SECRETOkta client secretNo-
OKTA_ISSUEROkta issuer URLNo-