Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Use noconflict so we can embed rollbar.js in this library
var Rollbar = require('rollbar/dist/rollbar.noconflict.umd');
const rollbar = new Rollbar({
accessToken: 'POST_CLIENT_ITEM_TOKEN',
captureUncaught: true,
captureUnhandledRejections: true
})
module.exports = function tool(x) {
rollbar.log('foobar got data', {x})
}
export const setupRollbar = (): any => {
if (rollbar === undefined && ROLLBAR_CLIENT_TOKEN && ROLLBAR_ENABLED) {
const hostDomains = getRollbarHostDomains();
rollbar = new Rollbar({
accessToken: ROLLBAR_CLIENT_TOKEN,
captureUncaught: true,
captureUnhandledRejections: true,
enabled: true,
itemsPerMinute: 10,
maxItems: 500,
payload: {
environment: INSTANT_DISCHARGE_TARGET || `Local ${NODE_ENV}`,
client: {
javascript: {
source_map_enabled: true,
code_version: GIT_SHA,
guess_uncaught_frames: true,
},
},
},