rollbar
Version:
Effortlessly track and debug errors in your JavaScript applications with Rollbar. This package includes advanced error tracking features and an intuitive interface to help you identify and fix issues more quickly.
23 lines (18 loc) • 775 B
JavaScript
var rollbar = require('../rollbar');
var options = (typeof window !== 'undefined') && window._rollbarConfig;
var alias = options && options.globalAlias || 'Rollbar';
var shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;
if ((typeof window !== 'undefined') && !window._rollbarStartTime) {
window._rollbarStartTime = (new Date()).getTime();
}
if (!shimRunning && options) {
var Rollbar = new rollbar(options);
window[alias] = Rollbar;
} else if (typeof window !== 'undefined') {
window.rollbar = rollbar;
window._rollbarDidLoad = true;
} else if (typeof self !== 'undefined') {
self.rollbar = rollbar;
self._rollbarDidLoad = true;
}
module.exports = rollbar;