Configure the Bearer Agent

The Bearer Agent supports additional configuration options during initialization. For example:

"secretKey" => "YOUR_BEARER_SECRET_KEY",
"stripSensitiveData" => true,
"stripSensitiveKeys" => "/^authorization$|^$|^access.token$|^client.secret$/i",
"stripSensitiveRegex" => "[a-z0-9]{1}[a-z0-9.!#$%&’*+=?^_`{|}~-][email protected][a-z0-9-]+(?:\\.[a-z0-9-]+)*"

Available Configuration Options

The following is a list of all available configuration options.




Your Bearer Secret Key (required)


When set, the Bearer agent is disabled


Sets the name of the environment to be used in the dashboard. (defaults to development)


Remove sensitive data before sending it to (defaults to true)


Regular expression string used for key name values to strip (see defaults)


Regular expression string used for value stripping (see defaults)

For more on using the stripSensitiveData, stripSensitiveKeys, and stripSensitiveRegex configuration properties see Keep your Data Protected.

Setting an application's environment name

Bearer uses your application's environment variable or the configuration to determine the environments that exist for an application in the Bearer Dashboard. The agent will infer the environment name from the env or APP_ENV environment variables if they exist.

You can also set the environment name by using the environment argument when configuring the agent during initialization. If environment is set, it will override any name detected by your application's environment variables.

If no environment name can be detected, the environment will default to "development".