-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.tsx
More file actions
54 lines (51 loc) · 1.86 KB
/
main.tsx
File metadata and controls
54 lines (51 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { createRoot } from 'react-dom/client'
import App from '@/App'
import '@/styles/index.css'
import { MutationCache, QueryCache, QueryClient, QueryClientProvider } from '@tanstack/react-query'
import * as Sentry from '@sentry/react'
import { browserTracingIntegration, replayIntegration } from '@sentry/react'
Sentry.init({
dsn: 'https://3d43445cb83fc18b9f27ff7f25d2cb09@o4509157788942336.ingest.us.sentry.io/4509157789925376',
integrations: [browserTracingIntegration(), replayIntegration()],
environment: import.meta.env.MODE,
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ['localhost', import.meta.env.VITE_API_URL],
})
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
refetchOnWindowFocus: false,
},
},
queryCache: new QueryCache({
onError: (error) => {
if (error instanceof Error) {
Sentry.captureException(error)
} else {
Sentry.captureMessage('Unknown Query Error', {
extra: { error },
})
}
},
}),
mutationCache: new MutationCache({
onError: (error) => {
if (error instanceof Error) {
Sentry.captureException(error)
} else {
Sentry.captureMessage('Unknown Mutation Error', {
extra: { error },
})
}
},
}),
})
createRoot(document.getElementById('root')!).render(
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
)