How to use the @bugsnag/js.start function in @bugsnag/js

To help you get started, we’ve selected a few @bugsnag/js 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 hashicorp / consul / website / lib / bugsnag.js View on Github external
import React from 'react'
import Bugsnag from '@bugsnag/js'
import BugsnagReact from '@bugsnag/plugin-react'

const apiKey =
  typeof window === 'undefined'
    ? 'be8ed0d0fc887d547284cce9e98e60e5' // server key
    : '01625078d856ef022c88f0c78d2364f1' // client key

if (!Bugsnag._client) {
  Bugsnag.start({
    apiKey,
    plugins: [new BugsnagReact(React)],
    otherOptions: { releaseStage: process.env.NODE_ENV || 'development' },
  })
}

export default Bugsnag
github linrock / blitz-tactics / app / javascript / packs / bugsnag.ts View on Github external
import Bugsnag from '@bugsnag/js'

const bugsnagOptions = JSON.parse(
  document.querySelector("#bugsnag-options-json").innerHTML
)
Bugsnag.start(bugsnagOptions);
github hashicorp / packer / website / lib / bugsnag.js View on Github external
import React from 'react'
import Bugsnag from '@bugsnag/js'
import BugsnagReact from '@bugsnag/plugin-react'

const apiKey =
  typeof window === 'undefined'
    ? 'b6c57b27a37e531a5de94f065dd98bc0'
    : 'de0b822b269aa57b620efd8927e03744'

if (!Bugsnag._client) {
  Bugsnag.start({
    apiKey,
    plugins: [new BugsnagReact(React)],
    otherOptions: { releaseStage: process.env.NODE_ENV || 'development' },
  })
}

export default Bugsnag
github Strimoid / Strimoid / resources / assets / js / lara.js View on Github external
$(document).ready(function () {
  if (window.bugsnag_key) {
    const bugsnagClient = Bugsnag.start({
      apiKey: 'a3bfa50249ed28f3be8cb1ac9d0f4666',
      user: {
        name: window.username
      }
    })
  }

  const query = new URLSearchParams(window.location.search)

  axios.defaults.headers.common['X-XSRF-TOKEN'] = Cookies.get('XSRF-TOKEN')
  $.ajaxSetup({
    headers: { 'X-XSRF-TOKEN': Cookies.get('XSRF-TOKEN') }
  })

  const notificationsModule = new NotificationsModule()
  const votesModule = new VotesModule()
github ElMassimo / vite_ruby / examples / rails / app / frontend / integrations / bugsnag.ts View on Github external
import Bugsnag from '@bugsnag/js'
import BugsnagPluginReact from '@bugsnag/plugin-react'

if (process.env.BUGSNAG_API_KEY) {
  Bugsnag.start({
    apiKey: process.env.BUGSNAG_API_KEY,
    plugins: [new BugsnagPluginReact()],
  })

  Bugsnag.notify(new Error('Test Error'))
}

export default Bugsnag
github exercism / website / app / javascript / utils / react-bootloader.jsx View on Github external
import React from 'react'
import ReactDOM from 'react-dom'
import Bugsnag from '@bugsnag/js'
import BugsnagPluginReact from '@bugsnag/plugin-react'

Bugsnag.start({
  apiKey: process.env.BUGSNAG_API_KEY,
  releaseStage: process.env.NODE_ENV,
  plugins: [new BugsnagPluginReact()],
  enabledReleaseStages: ['production'],
  collectUserIp: false,
  onError: function (event) {
    const tag = document.querySelector('meta[name="user-id"]')

    if (!tag) {
      return true
    }

    event.setUser(tag.content)
  },
})

@bugsnag/js

Universal Javascript error reporting. Automatically detect JavaScript errors in the browser and Node.js, with plugins for React, Vue, Angular, Express, Restify and Koa.

MIT
Latest version published 8 days ago

Package Health Score

89 / 100
Full package analysis