Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/quality/sentry/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@

import * as Sentry from "@sentry/react";

const SENTRY_DSN = import.meta.env.VITE_SENTRY_DSN || "";
const isSentryEnabled = Boolean(SENTRY_DSN);
// Only used locally for debugging (fake or optional DSN)
const LOCAL_SENTRY_DSN = import.meta.env.VITE_SENTRY_DSN || "";

const isLocal = import.meta.env.DEV;
const isSentryEnabled = isLocal ? Boolean(LOCAL_SENTRY_DSN) : true;

if (isSentryEnabled) {
Sentry.init({
dsn: "https://pocket@pbt@mock/699",
dsn: "https://example@fake/0",
tunnel: "https://pocket-pbt.netlify.app/.netlify/functions/sentry-tunnel",
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1.0,
tracePropagationTargets: ["localhost", /^\//],
sendDefaultPii: true,
});
console.info("✅ Sentry initialized");

console.info("✅ Sentry initialized" + (isLocal ? " (local mode)" : ""));
} else {
console.warn("⚠️ Sentry DSN not set — running without error tracking");
}
Expand Down