Vite env vars must be present during build — VITE_SENTRY_DSN was likely undefined in Railway's build step, causing Sentry to silently not init. DSN is a public client key (shipped in every browser bundle), not a secret. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import * as Sentry from "@sentry/react";
|
|
|
|
Sentry.init({
|
|
dsn: "https://23937b8c0cea2484f6a9d5b97d0b7d4b@o4511005918887936.ingest.us.sentry.io/4511005926883328",
|
|
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,
|
|
});
|
|
|
|
// TODO: Remove after verifying Sentry is receiving frontend events
|
|
if (import.meta.env.PROD) {
|
|
Sentry.captureException(new Error("ResolutionFlow frontend Sentry verification"));
|
|
}
|