Skip to main content

Environment Variables

This document provides a comprehensive list of all environment variables used by Unchained Engine (excluding plugins and ticketing). Most of the plugins and extensions (like ticketing) have their own environment variables, check their docs individually.

Core Configuration

VariableDefaultDescription
NODE_ENV-Node environment (development, test, production). Affects caching, logging, and other behaviors
PORT-Base port number used by the application. MongoDB memory server uses PORT+1
MONGO_URL-MongoDB connection URL. If not set, uses mongodb-memory-server in development/test
UNCHAINED_DOCUMENTDB_COMPAT_MODE-Enable AWS DocumentDB compatibility mode (set to any truthy value to enable)
UNCHAINED_API_VERSIONpackageJson.versionAPI version returned in GraphQL context, defaults to package.json version
UNCHAINED_LANGdeDefault language code
UNCHAINED_COUNTRYCHDefault country code
UNCHAINED_CURRENCYCHFDefault currency code
DEBUG-Debug namespace for detailed logging
LOG_LEVELInfoLog level (Error, Warn, Info, Verbose, Debug)
UNCHAINED_LOG_FORMATunchainedLog format type

Security & Authentication

VariableDefaultRequiredDescription
UNCHAINED_SECRET-YesSecret key used for signing magic keys and tokens. Must be kept secure
UNCHAINED_TOKEN_SECRET-YesSecret key for session tokens. Must be at least 32 characters long and kept secret, generate randomly by using uuidgen
UNCHAINED_COOKIE_NAMEunchained_tokenYesName of the session cookie
UNCHAINED_COOKIE_PATH/YesCookie path
UNCHAINED_COOKIE_DOMAIN-NoCookie domain restriction
UNCHAINED_COOKIE_SAMESITEfalseNoSameSite cookie attribute (strict, lax, none, or false)
UNCHAINED_COOKIE_INSECURE-NoAllow insecure cookies (set to any truthy value, defaults to secure)

Web Configuration

VariableDefaultRequiredDescription
ROOT_URLhttp://localhost:4010YesBase URL of the application, used for generating absolute URLs
EMAIL_WEBSITE_URL-YesFrontend website URL, used in email templates and redirects
EMAIL_WEBSITE_NAMEUnchainedYesName of the website shown in emails and WebAuthn

Email Configuration

VariableDefaultRequiredDescription
MAIL_URL--SMTP connection URL for sending emails (e.g., smtp://user:pass@host:port)
EMAIL_FROMnoreply@unchained.localYesDefault sender email address
EMAIL_ERROR_REPORT_RECIPIENTsupport@unchained.local-Email address for error reports
UNCHAINED_DISABLE_EMAIL_INTERCEPTION--Disable email interception in non-production environments (set to any truthy value)

API Endpoints

VariableDefaultDescription
GRAPHQL_API_PATH/graphqlGraphQL API endpoint path
BULK_IMPORT_API_PATH/bulk-importBulk import API endpoint path
TEMP_UPLOAD_API_PATH/temp-uploadTemporary file upload API endpoint path
MCP_API_PATH/mcpModel Context Protocol API endpoint path
ERC_METADATA_API_PATH/erc-metadata/:productId/:localeOrTokenFilename/:tokenFileName?ERC metadata API endpoint path pattern

Admin UI Customization

VariableDefaultDescription
EXTERNAL_LINKS-JSON string containing external links configuration for shop info

Worker Configuration

VariableDefaultDescription
UNCHAINED_WORKER_IDos.hostname()Unique identifier for worker instance
UNCHAINED_DISABLE_WORKER-Disable worker system entirely (set to any truthy value)
UNCHAINED_DISABLE_PROVIDER_INVALIDATION-Disable provider invalidation on startup (set to any truthy value)
UNCHAINED_ASSIGN_CART_FOR_USERS-Automatically assign carts for users on startup (set to any truthy value)

Notes

  • Environment variables marked as "Required" must be set for the application to start properly
  • In production, ensure all security-related variables are properly set with strong values
  • Some variables have different behaviors in development vs production (see NODE_ENV)
  • Email interception is enabled by default in non-production environments unless disabled
  • Cookie security settings should be carefully configured for production deployments