Skip to content

faultline exception and error notifier for JavaScript.

License

Notifications You must be signed in to change notification settings

faultline/faultline-js

Repository files navigation

faultline-js Build Status

faultline exception and error notifier for JavaScript.

Installation

Using npm:

npm install faultline-js

or

<script src="path/to/faultline-js/dist/client.min.js"></script>

Usage

var faultline = new faultlineJs.Client({
                  project: 'faultline-js', 
                  apiKey: 'xxxxXXXXXxXxXXxxXXXXXXXxxxxXXXXXX',
                  endpoint: 'https://xxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/v0',
                  notifications: [
                    {
                      type: 'slack',
                      endpoint: 'https://hooks.slack.com/services/XXXXXXXXXX/B2RAD9423/WC2uTs3MyGldZvieAtAA7gQq',
                      channel: '#random',
                      username: 'faultline-notify',
                      notifyInterval: 1,
                      threshold: 1,
                      timezone: 'Asia/Tokyo'
                    }
                  ]
                });

Or if you are using browserify/webpack/etc:

var faultlineJs = require('faultline-js');
var faultline = new faultlineJs({
                  project: 'faultline-js', 
                  apiKey: 'xxxxXXXXXxXxXXxxXXXXXXXxxxxXXXXXX',
                  endpoint: 'https://xxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/v0',
                  notifications: [
                    {
                      type: 'slack',
                      endpoint: 'https://hooks.slack.com/services/XXXXXXXXXX/B2RAD9423/WC2uTs3MyGldZvieAtAA7gQq',
                      channel: '#random',
                      username: 'faultline-notify',
                      notifyInterval: 1,
                      threshold: 1,
                      timezone: 'Asia/Tokyo'
                    }
                  ]
                });

Integration

window.onerror

faultline-js automatically setups window.onerror handler when script is loaded, like airbrake-js

References

License

MIT © Ken'ichiro Oyama