// Next.js server instrumentation entry point. A no-op when NEXT_PUBLIC_SENTRY_DSN isn't // set — see instrumentation-client.ts for the browser-side counterpart. // // Node runtime only, deliberately — this app's middleware.ts (which runs in Next's edge // runtime) is a trivial pass-through with no real error surface, so an edge-runtime branch // here would only inflate that shared middleware bundle for no actual coverage benefit. export async function register() { if (!process.env.NEXT_PUBLIC_SENTRY_DSN) return; if (process.env.NEXT_RUNTIME !== "nodejs") return; const Sentry = await import("@sentry/nextjs"); Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NODE_ENV || "development", tracesSampleRate: 0.1, }); }