Skip to content
Error tracking via Sentry for Ember.js apps
JavaScript HTML CSS
Branch: master
Clone or download
Latest commit 059c980 Aug 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
addon Use native getter instead of volatile cp Apr 12, 2019
app Extract `initialize()` function into `ember-cli-sentry` module Feb 6, 2018
config ember-try: Add `useYarn` flag Feb 6, 2018
tests Update `ember-cli` to v2.18.2 Feb 6, 2018
vendor Mark raven-shim as an ES module Sep 27, 2018
.bowerrc Initial Commit from Ember CLI v0.1.12 Feb 4, 2015
.editorconfig Update ember and ember-cli versions Aug 3, 2016
.ember-cli Initial Commit from Ember CLI v0.1.12 Feb 4, 2015
.eslintrc.js Use console rather than Ember.Logger Sep 20, 2018
.gitignore Update `ember-cli` to v2.14.2 Feb 6, 2018
.jshintrc Update ember and ember-cli versions Aug 3, 2016
.npmignore Update `ember-cli` to v2.17.2 Feb 6, 2018
.travis.yml Update github repository name accross the new repository (#181) Feb 9, 2019
.watchmanconfig Update ember-cli to 2.3.0 Feb 29, 2016
CHANGELOG.md v4.1.0 May 3, 2019
LICENSE.md Update `ember-cli` to v2.18.2 Feb 6, 2018
README.md Update github repository name accross the new repository (#181) Feb 9, 2019
ember-cli-build.js Update `ember-cli` to v2.18.2 Feb 6, 2018
index.js Use `treeForVendor()` hook to import `raven-js` Feb 6, 2018
package.json Bump ember-source from 3.11.1 to 3.12.0 (#239) Aug 6, 2019
testem.js Update `ember-cli` to v2.18.2 Feb 6, 2018
yarn.lock Bump ember-cli-babel from 7.10.0 to 7.11.0 (#252) Aug 29, 2019
yuidoc.json Update github repository name accross the new repository (#181) Feb 9, 2019

README.md

ember-cli-sentry

An ember-cli addon adding Sentry support.

Requirements

  • Node.js 6 or higher is required to use this addon
  • Ember CLI 2.13 or higher is required to use this addon

Install

ember install ember-cli-sentry

Usage

TLDR

// config/environment.js

module.exports = function(environment) {
  var ENV = {

    /* config */

    sentry: {
      dsn: 'https://<dummykey>@app.getsentry.com/<dummyproject>'
    }
  }
}

Complete config

// config/environment.js

module.exports = function(environment) {
  var ENV = {

    /* config */

    sentry: {
      /**
       * The only mandatory parameter.
       *
       * @type {String}
       */
      dsn: 'https://<dummykey>@app.getsentry.com/<dummyproject>',

      /**
       * Sets Raven.debug property when running `Raven.config`.
       *
       * @type {Boolean}
       * @default true
       */
      debug: true,

      /**
       * If set to true, it will prevent Raven.js from being initialized.
       * Errors and logs will be logged to the console (default) instead of
       * being reported by Raven.
       *
       * @type {Boolean}
       * @default undefined
       */
      development: false,
      
      /**
       * Pass the environment to Raven.js
       *
       * @type {String}
       * @default undefined
       */
      environment: environment,

      /**
       * If set to true, addon will try to have Ember.onerror
       * and Ember.RSVP.on('error') captured by Raven.
       *
       * @type {Boolean}
       * @default true
       */
      globalErrorCatching: true,

      /**
       * Raven.js option.
       *
       * @type {Array}
       * @default []
       */
      includePaths: [],

      /**
       * Raven.js option.
       *
       * @type {Array}
       * @default []
       */
      whitelistUrls: [],

      /**
       * Options to pass directly to Raven.js. Note: whitelistUrls and
       * includePaths in this will take precedence
       * over the above.
       *
       * @default {}
       */
      ravenOptions: {},
    }
  }
}

Content Security Policy

To allow Ravenjs to work properly, you need to add a couple of thing to the content security policy rules:

'script-src': "'self' 'unsafe-inline' 'unsafe-eval'",
'img-src': "data: app.getsentry.com",
'connect-src': "'self' app.getsentry.com"

Meaningless stack traces?

See this issue.

Example

The dummy application in tests is a working example with a couple of logging here and there, and a default logger.

Licence

MIT

You can’t perform that action at this time.