@@ -37,18 +37,19 @@ 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- });
4640
4741const client = new BrowserClient ({
4842 dsn: " ___PUBLIC_DSN___" ,
4943 transport: makeFetchTransport,
5044 stackParser: defaultStackParser,
51- integrations: integrations,
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+ ),
5253});
5354
5455const scope = new Scope ();
@@ -89,20 +90,18 @@ function happyIntegration() {
8990 };
9091}
9192
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- );
10093
10194const client1 = new Sentry.BrowserClient ({
10295 dsn: " ___PUBLIC_DSN___" ,
10396 transport: Sentry .makeFetchTransport ,
10497 stackParser: Sentry .defaultStackParser ,
105- integrations: [... integrations, happyIntegration ()],
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+ ],
106105 beforeSend (event ) {
107106 console .log (" client 1" , event );
108107 return null ; // Returning `null` prevents the event from being sent
@@ -115,7 +114,12 @@ const client2 = new Sentry.BrowserClient({
115114 dsn: " ___PUBLIC_DSN___" , // Can be a different DSN
116115 transport: Sentry .makeFetchTransport ,
117116 stackParser: Sentry .defaultStackParser ,
118- integrations: [... integrations, happyIntegration ()],
117+ integrations : (defaultIntegrations ) => [
118+ ... defaultIntegrations .filter (
119+ (integration ) => ! [" BrowserApiErrors" , " Breadcrumbs" , " GlobalHandlers" ].includes (integration .name )
120+ ),
121+ happyIntegration (),
122+ ],
119123 beforeSend (event ) {
120124 console .log (" client 2" , event );
121125 return null ; // Returning `null` prevents the event from being sent
0 commit comments