Handles all of the boilerplate shit you need to use TrackJS in your fancy Ember application.
Configure TrackJS in your application's config/environment.js
file. Please
see the TrackJS documentation
for specific configuration options.
var ENV = {
trackJs: {
addon: {
url: "path/to/trackjs.js" // provided by TrackJS
},
config: {
token: "1234567890"
}
}
};
if (environment === 'test') {
ENV.trackJs.config.enabled = false;
}
See? Pretty much like you'd expect.
A service is exposed on your routes and controllers that you can use to report
errors instead of having to use the global window.trackJs
object.
export default {
beforeModel: function () {
this.trackjs.track('oh, snap. something bad happened');
}
};
export default Ember.Controller.extend({
reportSomethingForSomeReason: function () {
this.trackjs.track('oh, snap. something bad happened');
}.on('init')
});
ember install:addon ember-cli-trackjs
ember test
ember test --server
ember build