@@ -37,19 +37,18 @@ import {
3737 Scope ,
3838} from " @sentry/browser" ;
3939
40+ // filter integrations that use the global variable
41+ const integrations = getDefaultIntegrations ({}).filter ((defaultIntegration ) => {
42+ return ! [" BrowserApiErrors" , " Breadcrumbs" , " GlobalHandlers" ].includes (
43+ defaultIntegration .name
44+ );
45+ });
4046
4147const client = new BrowserClient ({
4248 dsn: " ___PUBLIC_DSN___" ,
4349 transport: makeFetchTransport,
4450 stackParser: defaultStackParser,
45- // filter integrations that use the global variable
46- integrations : (defaultIntegrations ) =>
47- defaultIntegrations .filter (
48- (integration ) =>
49- ! [" BrowserApiErrors" , " Breadcrumbs" , " GlobalHandlers" ].includes (
50- integration .name
51- )
52- ),
51+ integrations: integrations,
5352});
5453
5554const scope = new Scope ();
@@ -90,18 +89,20 @@ function happyIntegration() {
9089 };
9190}
9291
92+ // filter integrations that use the global variable
93+ const integrations = Sentry .getDefaultIntegrations ({}).filter (
94+ (defaultIntegration ) => {
95+ return ! [" BrowserApiErrors" , " Breadcrumbs" , " GlobalHandlers" ].includes (
96+ defaultIntegration .name
97+ );
98+ }
99+ );
93100
94101const client1 = new Sentry.BrowserClient ({
95102 dsn: " ___PUBLIC_DSN___" ,
96103 transport: Sentry .makeFetchTransport ,
97104 stackParser: Sentry .defaultStackParser ,
98- // filter integrations that use the global variable
99- integrations : (defaultIntegrations ) => [
100- ... defaultIntegrations .filter (
101- (integration ) => ! [" BrowserApiErrors" , " Breadcrumbs" , " GlobalHandlers" ].includes (integration .name )
102- ),
103- happyIntegration (),
104- ],
105+ integrations: [... integrations, happyIntegration ()],
105106 beforeSend (event ) {
106107 console .log (" client 1" , event );
107108 return null ; // Returning `null` prevents the event from being sent
@@ -114,12 +115,7 @@ const client2 = new Sentry.BrowserClient({
114115 dsn: " ___PUBLIC_DSN___" , // Can be a different DSN
115116 transport: Sentry .makeFetchTransport ,
116117 stackParser: Sentry .defaultStackParser ,
117- integrations : (defaultIntegrations ) => [
118- ... defaultIntegrations .filter (
119- (integration ) => ! [" BrowserApiErrors" , " Breadcrumbs" , " GlobalHandlers" ].includes (integration .name )
120- ),
121- happyIntegration (),
122- ],
118+ integrations: [... integrations, happyIntegration ()],
123119 beforeSend (event ) {
124120 console .log (" client 2" , event );
125121 return null ; // Returning `null` prevents the event from being sent
0 commit comments