fix(ui): use Sentry namespace for browserTracingIntegration (#9503)

This commit is contained in:
Alan Buscaglia
2025-12-10 16:02:04 +01:00
committed by GitHub
parent 7507fea24b
commit 8588cc03f4
+6 -5
View File
@@ -1,3 +1,5 @@
"use client";
/**
* Client-side Sentry instrumentation
*
@@ -9,12 +11,11 @@
*/
import * as Sentry from "@sentry/nextjs";
import { browserTracingIntegration } from "@sentry/nextjs";
const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN;
// Only initialize Sentry if DSN is configured
if (SENTRY_DSN) {
// Only initialize Sentry in the browser (not during SSR)
if (typeof window !== "undefined" && SENTRY_DSN) {
const isDevelopment = process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "local";
/**
@@ -43,12 +44,12 @@ if (SENTRY_DSN) {
tracesSampleRate: isDevelopment ? 1.0 : 0.5,
profilesSampleRate: isDevelopment ? 1.0 : 0.5,
// 🔌 Integrations
// 🔌 Integrations - browserTracingIntegration is client-only
integrations: [
// 📊 Performance Monitoring: Core Web Vitals + RUM
// Tracks LCP, FID, CLS, INP
// Real User Monitoring captures actual user experience, not synthetic tests
browserTracingIntegration({
Sentry.browserTracingIntegration({
enableLongTask: true, // Detect tasks that block UI (>50ms)
enableInp: true, // Interaction to Next Paint (Core Web Vital)
}),