Configuration in Node.js


This section lists the Sqreen Node.js agent configuration options.

Configuration sources

The Sqreen agent reads its configuration from different places. The order of precedence is:

  • Environment variables
  • A JSON file
  • Default configuration options

The JSON file can be located in:

  • Your application top level directory: sqreen.json
  • In a custom place set by SQREEN_CONFIG_FILE environment variable:

export SQREEN_CONFIG_FILE=/custom/path/sqreen.json

Configuration variables

You can use environment variables or a JSON file to configure the Sqreen agent. The SQREEN_TOKEN is required. The other settings are optional. Here are the available settings:

Env variable name Role JSON key name Default value
SQREEN_TOKEN The Sqreen token. This identifies the agent to Sqreen backend servers token Empty
SQREEN_CONFIG_FILE Custom location for the JSON based config Empty
SQREEN_LOG_LOCATION Specify a custom file to write Sqreen logs log_location log/sqreen.log
SQREEN_LOG_LEVEL Sqreen logging level log_level WARN
SQREEN_HTTP_PROXY HTTP proxy server http_proxy Empty
SQREEN_IP_HEADER Specify the header to use to find the real IP address of a client ip_header Empty
SQREEN_STRIP_SENSITIVE_DATA Remove sensitive data before sending them to Sqreen BackEnd strip_sensitive_data 1
SQREEN_APP_ROOT Declare custom root directory for project app_root process.cwd()
SQREEN_DISABLE_STARTUP_WARNING Stop logging a warning when the agent isn't required first Not applicable 0 (Enabled)