Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global __VERSION_SHA__ */
import Rollbar from 'rollbar/dist/rollbar.umd';
let rollbar;
if (process.env.NODE_ENV === 'production') {
rollbar = new Rollbar({
accessToken: '1843589282464f4facd43f794c8201a8',
captureUncaught: true,
enabled: process.env.NODE_ENV === 'production',
payload: {
environment: 'electron_renderer',
client: {
javascript: {
code_version: __VERSION_SHA__,
guess_uncaught_frames: true
}
},
server: {
root: 'webpack:///./'
}
},
// to deal with URI's as local filesystem paths, we use the "many domain" transform:
if (trace && trace.frames) {
for (const [i, frame] of trace.frames.entries()) {
const filename = frame.filename;
if (filename) {
const name = filename.replace(
window.location.hostname,
'dynamichost',
);
trace.frames[i].filename = name;
}
}
}
},
};
export default new rollbar(config);