From 6d03757ded2706c2f47dfcd1253d220acc75bac8 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 7 Jan 2026 15:07:48 +0100 Subject: [PATCH 1/2] fix(nuxt): Allow overwriting server-side `defaultIntegrations` --- packages/nuxt/src/server/sdk.ts | 5 +---- packages/nuxt/test/client/sdk.test.ts | 24 ++++++++++++++++++++++++ packages/nuxt/test/server/sdk.test.ts | 24 ++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/packages/nuxt/src/server/sdk.ts b/packages/nuxt/src/server/sdk.ts index 2b492b1249ac..3126596700d8 100644 --- a/packages/nuxt/src/server/sdk.ts +++ b/packages/nuxt/src/server/sdk.ts @@ -16,10 +16,7 @@ import type { SentryNuxtServerOptions } from '../common/types'; * @param options Configuration options for the SDK. */ export function init(options: SentryNuxtServerOptions): Client | undefined { - const sentryOptions = { - ...options, - defaultIntegrations: getNuxtDefaultIntegrations(options), - }; + const sentryOptions = { defaultIntegrations: getNuxtDefaultIntegrations(options), ...options }; applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'node']); diff --git a/packages/nuxt/test/client/sdk.test.ts b/packages/nuxt/test/client/sdk.test.ts index 29448c720ea4..09c66eb91114 100644 --- a/packages/nuxt/test/client/sdk.test.ts +++ b/packages/nuxt/test/client/sdk.test.ts @@ -41,5 +41,29 @@ describe('Nuxt Client SDK', () => { it('returns client from init', () => { expect(init({})).not.toBeUndefined(); }); + + it('uses default integrations when not provided in options', () => { + init({ dsn: 'https://public@dsn.ingest.sentry.io/1337' }); + + expect(browserInit).toHaveBeenCalledTimes(1); + const callArgs = browserInit.mock.calls[0]?.[0]; + expect(callArgs).toBeDefined(); + expect(callArgs?.defaultIntegrations).toBeDefined(); + expect(Array.isArray(callArgs?.defaultIntegrations)).toBe(true); + }); + + it('allows options.defaultIntegrations to override default integrations', () => { + const customIntegrations = [{ name: 'CustomIntegration' }]; + + init({ + dsn: 'https://public@dsn.ingest.sentry.io/1337', + defaultIntegrations: customIntegrations as any, + }); + + expect(browserInit).toHaveBeenCalledTimes(1); + const callArgs = browserInit.mock.calls[0]?.[0]; + expect(callArgs).toBeDefined(); + expect(callArgs?.defaultIntegrations).toBe(customIntegrations); + }); }); }); diff --git a/packages/nuxt/test/server/sdk.test.ts b/packages/nuxt/test/server/sdk.test.ts index 626b574612b0..55a5072624c1 100644 --- a/packages/nuxt/test/server/sdk.test.ts +++ b/packages/nuxt/test/server/sdk.test.ts @@ -41,6 +41,30 @@ describe('Nuxt Server SDK', () => { expect(init({})).not.toBeUndefined(); }); + it('uses default integrations when not provided in options', () => { + init({ dsn: 'https://public@dsn.ingest.sentry.io/1337' }); + + expect(nodeInit).toHaveBeenCalledTimes(1); + const callArgs = nodeInit.mock.calls[0]?.[0]; + expect(callArgs).toBeDefined(); + expect(callArgs?.defaultIntegrations).toBeDefined(); + expect(Array.isArray(callArgs?.defaultIntegrations)).toBe(true); + }); + + it('allows options.defaultIntegrations to override default integrations', () => { + const customIntegrations = [{ name: 'CustomIntegration' }]; + + init({ + dsn: 'https://public@dsn.ingest.sentry.io/1337', + defaultIntegrations: customIntegrations as any, + }); + + expect(nodeInit).toHaveBeenCalledTimes(1); + const callArgs = nodeInit.mock.calls[0]?.[0]; + expect(callArgs).toBeDefined(); + expect(callArgs?.defaultIntegrations).toBe(customIntegrations); + }); + describe('lowQualityTransactionsFilter', () => { const options = { debug: false }; const filter = lowQualityTransactionsFilter(options); From 031fe06d863abe8fed3cefa38d5ce78a1dc3ce3f Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 7 Jan 2026 15:11:43 +0100 Subject: [PATCH 2/2] test for allowing `false` --- packages/nuxt/test/client/sdk.test.ts | 12 ++++++++++++ packages/nuxt/test/server/sdk.test.ts | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/packages/nuxt/test/client/sdk.test.ts b/packages/nuxt/test/client/sdk.test.ts index 09c66eb91114..833872069e4e 100644 --- a/packages/nuxt/test/client/sdk.test.ts +++ b/packages/nuxt/test/client/sdk.test.ts @@ -65,5 +65,17 @@ describe('Nuxt Client SDK', () => { expect(callArgs).toBeDefined(); expect(callArgs?.defaultIntegrations).toBe(customIntegrations); }); + + it('allows options.defaultIntegrations to be set to false', () => { + init({ + dsn: 'https://public@dsn.ingest.sentry.io/1337', + defaultIntegrations: false, + }); + + expect(browserInit).toHaveBeenCalledTimes(1); + const callArgs = browserInit.mock.calls[0]?.[0]; + expect(callArgs).toBeDefined(); + expect(callArgs?.defaultIntegrations).toBe(false); + }); }); }); diff --git a/packages/nuxt/test/server/sdk.test.ts b/packages/nuxt/test/server/sdk.test.ts index 55a5072624c1..c2565217d138 100644 --- a/packages/nuxt/test/server/sdk.test.ts +++ b/packages/nuxt/test/server/sdk.test.ts @@ -65,6 +65,18 @@ describe('Nuxt Server SDK', () => { expect(callArgs?.defaultIntegrations).toBe(customIntegrations); }); + it('allows options.defaultIntegrations to be set to false', () => { + init({ + dsn: 'https://public@dsn.ingest.sentry.io/1337', + defaultIntegrations: false, + }); + + expect(nodeInit).toHaveBeenCalledTimes(1); + const callArgs = nodeInit.mock.calls[0]?.[0]; + expect(callArgs).toBeDefined(); + expect(callArgs?.defaultIntegrations).toBe(false); + }); + describe('lowQualityTransactionsFilter', () => { const options = { debug: false }; const filter = lowQualityTransactionsFilter(options);