@@ -34,10 +34,14 @@ const SERVER_PLUGGABLE_INTEGRATIONS = ['CaptureConsole', 'Debug', 'Dedupe', 'Ext
3434// External and optional Node.js integration - https://docs.sentry.io/platforms/node/profiling/
3535export const SERVER_PROFILING_INTEGRATION : keyof ProfilingIntegration = 'ProfilingIntegration'
3636
37- function filterDisabledIntegrations < T extends AllIntegrations > ( integrations : T ) : ( keyof T ) [ ] {
37+ function getEnabledIntegrations < T extends AllIntegrations > ( integrations : T ) : ( keyof T ) [ ] {
3838 return getIntegrationsKeys ( integrations ) . filter ( key => integrations [ key ] )
3939}
4040
41+ function getDisabledIntegrationKeys < T extends AllIntegrations > ( integrations : T ) : string [ ] {
42+ return getIntegrationsKeys ( integrations ) . filter ( key => integrations [ key ] === false ) as string [ ]
43+ }
44+
4145function getIntegrationsKeys < T extends AllIntegrations > ( integrations : T ) : ( keyof T ) [ ] {
4246 return Object . keys ( integrations ) as ( keyof T ) [ ]
4347}
@@ -158,6 +162,7 @@ export type ResolvedClientOptions = {
158162 BROWSER_PLUGGABLE_INTEGRATIONS : string [ ]
159163 BROWSER_VUE_INTEGRATIONS : string [ ]
160164 dev : boolean
165+ DISABLED_INTEGRATION_KEYS : string [ ]
161166 runtimeConfigKey : string
162167 config : Options
163168 lazy : boolean | LazyConfiguration
@@ -213,13 +218,14 @@ export async function resolveClientOptions (nuxt: Nuxt, moduleOptions: Readonly<
213218 ...options . config ,
214219 } ,
215220 clientConfigPath,
221+ DISABLED_INTEGRATION_KEYS : getDisabledIntegrationKeys ( options . clientIntegrations ) ,
216222 lazy : options . lazy ,
217223 apiMethods,
218224 customClientIntegrations,
219225 logMockCalls : options . logMockCalls , // for mocked only
220226 tracing : options . tracing ,
221227 initialize : canInitialize ( options ) ,
222- integrations : filterDisabledIntegrations ( options . clientIntegrations )
228+ integrations : getEnabledIntegrations ( options . clientIntegrations )
223229 . reduce ( ( res , key ) => {
224230 res [ key ] = options . clientIntegrations [ key ]
225231 return res
@@ -290,10 +296,10 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly<
290296 }
291297 }
292298
293- options . config . integrations = [
299+ const resolvedIntegrations = [
294300 // Automatically instrument Node.js libraries and frameworks
295301 ...( options . tracing ? autoDiscoverNodePerformanceMonitoringIntegrations ( ) : [ ] ) ,
296- ...filterDisabledIntegrations ( options . serverIntegrations )
302+ ...getEnabledIntegrations ( options . serverIntegrations )
297303 . map ( ( name ) => {
298304 const opt = options . serverIntegrations [ name ]
299305 try {
@@ -314,6 +320,16 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly<
314320 ...customIntegrations ,
315321 ]
316322
323+ const disabledIntegrationKeys = getDisabledIntegrationKeys ( options . serverIntegrations )
324+
325+ // Use a function to be able to filter out default integrations.
326+ options . config . integrations = ( defaultIntegrations ) => {
327+ return [
328+ ...defaultIntegrations . filter ( integration => ! disabledIntegrationKeys . includes ( integration . name ) ) ,
329+ ...resolvedIntegrations ,
330+ ]
331+ }
332+
317333 return {
318334 config : {
319335 dsn : options . dsn ,
0 commit comments