Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- feat(nextjs): Set `sendDefaultPii: true` by default ([#1052](https://github.com/getsentry/sentry-wizard/pull/1052))
- feat(sveltekit): Set `sendDefaultPii: true` by default ([#1055](https://github.com/getsentry/sentry-wizard/pull/1055))

## 6.5.0

Expand Down Expand Up @@ -1117,3 +1118,5 @@ npx @sentry/wizard -s -i reactNative
## v0.1.0

- Inital release
- feat(nextjs): Set `sendDefaultPii: true` by default ([#1052](https://github.com/getsentry/sentry-wizard/pull/1052))
- feat(sveltekit): Set `sendDefaultPii: true` by default ([#1055](https://github.com/getsentry/sentry-wizard/pull/1055))
15 changes: 13 additions & 2 deletions e2e-tests/tests/sveltekit-hooks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ describe('Sveltekit', () => {

// If you don't want to use Session Replay, just remove the line below:
integrations: [replayIntegration()],

// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
sendDefaultPii: true,
});`,
'export const handleError = handleErrorWithSentry(',
]);
Expand All @@ -257,6 +261,11 @@ describe('Sveltekit', () => {
// Enable logs to be sent to Sentry
enableLogs: true,


// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
sendDefaultPii: true,

// uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: import.meta.env.DEV,
});`,
Expand Down Expand Up @@ -308,7 +317,8 @@ describe('Sveltekit', () => {
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1,
integrations: [Sentry.replayIntegration()],
enableLogs: true
enableLogs: true,
sendDefaultPii: true
})`,
'export const handleError = Sentry.handleErrorWithSentry(',
]);
Expand All @@ -320,7 +330,8 @@ describe('Sveltekit', () => {
`Sentry.init({
dsn: "${TEST_ARGS.PROJECT_DSN}",
tracesSampleRate: 1,
enableLogs: true
enableLogs: true,
sendDefaultPii: true
})`,
'export const handleError = Sentry.handleErrorWithSentry();',
]);
Expand Down
4 changes: 4 additions & 0 deletions e2e-tests/tests/sveltekit-tracing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ describe('Sveltekit with instrumentation and tracing', () => {

// If you don't want to use Session Replay, just remove the line below:
integrations: [replayIntegration()],

// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
sendDefaultPii: true,
});

// If you have a custom error handler, pass it to \`handleErrorWithSentry\`
Expand Down
8 changes: 7 additions & 1 deletion src/sveltekit/sdk-setup/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ Skipping adding Sentry functionality to it.`,
Sentry.setTag(`modified-instrumentation-server`, 'success');
}

function insertClientInitCall(
export function insertClientInitCall(
dsn: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
originalHooksMod: ProxifiedModule<any>,
Expand All @@ -439,6 +439,7 @@ function insertClientInitCall(
replaysOnErrorSampleRate?: number;
integrations?: string[];
enableLogs?: boolean;
sendDefaultPii?: boolean;
} = {
dsn,
};
Expand All @@ -457,6 +458,8 @@ function insertClientInitCall(
initArgs.enableLogs = true;
}

initArgs.sendDefaultPii = true;

// This assignment of any values is fine because we're just creating a function call in magicast
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const initCall = builders.functionCall('Sentry.init', initArgs);
Expand Down Expand Up @@ -493,6 +496,7 @@ function insertServerInitCall(
dsn: string;
tracesSampleRate?: number;
enableLogs?: boolean;
sendDefaultPii?: boolean;
} = {
dsn,
};
Expand All @@ -505,6 +509,8 @@ function insertServerInitCall(
initArgs.enableLogs = true;
}

initArgs.sendDefaultPii = true;

// This assignment of any values is fine because we're just creating a function call in magicast
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const initCall = builders.functionCall('Sentry.init', initArgs);
Expand Down
9 changes: 9 additions & 0 deletions src/sveltekit/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ ${
integrations: [replayIntegration()],`
: ''
}

// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
sendDefaultPii: true,
});

// If you have a custom error handler, pass it to \`handleErrorWithSentry\`
Expand Down Expand Up @@ -74,6 +78,11 @@ ${
`
: ''
}

// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
sendDefaultPii: true,

// uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: import.meta.env.DEV,
});`
Expand Down
Loading
Loading