You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: platform-includes/user-feedback/install/javascript.mdx
+20-9
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,28 @@
1
-
The User Feedback integration is **already included** in your browser or framework SDK NPM packages. If you're using CDN bundles instead of NPM packages, you need to load the User Feedback integration CDN bundle in addition to your browser bundle:
1
+
The User Feedback integration is **already included** in your NPM packages. You don't need to install anything else to use it.
2
2
3
-
```bash {tabTitle:npm}
4
-
npm install @sentry/browser --save
5
-
```
3
+
If you're using the Loader Script, you can lazy load the User Feedback integration like this:
6
4
7
-
```bash {tabTitle:yarn}
8
-
yarn add @sentry/browser
9
-
```
5
+
```javascript {tabTitle: Loader}
6
+
window.sentryOnLoad=function () {
7
+
Sentry.init({
8
+
// add other configuration here
9
+
});
10
10
11
-
```bash {tabTitle:pnpm}
12
-
pnpm add @sentry/browser
11
+
Sentry.lazyLoadIntegration("feedbackIntegration")
12
+
.then((feedbackIntegration) => {
13
+
Sentry.addIntegration(feedbackIntegration({
14
+
// User Feedback configuration options
15
+
}));
16
+
})
17
+
.catch(() => {
18
+
// this can happen if e.g. a network error occurs,
19
+
// in this case User Feedback will not be enabled
20
+
});
21
+
};
13
22
```
14
23
24
+
If you're using CDN bundles instead of NPM packages, you need to use a respective bundle that includes user feedback:
25
+
15
26
```html {tabTitle: CDN}
16
27
<!-- Recommended: Use this bundle for feedback, replay, error, and tracing -->
0 commit comments