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

31 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-08-27 19:24:01 +01:00
import { SENTRY_DSN } from '$lib/config';
2024-09-10 04:11:45 +01:00
import { init as initSentry, handleErrorWithSentry, makeBrowserOfflineTransport, makeFetchTransport, feedbackIntegration } 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,
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,
2024-09-10 04:11:45 +01:00
integrations: [feedbackIntegration({
autoInject: false,
})],
2024-08-26 23:12:27 +01:00
2024-09-10 15:04:31 +01:00
// replay:
// - https://github.com/getsentry/sentry-javascript/tree/develop/packages/replay-worker
// https://docs.sentry.io/platforms/javascript/guides/solidstart/session-replay/configuration/#using-a-custom-compression-worker
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();