forked from snapshot-labs/snapshot-v1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsentry.ts
33 lines (29 loc) · 745 Bytes
/
sentry.ts
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
import * as Sentry from '@sentry/vue';
export const initSentry = (app, router) => {
const dsn = import.meta.env.VITE_SENTRY_DSN;
if (!dsn) {
return;
}
Sentry.init({
app,
tunnel: `${import.meta.env.VITE_SIDEKICK_URL}/sentry`,
dsn,
integrations: [
new Sentry.BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router)
}),
new Sentry.Replay()
],
sampleRate: 0.01,
maxBreadcrumbs: 50,
tracingOptions: {
trackComponents: true
},
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
denyUrls: [/extensions\//i, /^chrome:\/\//i, /^chrome-extension:\/\//i]
});
};
export const setUser = user => {
Sentry.setUser(user);
};