Working with Multiple Clients

Addition clients can be used to report to multiple Honeybadger projects in the same app. To create a new client, use the Honeybadger.factory() function.

To create a new client:

var OtherBadger = Honeybadger.factory({apiKey: "alternate api key"});

The single argument passed to Honeybadger.factory() should be an object, and will serve as the new client's initial configuration. To configure additional options, use the configure function:

OtherBadger.configure({ component: 'myComponent' });

Note: the enableUncaught configuration option has no effect on additional clients.

The client has the same familiar API as the default Honeybadger client:

OtherBadger.notify("This will go to an alternate project.");