// 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"],
    });
  }
}
