diff --git a/src/main.tsx b/src/main.tsx index 2efd6356..de5988c7 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -3,21 +3,22 @@ import ReactDOM from 'react-dom/client'; import App from './App.tsx'; -Sentry.init({ - dsn: 'https://ff1721b5da5c3ed5ed8c4e4507b6ad51@o4506557086629888.ingest.sentry.io/4506573475741696', - environment: 'produnction', - integrations: [ - new Sentry.BrowserTracing({ - tracePropagationTargets: ['localhost', /^https:\/\/lecue\.me\/api/], - }), - new Sentry.Replay({ - maskAllText: false, - blockAllMedia: false, - }), - ], - tracesSampleRate: 1.0, - replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0, -}); +process.env.NODE_ENV === 'production' && + Sentry.init({ + dsn: 'https://ff1721b5da5c3ed5ed8c4e4507b6ad51@o4506557086629888.ingest.sentry.io/4506573475741696', + + integrations: [ + new Sentry.BrowserTracing({ + tracePropagationTargets: ['localhost', /^https:\/\/lecue\.me\/api/], + }), + new Sentry.Replay({ + maskAllText: false, + blockAllMedia: false, + }), + ], + tracesSampleRate: 1.0, + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0, + }); ReactDOM.createRoot(document.getElementById('root')!).render(); diff --git a/vite.config.ts b/vite.config.ts index bc99bece..28b3d9a6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,6 +12,7 @@ export default defineConfig({ sentryVitePlugin({ org: 'lecue', project: 'javascript-react', + authToken: process.env.SENTRY_AUTH_TOKEN, }), ],