Skip to content
Integrate AirBrake into an angular.js application
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Integrate AirBrake into an angular.js application

Install ng-helper-airbrake

bower install ng-helper-airbrake --save

Ensure that the dependency entry comes directly after the angular dependency. Are you not sure? Check & modify the bower.json.

Include the angular module

angular.module('appApp', [

Register the project id

Airbrake requires a project id and secret. This can be configured via the application config function as follows:

.config([ '$airbrakeProvider', function($airbrakeProvider) {
    // configure airbrake
    $airbrakeProvider.setProject('<<PROJECTID>>', '<<PROJECTSECRET>>', '<<EnvironmentOptional>>');

    // configure host (optional step for self hosted environments)

The Airbrake plugin is not available as long the setProject method is not called. Only when this method is called exception will be catched from the subsystem.

Add custom information to the error context

.run([ '$airbrake', function($airbrake) {
    // add custom context
    $airbrake.setCustomContext({custom1: "context1", custom2: "context2" });

You can add optional custom information to the error context via the setCustomContext function.


  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :)



MIT License

You can’t perform that action at this time.