-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsentry.client.config.ts
More file actions
56 lines (47 loc) · 1.49 KB
/
sentry.client.config.ts
File metadata and controls
56 lines (47 loc) · 1.49 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
46
47
48
49
50
51
52
53
54
55
56
/**
* Sentry Client-side Configuration
*
* Initializes Sentry error tracking for the browser runtime.
* This config is loaded via instrumentation when the app starts.
*/
import * as Sentry from "@sentry/nextjs";
const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN;
// Only initialize if DSN is configured
if (dsn) {
Sentry.init({
dsn,
// Performance Monitoring
// Capture 10% of transactions in production, 100% in development
tracesSampleRate: process.env.NODE_ENV === "production" ? 0.1 : 1.0,
// Session Replay for debugging user interactions
// Capture 10% of sessions, 100% on error
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
// Only send errors in production
enabled: process.env.NODE_ENV === "production",
// Environment tagging
environment: process.env.NODE_ENV,
// Filter out noisy errors
ignoreErrors: [
// Browser extensions
/^chrome-extension:\/\//,
/^moz-extension:\/\//,
// Network errors that are often transient
"Network request failed",
"Failed to fetch",
"Load failed",
// User aborted requests
"AbortError",
// Resize observer loop limit (benign)
"ResizeObserver loop limit exceeded",
"ResizeObserver loop completed with undelivered notifications",
],
integrations: [
Sentry.replayIntegration({
// Mask all text and block all media for privacy
maskAllText: true,
blockAllMedia: true,
}),
],
});
}