-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnova.js
56 lines (55 loc) · 2.12 KB
/
nova.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
47
48
49
50
51
52
53
54
55
56
import * as Sentry from "@sentry/vue";
Nova.booting((Vue, router) => {
var sentryDsn = document.head.querySelector('meta[name="sentry-dsn"]').content;
var sentryAppEnv = document.head.querySelector('meta[name="sentry-app-env"]').content;
var sentryRelease = document.head.querySelector('meta[name="sentry-release"]').content;
var sentryUserId = document.head.querySelector('meta[name="sentry-user-id"]');
var sentryUsername = document.head.querySelector('meta[name="sentry-username"]');
if (sentryDsn !== null) {
if (sentryUserId !== null) {
var initialScope = {
user: {
id: sentryUserId.content,
username: sentryUsername.content,
}
}
} else {
var initialScope = {}
}
Sentry.init({
Vue: Vue,
dsn: sentryDsn,
environment: sentryAppEnv,
release: sentryRelease,
initialScope: initialScope,
attachProps: true,
logErrors: true,
tracesSampleRate: 1.0,
tracingOptions: {
trackComponents: true,
},
integrations: [
Sentry.browserTracingIntegration(),
Sentry.feedbackIntegration({
colorScheme: "system",
showName: false,
showEmail: false,
isNameRequired: false,
isEmailRequired: false,
useSentryUser: {
name: 'username',
},
buttonLabel: 'Feedback',
submitButtonLabel: 'Send Feedback',
triggerLabel: 'Feedback',
formTitle: 'Feedback',
messagePlaceholder: 'Describe what you were trying to do, what you expected, and what actually happened.',
successMessageText: 'Thank you for your feedback!',
}),
],
});
window.Sentry = Sentry;
} else {
console.log('Sentry not loaded - DSN not present')
}
})