How to use the rollbar/dist/rollbar.noconflict.umd function in rollbar

To help you get started, we’ve selected a few rollbar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rollbar / rollbar.js / examples / no-conflict / tool.js View on Github external
// 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})
}
github 0xProject / 0x-monorepo / packages / instant / src / util / error_reporter.ts View on Github external
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,
                    },
                },
            },