Environments and Versions

Honeybadger groups errors by the environment they belong to. You don't have to set an environment, but it can be useful if you're running your app in different locations, such as "production" and "staging".

You should also configure the current version (or revision) of your application so that we can associate errors with the correct source maps and deploys.

To set the environment in Honeybadger:

Honeybadger.configure({
  // ...
  environment: 'production'
});

Unlike some of our other platforms (such as Ruby), honeybadger-js reports errors in all environments by default. To disable reporting in development environments, use the disabled option:

// Set the environment however you wish, depending on your build process. An
// environment variable is the most common.
var environment = '[environment]';

Honeybadger.configure({
  // ...
  environment: environment,
  disabled: environment === 'development'
});

It's not uncommon for multiple versions of a client-side application to report errors at the same time, especially as a new version is rolled out. It's important to tell Honeybadger which version of your application is currently deployed so that we can associate the error with the correct deploy and apply the correct source map to the stack trace.

Honeybadger uses the revision option to track the current version of your application. While this can be any unique value (such a "v1.2.3"), we prefer to use the GIT sha of the last commit (or the equivalent value from your source control management system):

Honeybadger.configure({
  // ...
  revision: 'dcc69529edf375c72df39b0e9195d60d59db18ff'
});

If you don't configure the revision, Honeybadger defaults to "master".