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:

javascript
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:

javascript
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:

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