@umituz/react-native-sentry 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as Sentry from '@sentry/react-native';
|
|
7
|
+
import type { SeverityLevel } from '@sentry/types';
|
|
7
8
|
import type { SentryConfig } from '../../domain/entities/SentryConfig';
|
|
8
9
|
import type { UserData, Breadcrumb } from '../../domain/value-objects/ErrorMetadata';
|
|
9
10
|
import type { CaptureMetadata, MessageLevel } from '../../application/ports/ISentryClient';
|
|
@@ -39,20 +40,10 @@ export const nativeSentryAdapter: NativeSentryAdapter = {
|
|
|
39
40
|
debug: config.debug ?? false,
|
|
40
41
|
enableAutoPerformanceTracing: true,
|
|
41
42
|
enableNativeCrashHandling: true,
|
|
42
|
-
|
|
43
|
-
// Session Replay
|
|
44
|
-
replaysSessionSampleRate: config.replaysSessionSampleRate ?? 0.1,
|
|
45
|
-
replaysOnErrorSampleRate: config.replaysOnErrorSampleRate ?? 1.0,
|
|
46
43
|
integrations: integrations.length > 0 ? integrations : undefined,
|
|
47
|
-
|
|
48
|
-
// Logs
|
|
49
|
-
enableLogs: config.enableLogs ?? false,
|
|
50
|
-
|
|
51
|
-
// PII
|
|
52
44
|
sendDefaultPii: config.sendDefaultPii ?? false,
|
|
53
45
|
|
|
54
46
|
beforeSend: (event) => {
|
|
55
|
-
// Privacy: Mask email in production unless sendDefaultPii is true
|
|
56
47
|
if (!__DEV__ && !config.sendDefaultPii && event.user?.email) {
|
|
57
48
|
event.user.email = '***@***.***';
|
|
58
49
|
}
|
|
@@ -71,7 +62,7 @@ export const nativeSentryAdapter: NativeSentryAdapter = {
|
|
|
71
62
|
|
|
72
63
|
captureMessage(message: string, level?: MessageLevel, metadata?: CaptureMetadata): string | undefined {
|
|
73
64
|
return Sentry.captureMessage(message, {
|
|
74
|
-
level: level as
|
|
65
|
+
level: level as SeverityLevel,
|
|
75
66
|
tags: metadata?.tags,
|
|
76
67
|
extra: metadata?.extra,
|
|
77
68
|
user: metadata?.user,
|
|
@@ -82,7 +73,7 @@ export const nativeSentryAdapter: NativeSentryAdapter = {
|
|
|
82
73
|
Sentry.addBreadcrumb({
|
|
83
74
|
message: breadcrumb.message,
|
|
84
75
|
category: breadcrumb.category,
|
|
85
|
-
level: breadcrumb.level as
|
|
76
|
+
level: breadcrumb.level as SeverityLevel,
|
|
86
77
|
data: breadcrumb.data,
|
|
87
78
|
timestamp: breadcrumb.timestamp,
|
|
88
79
|
});
|