A Raven.js / Sentry wrapper for Angular.js

npm install angular-raven
51 downloads in the last month

angular-raven Build Status

A Raven.js / Sentry wrapper for Angular.js

How do I add this to my project?

You can download angular-raven by:

<body ng-app="YOUR_APP" ng-controller="MainCtrl">
  <a href="#error" ng-click="logError()">Log Error</a>
<script src=""></script>
<script src=""></script>
  Raven.config('YOUR_PUBLIC_DSN', {
      // Raven settings
      "id": "SERVER_RENDERED_ID",
      "email": "SERVER_RENDERED_EMAIL"
<script src="app/bower_components/angular-raven/angular-raven.js"></script>

  angular.module('YOUR_APP', [
  .config(function(RavenProvider) {
    // There is a development flag to log errors rather than sending it to Sentry

  angular.module('controllers', [])
    .controller('MainCtrl', function($scope, Raven) {
      $scope.logError = function() {

Initializing Raven.js outside of Angular allows Raven to track errors when Angular wasn't able to bootstrap correctly.

The community has compiled a list of common ignore rules for common things, like Facebook, Chrome extensions, etc. ``javascript Raven.config('YOUR_PUBLIC_DSN', { logger: 'javascript', ignoreErrors: [ // Random plugins/extensions 'top.GLOBALS', // See: html 'originalCreateNotification', 'canvas.contentDocument', 'MyApp_RemoveAllHighlights', '', 'Can\'t find variable: ZiteReader', 'jigsaw is not defined', 'ComboSearch is not defined', '', 'atomicFindClose', // Facebook borked 'fb_xd_fragment', // ISP "optimizing" proxy -Cache-Control: no-transform` seems to reduce this. (thanks @acdha) // See 'bmi_SafeAddOnload', 'EBCallBackMessageReceived', // See 'conduitPage' ], ignoreUrls: [ // Facebook flakiness /, // Facebook blocked /\/en_US\/all.js/i, // Woopra flakiness /, /\/js\/woopra.js/i, // Chrome extensions /extensions\//i, /^chrome:\/\//i, // Other plugins /\/isrunning/i, // Cacaoweb /\//i, /\//i ] }).install();

npm loves you