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
+26-8Lines changed: 26 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,35 @@
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 can enable it by adding it to your `integrations`in your `init` config:
2
2
3
-
```bash {tabTitle:npm}
4
-
npm install @sentry/browser --save
5
-
```
3
+
```javascript {tabTitle: NPM}
4
+
import*asSentryfrom"@sentry/browser";
6
5
7
-
```bash {tabTitle:yarn}
8
-
yarn add @sentry/browser
6
+
Sentry.init({
7
+
dsn:"___DSN___",
8
+
integrations: [Sentry.feedbackIntegration()],
9
+
});
9
10
```
10
11
11
-
```bash {tabTitle:pnpm}
12
-
pnpm add @sentry/browser
12
+
If you're using the Loader Script, you can lazy load the User Feedback integration like this:
13
+
14
+
```javascript {tabTitle: Loader}
15
+
window.sentryOnLoad=function () {
16
+
Sentry.init({
17
+
// add other configuration here
18
+
});
19
+
20
+
Sentry.lazyLoadIntegration("feedbackIntegration")
21
+
.then((feedbackIntegration) => {
22
+
Sentry.addIntegration(feedbackIntegration());
23
+
})
24
+
.catch(() => {
25
+
// this can happen if e.g. a network error occurs,
26
+
// in this case User Feedback will not be enabled
27
+
});
28
+
};
13
29
```
14
30
31
+
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:
32
+
15
33
```html {tabTitle: CDN}
16
34
<!-- Recommended: Use this bundle for feedback, replay, error, and tracing -->
0 commit comments