Files
continuwuity/packages/website/src/hooks.client.ts
T

26 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-08-27 18:55:44 +01:00
import { init as initSentry, handleErrorWithSentry, makeBrowserOfflineTransport, makeFetchTransport, replayIntegration } from '@sentry/sveltekit';
2024-08-25 02:42:16 +01:00
2024-08-26 23:12:27 +01:00
initSentry({
dsn: import.meta.env.SENTRY_DSN,
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-08-27 18:55:44 +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();