// apps/cms/instrumentation.ts
// CMS is server-only (Payload admin UI). No instrumentation-client.ts here —
// Payload admin UI bundling is opinionated and the public DSN flow is
// out-of-scope per spec §8.

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["CMS_SENTRY_DSN"],
      app: "cms",
      release: process.env["VERCEL_GIT_COMMIT_SHA"],
    });
  }
}
