-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsentry.client.config.ts
More file actions
45 lines (36 loc) · 1.11 KB
/
sentry.client.config.ts
File metadata and controls
45 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Sentry client-side configuration for Decision OS.
*
* Initialises the Sentry browser SDK only when NEXT_PUBLIC_SENTRY_DSN is set.
* No PII is captured — Decision OS has no user accounts.
*
* @see https://docs.sentry.io/platforms/javascript/guides/nextjs/
*/
import * as Sentry from "@sentry/nextjs";
const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN;
if (dsn) {
Sentry.init({
dsn,
// Performance monitoring — sample 10% of transactions in production
tracesSampleRate: 0.1,
// Session replay — disabled by default (adds ~50 KB)
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
// Only send errors in production
enabled: process.env.NODE_ENV === "production",
// Strip PII — Decision OS has no user accounts
sendDefaultPii: false,
// Limit breadcrumb noise
maxBreadcrumbs: 30,
// Ignore benign errors
ignoreErrors: [
// Browser extensions
/^ResizeObserver loop/,
/^Non-Error promise rejection/,
// Network errors from optional Supabase sync
"Failed to fetch",
"NetworkError",
"Load failed",
],
});
}