Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Airbrake for your JavaScript application #2

Open
wambugucoder opened this issue Sep 12, 2020 · 0 comments
Open

Setup Airbrake for your JavaScript application #2

wambugucoder opened this issue Sep 12, 2020 · 0 comments
Labels

Comments

@wambugucoder
Copy link
Owner

Installation

Add the library

npm install @airbrake/browser

Configuration

(You can find your project ID and API key in your project's settings)

import { Notifier } from '@airbrake/browser';

const airbrake = new Notifier({
  projectId: <Your project ID>,
  projectKey: '<Your project API Key>',
  environment: 'production'
});

To test that Airbrake has been installed correctly in your project, open up the JavaScript console in your browser and paste in:

window.onerror("TestError: This is a test", "path/to/file.js", 123);

Full documentation

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant