Files
petvity/instrumentation.ts
T
Mao NakamotoandClaude Opus 4.8 4f1410ba02 feat(observability): Sentry error tracking (env-gated, no-PII)
No-ops until NEXT_PUBLIC_SENTRY_DSN is set. sendDefaultPii=false, traces 0.1,
no replay. Build passes without DSN or auth token.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 18:42:24 +02:00

15 lines
468 B
TypeScript

// Next.js server startup hook — loads the runtime-appropriate Sentry init.
import * as Sentry from "@sentry/nextjs";
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("./sentry.server.config");
}
if (process.env.NEXT_RUNTIME === "edge") {
await import("./sentry.edge.config");
}
}
// Reports errors from nested React Server Components to Sentry.
export const onRequestError = Sentry.captureRequestError;