news-analyze/sentry.client.config.ts
吳元皓 dd61937945 feat: integrate Sentry for error tracking and performance monitoring
- Added Sentry module to nuxt.config.ts and configured it for both client and server.
- Updated package.json to include @sentry/nuxt dependency.
- Created sentry.client.config.ts and sentry.server.config.ts for Sentry initialization with appropriate settings.
- Adjusted route rules and added additional configurations in nuxt.config.ts.
2025-05-11 14:40:22 +08:00

26 lines
961 B
TypeScript

import * as Sentry from "@sentry/nuxt";
Sentry.init({
// If set up, you can use your runtime config here
// dsn: useRuntimeConfig().public.sentry.dsn,
dsn: "https://1bbb1ceec04d13efdffa583ac5453e08@o4507948895174656.ingest.us.sentry.io/4509303135862784",
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0,
// 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
replaysSessionSampleRate: 0.1,
// 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:
integrations: [Sentry.replayIntegration()],
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
});