Files
cozsweet-frontend-nextjs/src/instrumentation-client.ts
T

26 lines
878 B
TypeScript

// This file configures the initialization of Sentry on the client.
// The added config here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from "@sentry/nextjs";
import {
getSentryReplayOnErrorSampleRate,
getSentryReplaySessionSampleRate,
getSharedSentryOptions,
} from "@/utils/sentry-config";
Sentry.init({
...getSharedSentryOptions(),
// Add optional integrations for additional features
integrations: [Sentry.replayIntegration()],
// Define how likely Replay events are sampled.
replaysSessionSampleRate: getSentryReplaySessionSampleRate(),
// Define how likely Replay events are sampled when an error occurs.
replaysOnErrorSampleRate: getSentryReplayOnErrorSampleRate(),
});
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;