-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgatsby-browser.js
46 lines (36 loc) · 1.09 KB
/
gatsby-browser.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import LogRocket from 'logrocket'
import setupLogRocketReact from 'logrocket-react'
import * as Sentry from '@sentry/gatsby'
const environment = process.env.NODE_ENV
const release = process.env.GATSBY_RELEASE_VERSION
if (environment === 'production') {
LogRocket.init('u8t5r0/damianmullinscom')
setupLogRocketReact(LogRocket)
Sentry.init({
dsn: 'https://[email protected]/1197101',
environment,
release: `damianmullins@${release}`,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration({
maskAllText: false,
blockAllMedia: false
})
],
tracesSampleRate: 1.0,
beforeSend(event) {
const logRocketSession = LogRocket.sessionURL
if (logRocketSession !== null) {
event.extra['LogRocket'] = logRocketSession
return event
} else {
return event
}
}
})
LogRocket.getSessionURL(sessionURL =>
Sentry.getCurrentScope().setExtra('sessionURL', sessionURL)
)
}