2024-08-27 19:24:01 +01:00
|
|
|
import { SENTRY_DSN } from '$lib/config';
|
2024-09-10 01:30:40 +01:00
|
|
|
import { init as initSentry, handleErrorWithSentry, makeBrowserOfflineTransport, makeFetchTransport } from '@sentry/sveltekit';
|
2024-08-25 02:42:16 +01:00
|
|
|
|
2024-08-26 23:12:27 +01:00
|
|
|
initSentry({
|
2024-08-27 19:24:01 +01:00
|
|
|
dsn: SENTRY_DSN,
|
2024-08-27 18:51:11 +01:00
|
|
|
environment: import.meta.env.MODE,
|
2024-08-26 23:12:27 +01:00
|
|
|
tracesSampleRate: 1.0,
|
2024-08-25 02:42:16 +01:00
|
|
|
|
2024-08-26 23:12:27 +01:00
|
|
|
// This sets the sample rate to be 10%. You may want this to be 100% while
|
|
|
|
|
// in development and sample at a lower rate in production
|
2024-08-27 18:55:44 +01:00
|
|
|
replaysSessionSampleRate: 0.0,
|
2024-08-25 02:42:16 +01:00
|
|
|
|
2024-08-26 23:12:27 +01:00
|
|
|
// If the entire session is not sampled, use the below sample rate to sample
|
|
|
|
|
// sessions when an error occurs.
|
|
|
|
|
replaysOnErrorSampleRate: 1.0,
|
|
|
|
|
|
|
|
|
|
// If you don't want to use Session Replay, just remove the line below:
|
2024-09-10 01:30:40 +01:00
|
|
|
// integrations: [replayIntegration()],
|
2024-08-26 23:12:27 +01:00
|
|
|
|
|
|
|
|
// To enable offline events caching, use makeBrowserOfflineTransport to wrap
|
|
|
|
|
// existing transports and queue events using the browsers' IndexedDB storage
|
|
|
|
|
transport: makeBrowserOfflineTransport(makeFetchTransport),
|
2024-08-25 02:42:16 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// If you have a custom error handler, pass it to `handleErrorWithSentry`
|
|
|
|
|
export const handleError = handleErrorWithSentry();
|