gendesign/frontend/sentry.client.config.ts
lekss361 653e74f6b7 feat(frontend): @sentry/nextjs init for GlitchTip self-hosted (#204)
- Add @sentry/nextjs@10.53.1
- sentry.{client,server,edge}.config.ts — GlitchTip-compatible init
  (no Replay, tracesSampleRate=0.05, guarded on DSN presence)
- src/instrumentation.ts — register() + captureRequestError export
- next.config.ts — wrapped in withSentryConfig (v10 API:
  treeshake.removeDebugLogging, sourcemaps.deleteSourcemapsAfterUpload)
- .env.example — NEXT_PUBLIC_GLITCHTIP_DSN + SENTRY_* vars
- .gitignore — .sentryclirc exclusion
2026-05-16 18:04:13 +03:00

14 lines
397 B
TypeScript

import * as Sentry from "@sentry/nextjs";
const dsn = process.env.NEXT_PUBLIC_GLITCHTIP_DSN;
if (dsn) {
Sentry.init({
dsn,
environment: process.env.NEXT_PUBLIC_ENVIRONMENT ?? "development",
tracesSampleRate: 0.05,
// GlitchTip does not support Session Replay — disable explicitly
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
integrations: [],
});
}