// apps/web-tanstack/src/instrumentation-client.ts
// Browser-entry hook. Imported at the top of the client entry file.
import { initSentryClientReact } from "@repo/core-shared/instrumentation/sentry/init-client-react";

function getNonce(): string {
  if (typeof document === "undefined") return "";
  return (
    document.querySelector('meta[name="csp-nonce"]')?.getAttribute("content") ??
    ""
  );
}

initSentryClientReact({
  dsn: import.meta.env["VITE_WEB_TANSTACK_SENTRY_DSN"],
  app: "web-tanstack",
  release: import.meta.env["VITE_GIT_COMMIT_SHA"],
  nonce: getNonce(),
});
