Skip to content

Latest commit

 

History

History
76 lines (58 loc) · 2.34 KB

README.md

File metadata and controls

76 lines (58 loc) · 2.34 KB

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