-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
50 lines (35 loc) · 1.22 KB
/
index.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
import * as Sentry from "@sentry/browser";
// Initialize Sentry
Sentry.init({
// dsn: "https://568bf2670b44bb594f400742501985d4@o574649.ingest.us.sentry.io/5725912",
});
const modalDialog = document.getElementById('modalDialog');
const modalButton = document.getElementById('modal-btn');
const sentryFeedbackButton = document.getElementById('sentry-feedback-btn');
const modalCloseButton = document.getElementById('modal-close-btn');
function openModal() {
modalDialog.showModal();
}
function closeModal() {
modalDialog.close();
}
async function openSentryUserFeedbackForm() {
const sentryFeedback = Sentry.feedbackIntegration({
autoInject: false,
});
// console.log(feedback)
//
// const form = await feedback.createForm();
// form.appendToDom();
// form.open();
const form = await sentryFeedback.createForm();
form.appendToDom();
form.open();
// Create and render the button
// const widget = feedback.createWidget();
// Later, when it's time to clean up:
// widget.removeFromDom();
}
modalButton.addEventListener('click', openModal);
modalCloseButton.addEventListener('click', closeModal);
sentryFeedbackButton.addEventListener('click', openSentryUserFeedbackForm);