mentdotio / ment.io

Get free mentoring and offer to mentor subjects you care about
https://ment.io
MIT License
2 stars 1 forks source link

Setup Airbrake for your JavaScript application #9

Open newswim opened 7 years ago

newswim commented 7 years ago

Install Airbrake in 2 easy steps:

Step 1: Add the library Include via CDN:

<script src="https://cdnjs.cloudflare.com/ajax/libs/airbrake-js/0.9.5/client.min.js"></script>

We also support installation via npm and Bower.

Step 2: Copy this config snippet to your app.js file

(You can find your project ID and API KEY with your project's settings):

var airbrake = new airbrakeJs.Client({
  projectId: <Your project ID>,
  projectKey: '<Your project API Key>'
});
airbrake.addFilter(function (notice) {
  notice.context.environment = 'production';
  return notice;
});

Visit official GitHub repo for more info on alternative configurations and advanced options.