Installing Airbrake in a RequireJS application


  • Easy and flexible installation options including NPM, Bower and a public CDN
  • Send uncaught errors to Airbrake or manually using a try/catch
  • Add custom parameters to your errors for more context
  • Private sourcemap support
  • Control which errors you send with customizable filtering options


Using npm

npm install airbrake-js

Using Bower

bower install airbrake-js-client


To report errors from your RequireJS app you configure an AirbrakeClient with your projectId and projectKey and report errors with the notify function. Here is an example from our RequireJS example app:

  paths: {
    airbrakeJs: 'node_modules/airbrake-js/dist'

require(['airbrakeJs/client'], function (AirbrakeClient) {
  var airbrake = new AirbrakeClient({
    projectId: 1,
    projectKey: 'FIXME'

  try {
    throw new Error('hello from Require.js');
  } catch (err) {
    promise = airbrake.notify(err);
    promise.then(function(notice) {
      console.log('notice id:',;
    }, function(err) {
      console.log('airbrake failed:', err);

Going Further

Installation and configuration is just the beginning. The airbrake-js notifier supports many other advanced uses and options including:

Please visit the airbrake-js GitHub repo for more usage and configuration examples.