|
1 | 1 | import { |
| 2 | + breadcrumbsIntegration, |
| 3 | + browserApiErrorsIntegration, |
2 | 4 | BrowserClient, |
3 | 5 | defaultStackParser, |
4 | | - getDefaultIntegrations, |
| 6 | + globalHandlersIntegration, |
5 | 7 | makeFetchTransport, |
| 8 | + dedupeIntegration, |
6 | 9 | Scope, |
7 | | -} from '@sentry/browser'; |
| 10 | +} from "@sentry/browser"; |
8 | 11 |
|
9 | 12 | // Sentry config |
10 | | -// Browser extensions must initialize Sentry a bit differently to avoid |
| 13 | +// Browser extensions must initialize Sentry a bit differently to avoid |
11 | 14 | // conflicts between Sentry instances should the site the extension is running |
12 | 15 | // on also use Sentry. Read more here: |
13 | 16 | // https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/ |
14 | 17 |
|
15 | | -const sentryIntegrations = getDefaultIntegrations({}).filter(defaultIntegration => { |
16 | | - return !['BrowserApiErrors', 'TryCatch', 'Breadcrumbs', 'GlobalHandlers'].includes( |
17 | | - defaultIntegration.name |
18 | | - ); |
19 | | -}); |
20 | | - |
21 | 18 | const sentryClient = new BrowserClient({ |
22 | 19 | // @ts-ignore SENTRY_DSN is populated by Webpack at build time |
23 | 20 | dsn: SENTRY_DSN, |
24 | 21 | transport: makeFetchTransport, |
25 | 22 | stackParser: defaultStackParser, |
26 | | - integrations: sentryIntegrations, |
| 23 | + integrations: [ |
| 24 | + breadcrumbsIntegration, |
| 25 | + browserApiErrorsIntegration, |
| 26 | + globalHandlersIntegration, |
| 27 | + dedupeIntegration, |
| 28 | + ], |
27 | 29 | }); |
28 | 30 |
|
29 | 31 | const Sentry = new Scope(); |
30 | 32 | Sentry.setClient(sentryClient); |
31 | 33 | sentryClient.init(); |
32 | 34 |
|
33 | | -export default Sentry |
| 35 | +export default Sentry; |
0 commit comments