Skip to content

Commit 413d62d

Browse files
committed
misc: Update integrations example in browser
1 parent 13029ed commit 413d62d

File tree

1 file changed

+6
-4
lines changed
  • packages/browser/examples

1 file changed

+6
-4
lines changed

packages/browser/examples/app.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ class HappyIntegration {
55
}
66

77
setupOnce() {
8-
Sentry.configureScope(scope => {
9-
scope.addEventProcessor(async event => {
8+
Sentry.addGlobalEventProcessor(async (event) => {
9+
const self = getCurrentHub().getIntegration(HappyIntegration);
10+
// Run the integration ONLY when it was installed on the current Hub
11+
if (self) {
1012
if (event.message === "Happy Message") {
1113
event.message = `\\o/ ${event.message} \\o/`;
1214
}
13-
return event;
14-
});
15+
}
16+
return event;
1517
});
1618
}
1719
}

0 commit comments

Comments
 (0)