// sentry.client.config.ts — browser SDK init. Runs very early on the client; // useRuntimeConfig() is available here. Loaded automatically by @sentry/nuxt. import * as Sentry from '@sentry/nuxt' import { scrubEvent } from './sentry.scrub' const config = useRuntimeConfig() const dsn = config.public.sentry?.dsn const release = config.public.githash // Empty DSN (dev / kill-switch) → init is skipped and Sentry is a no-op. if (dsn) { Sentry.init({ dsn, environment: config.public.sentry?.environment || 'production', release: release && !String(release).includes('<') ? String(release) : undefined, // Performance: sample 10% of client transactions (page loads + route navigations). tracesSampleRate: 0.1, integrations: [Sentry.browserTracingIntegration()], // PII safety — never attach cookies/headers/body. The shared scrubber is a 2nd line. sendDefaultPii: false, beforeSend: scrubEvent, // Public/customer-facing hardening: the DSN ships in the bundle, so only accept // errors that originate from our own domains (drops noise from extensions/other sites). // Adjust this list if more hostnames serve the app. allowUrls: [/app\.logship\.de/, /dev-app\.logship\.de/, /localhost/], }) }