Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import bugsnag from '@bugsnag/browser'
import config from './lib/config'
var bugsnagClient = bugsnag(config)
go()
.then(function () {})
.catch(function (e: any) {
bugsnagClient.notify(e)
})
function go() {
return Promise.reject(new Error('bad things'))
}
declare var foo: any
import bugsnag from '@bugsnag/browser'
import config from './lib/config'
var bugsnagClient = bugsnag(config)
try {
foo.bar()
} catch (e) {
bugsnagClient.notify(e)
}
import bugsnag from '@bugsnag/browser';
var ENDPOINT = decodeURIComponent(window.location.search.match(/ENDPOINT=([^&]+)/)[1])
var API_KEY = decodeURIComponent(window.location.search.match(/API_KEY=([^&]+)/)[1])
const bugsnagClient = bugsnag({
apiKey: API_KEY,
endpoints: {
notify: ENDPOINT
},
beforeSend: (report) => {
}
});
export default bugsnagClient;
import bugsnag from '@bugsnag/browser'
import config from './lib/config'
var bugsnagClient = bugsnag(config)
bugsnagClient.notify(new Error('bad things'))