Skip to content

Commit 4b3f6f6

Browse files
mydeawhitep4nth3r
andauthored
fix(js): Fix docs for using feedback with the Loader (#12140)
--------- Co-authored-by: Salma Alam-Naylor <[email protected]>
1 parent 24b5b6d commit 4b3f6f6

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

platform-includes/user-feedback/install/javascript.mdx

+20-9
Original file line numberDiff line numberDiff 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.
22

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:
64

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+
});
1010

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+
};
1322
```
1423

24+
If you're using CDN bundles instead of NPM packages, you need to use a respective bundle that includes user feedback:
25+
1526
```html {tabTitle: CDN}
1627
<!-- Recommended: Use this bundle for feedback, replay, error, and tracing -->
1728
<script

0 commit comments

Comments
 (0)