packer-cn/website/lib/bugsnag.js

19 lines
440 B
JavaScript
Raw Normal View History

2020-03-18 18:46:47 -04:00
import React from 'react'
2020-04-24 04:26:36 -04:00
import Bugsnag from '@bugsnag/js'
import BugsnagReact from '@bugsnag/plugin-react'
2020-03-18 18:46:47 -04:00
const apiKey =
typeof window === 'undefined'
2020-03-31 18:26:45 -04:00
? 'b6c57b27a37e531a5de94f065dd98bc0'
: 'de0b822b269aa57b620efd8927e03744'
2020-03-18 18:46:47 -04:00
2020-04-24 04:26:36 -04:00
if (!Bugsnag._client) {
Bugsnag.start({
apiKey,
plugins: [new BugsnagReact(React)],
otherOptions: { releaseStage: process.env.NODE_ENV || 'development' },
})
}
2020-03-18 18:46:47 -04:00
2020-04-24 04:26:36 -04:00
export default Bugsnag