Files
resolutionflow/frontend/src/instrument.ts
chihlasm ff9b5b2195 fix: remove hardcoded Sentry DSN fallback — use env var only
VITE_SENTRY_DSN is already set in Railway as a build arg. The hardcoded
fallback was unnecessary and triggered GitHub secret scanning alerts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 04:56:10 +00:00

31 lines
858 B
TypeScript

import * as Sentry from "@sentry/react";
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
environment: import.meta.env.MODE,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration({
maskAllText: false,
blockAllMedia: false,
}),
// Crash feedback dialog — prompts users after unhandled errors
Sentry.feedbackIntegration({
autoInject: false,
colorScheme: "dark",
}),
],
// Tracing — capture 100% in dev, 20% in production
tracesSampleRate: import.meta.env.PROD ? 0.2 : 1.0,
tracePropagationTargets: [
"localhost",
/^https:\/\/api\.resolutionflow\.com/,
],
// Session Replay — conserve free-plan quota
// 1% of normal sessions, 100% of error sessions
replaysSessionSampleRate: import.meta.env.PROD ? 0.01 : 0.0,
replaysOnErrorSampleRate: 1.0,
});