airbrake-mini-client
This is a lightweight client for airbrake (airbrake.io). The goal of this implementation is to provide a simpler and less invasive logging feature.
Create an instance
var AirbrakeMini = var airbrakeMini = // projectId and projectKey are provided by airbrake
Notify an error
try // critical code catch e airbrakeMini
or
Promise
Notify additional parameters
airbrakeMini
Configuration
AirbrakeMini constructor takes the following mandatory parameter:
- projectId
- projectKey
I strongly suggest to provide this optional parameter:
- environment: 'local', 'staging', 'development', 'live'
These other paramenters are mostly for testing:
- timeout: timeout for XMLHttpRequest
- host: it defaults to airbrake host
- reporter: an object providing a "notify" method
- win: the window global object (default to the current window)
Filters
You can use this feature to avoid sending an error to the server if it matches some criteria. You can also use this function to enrich the notice with specific informations. You can add as many filters you want. The method is chainable.
airbrakeMini
Here's some example:
airbrakeMini
Airbrake notice example: