Adds apps/web-next/instrumentation.ts (server) and instrumentation-client.ts (browser) hooks, wraps next.config.mjs with withSentryConfig (R52), and adds the R38 per-app PII scrubber smoke test. Spec deviation: extend PII_KEY_SUBSTRINGS with "ipaddress" so keys like ipAddress trigger key-level redaction (tighter posture than the spec's substring list; existing scrub.test.ts still passes). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
572 B
TypeScript
20 lines
572 B
TypeScript
// apps/web-next/instrumentation.ts
|
|
// Next.js convention: this module runs once on server boot.
|
|
// Delegates to the centralized init helper in core-shared.
|
|
|
|
export async function register() {
|
|
if (
|
|
process.env["NEXT_RUNTIME"] === "nodejs" ||
|
|
process.env["NEXT_RUNTIME"] === "edge"
|
|
) {
|
|
const { initSentryServer } = await import(
|
|
"@repo/core-shared/instrumentation/sentry/init-server"
|
|
);
|
|
initSentryServer({
|
|
dsn: process.env["WEB_NEXT_SENTRY_DSN"],
|
|
app: "web-next",
|
|
release: process.env["VERCEL_GIT_COMMIT_SHA"],
|
|
});
|
|
}
|
|
}
|