open-consul/website/lib/bugsnag.js

19 lines
468 B
JavaScript
Raw Normal View History

2020-04-06 20:27:35 +00:00
import React from 'react'
2020-04-23 23:27:40 +00:00
import Bugsnag from '@bugsnag/js'
import BugsnagReact from '@bugsnag/plugin-react'
2020-04-06 20:27:35 +00:00
const apiKey =
typeof window === 'undefined'
2020-04-23 23:27:40 +00:00
? 'be8ed0d0fc887d547284cce9e98e60e5' // server key
: '01625078d856ef022c88f0c78d2364f1' // client key
2020-04-06 20:27:35 +00:00
2020-04-23 23:27:40 +00:00
if (!Bugsnag._client) {
Bugsnag.start({
apiKey,
plugins: [new BugsnagReact(React)],
otherOptions: { releaseStage: process.env.NODE_ENV || 'development' },
})
}
2020-04-06 20:27:35 +00:00
2020-04-23 23:27:40 +00:00
export default Bugsnag