Files
novalon-website/sentry.client.config.ts
T
zhangxiang 602ed6a671 test(hooks): finalize mutation test improvements and release acceptance
- Raise use-swipe-gesture mutation score to 66.13% (target 65%+)
- Maintain use-reduced-motion mutation score at 76.32% (target 50%+)
- Fix use-reduced-motion.ts ESLint set-state-in-effect warning
- Add UJ-10 deep searcher journey (category browse → article read → content discovery)
- Add 40 new test files (analytics, detail, sections, ui, lib components)
- Update test-strategy-plan.md to v2.0 (sync test count to 1591)
- Sync README.md with final release metrics

Quality gates: TS 0 errors, ESLint 0 errors, 121 suites / 1591 tests passed
2026-08-02 19:39:27 +08:00

78 lines
1.9 KiB
TypeScript

// @ts-nocheck
import * as Sentry from '@sentry/nextjs';
const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN || '';
if (SENTRY_DSN) {
Sentry.init({
dsn: SENTRY_DSN,
environment: process.env.NODE_ENV || 'development',
enabled: process.env.NODE_ENV !== 'development',
tracesSampleRate: process.env.NODE_ENV === 'production' ? 0.2 : 0,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 1.0,
ignoreErrors: [
/_AutofillCallbackHandler/,
/NetworkError/,
/webkit\.messageHandlers/,
/Non-Error promise rejection captured/,
/^Loading CSS chunk.*failed/,
/^Loading chunk.*failed/,
/^Failed to fetch dynamically imported module/,
],
denyUrls: [
/extensions\//i,
/^chrome:\/\//i,
/webappstoolbars/i,
/safari-extension:/i,
/mypersonalassistant/i,
],
initialScope: {
tags: {
project: 'novalon-website',
version: process.env.npm_package_version || 'unknown',
deployment: process.env.NODE_ENV || 'unknown',
},
user: {
id: 'anonymous',
segment: 'visitor',
},
},
beforeSend(event) {
if (event.request?.url) {
event.request.url = event.request.url.replace(/\/[a-f0-9]{32}/gi, '/[hash]');
}
if (event.breadcrumbs) {
event.breadcrumbs = event.breadcrumbs.filter((breadcrumb) => {
return !(
breadcrumb.category === 'console' &&
breadcrumb.level === 'log'
);
});
}
return event;
},
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration({
maskAllText: true,
blockAllMedia: true,
}),
],
});
console.log('[Sentry] Client-side monitoring initialized');
} else {
console.warn('[Sentry] NEXT_PUBLIC_SENTRY_DSN not configured, error monitoring disabled');
}
export default Sentry;