@sentry/react-native 7.10.0 → 7.11.0

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.
Binary file
@@ -933,6 +933,26 @@ public class RNSentryModuleImpl {
933
933
  });
934
934
  }
935
935
 
936
+ public void setAttribute(String key, String value) {
937
+ // TODO(alwx): This is not implemented in sentry-android yet
938
+ /*
939
+ * Sentry.configureScope(
940
+ * scope -> {
941
+ * scope.setAttribute(key, value);
942
+ * });
943
+ */
944
+ }
945
+
946
+ public void setAttributes(ReadableMap attributes) {
947
+ // TODO(alwx): This is not implemented in sentry-android yet
948
+ /*
949
+ * Sentry.configureScope(
950
+ * scope -> {
951
+ * scope.setAttributes(attributes);
952
+ * });
953
+ */
954
+ }
955
+
936
956
  public void closeNativeSdk(Promise promise) {
937
957
  Sentry.close();
938
958
 
@@ -2,7 +2,7 @@ package io.sentry.react;
2
2
 
3
3
  class RNSentryVersion {
4
4
  static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native";
5
- static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "7.10.0";
5
+ static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "7.11.0";
6
6
  static final String NATIVE_SDK_NAME = "sentry.native.android.react-native";
7
7
  static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
8
8
  static final String REACT_NATIVE_SDK_NAME = "sentry.javascript.react-native";
@@ -112,6 +112,16 @@ public class RNSentryModule extends NativeRNSentrySpec {
112
112
  this.impl.setTag(key, value);
113
113
  }
114
114
 
115
+ @Override
116
+ public void setAttribute(String key, String value) {
117
+ this.impl.setAttribute(key, value);
118
+ }
119
+
120
+ @Override
121
+ public void setAttributes(ReadableMap attributes) {
122
+ this.impl.setAttributes(attributes);
123
+ }
124
+
115
125
  @Override
116
126
  public void closeNativeSdk(Promise promise) {
117
127
  this.impl.closeNativeSdk(promise);
@@ -112,6 +112,16 @@ public class RNSentryModule extends ReactContextBaseJavaModule {
112
112
  this.impl.setTag(key, value);
113
113
  }
114
114
 
115
+ @ReactMethod
116
+ public void setAttribute(String key, String value) {
117
+ this.impl.setAttribute(key, value);
118
+ }
119
+
120
+ @ReactMethod
121
+ public void setAttributes(ReadableMap attributes) {
122
+ this.impl.setAttributes(attributes);
123
+ }
124
+
115
125
  @ReactMethod
116
126
  public void closeNativeSdk(Promise promise) {
117
127
  this.impl.closeNativeSdk(promise);
@@ -132,6 +142,11 @@ public class RNSentryModule extends ReactContextBaseJavaModule {
132
142
  this.impl.fetchNativeDeviceContexts(promise);
133
143
  }
134
144
 
145
+ @ReactMethod
146
+ public void fetchNativeLogAttributes(Promise promise) {
147
+ this.impl.fetchNativeLogAttributes(promise);
148
+ }
149
+
135
150
  @ReactMethod
136
151
  public void fetchNativeSdkInfo(Promise promise) {
137
152
  this.impl.fetchNativeSdkInfo(promise);
@@ -25,6 +25,8 @@ export interface Spec extends TurboModule {
25
25
  setContext(key: string, value: UnsafeObject | null): void;
26
26
  setExtra(key: string, value: string): void;
27
27
  setTag(key: string, value: string): void;
28
+ setAttribute(key: string, value: string): void;
29
+ setAttributes(attributes: UnsafeObject): void;
28
30
  enableNativeFramesTracking(): void;
29
31
  fetchModules(): Promise<string | undefined | null>;
30
32
  fetchViewHierarchy(): Promise<number[] | undefined | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRNSentry.d.ts","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAIjE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC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C,CAAC;IACnD,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,EAAE,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;;AAGF,wBAAkE"}
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRNSentry.js","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA6JnD,2DAA2D;AAC3D,eAAe,mBAAmB,CAAC,YAAY,CAAO,UAAU,CAAC,CAAC","sourcesContent":["import type { Package } from '@sentry/core';\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\nimport type { UnsafeObject } from './utils/rnlibrariesinterface';\n\n// There has to be only one interface and it has to be named `Spec`\n// Only extra allowed definitions are types (probably codegen bug)\nexport interface Spec extends TurboModule {\n addListener: (eventType: string) => void;\n removeListeners: (id: number) => void;\n getNewScreenTimeToDisplay(): Promise<number | undefined | null>;\n addBreadcrumb(breadcrumb: UnsafeObject): void;\n captureEnvelope(\n bytes: string,\n options: {\n hardCrashed: boolean;\n },\n ): Promise<boolean>;\n captureScreenshot(): Promise<NativeScreenshot[] | undefined | null>;\n clearBreadcrumbs(): void;\n crash(): void;\n closeNativeSdk(): Promise<void>;\n disableNativeFramesTracking(): void;\n fetchNativeRelease(): Promise<NativeReleaseResponse>;\n fetchNativeSdkInfo(): Promise<Package | null>;\n fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): Promise<NativeAppStartResponse | null>;\n fetchNativeFrames(): Promise<NativeFramesResponse | null>;\n initNativeSdk(options: UnsafeObject): Promise<boolean>;\n setUser(defaultUserKeys: UnsafeObject | null, otherUserKeys: UnsafeObject | null): void;\n setContext(key: string, value: UnsafeObject | null): void;\n setExtra(key: string, value: string): void;\n setTag(key: string, value: string): void;\n enableNativeFramesTracking(): void;\n fetchModules(): Promise<string | undefined | null>;\n fetchViewHierarchy(): Promise<number[] | undefined | null>;\n startProfiling(platformProfilers: boolean): { started?: boolean; error?: string };\n stopProfiling(): {\n profile?: string;\n nativeProfile?: UnsafeObject;\n androidProfile?: UnsafeObject;\n error?: string;\n };\n fetchNativePackageName(): string | undefined | null;\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | undefined | null;\n initNativeReactNavigationNewFrameTracking(): Promise<void>;\n captureReplay(isHardCrash: boolean): Promise<string | undefined | null>;\n getCurrentReplayId(): string | undefined | null;\n crashedLastRun(): Promise<boolean | undefined | null>;\n getDataFromUri(uri: string): Promise<number[]>;\n popTimeToDisplayFor(key: string): Promise<number | undefined | null>;\n setActiveSpanId(spanId: string): boolean;\n encodeToBase64(data: number[]): Promise<string | undefined | null>;\n}\n\nexport type NativeStackFrame = {\n platform: string;\n /**\n * The instruction address of this frame.\n * Formatted as hex with 0x prefix.\n */\n instruction_addr: string;\n package?: string;\n /**\n * The debug image address of this frame.\n * Formatted as hex with 0x prefix.\n */\n image_addr?: string;\n in_app?: boolean;\n /**\n * The symbol name of this frame.\n * If symbolicated locally.\n */\n function?: string;\n /**\n * The symbol address of this frame.\n * If symbolicated locally.\n * Formatted as hex with 0x prefix.\n */\n symbol_addr?: string;\n};\n\nexport type NativeDebugImage = {\n name?: string;\n type?: string;\n uuid?: string;\n debug_id?: string;\n image_addr?: string;\n image_size?: number;\n code_file?: string;\n image_vmaddr?: string;\n};\n\nexport type NativeStackFrames = {\n frames: NativeStackFrame[];\n debugMetaImages?: NativeDebugImage[];\n};\n\nexport type NativeAppStartResponse = {\n type: 'cold' | 'warm' | 'unknown';\n has_fetched: boolean;\n app_start_timestamp_ms?: number;\n spans: {\n description: string;\n start_timestamp_ms: number;\n end_timestamp_ms: number;\n }[];\n};\n\nexport type NativeFramesResponse = {\n totalFrames: number;\n slowFrames: number;\n frozenFrames: number;\n};\n\nexport type NativeReleaseResponse = {\n build: string;\n id: string;\n version: string;\n};\n\n/**\n * This type describes serialized scope from sentry-cocoa and sentry-android\n * https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryScope.m\n * https://github.com/getsentry/sentry-java/blob/a461f7e125b65240004e6162b341f383ce2e1394/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java#L32\n */\nexport type NativeDeviceContextsResponse = {\n [key: string]: unknown;\n tags?: Record<string, string>;\n extra?: Record<string, unknown>;\n contexts?: Record<string, Record<string, unknown>>;\n user?: {\n userId?: string;\n email?: string;\n username?: string;\n ipAddress?: string;\n data?: Record<string, unknown>;\n };\n dist?: string;\n environment?: string;\n fingerprint?: string[];\n level?: string;\n breadcrumbs?: {\n level?: string;\n timestamp?: string;\n category?: string;\n type?: string;\n message?: string;\n data?: Record<string, unknown>;\n }[];\n};\n\nexport type NativeScreenshot = {\n data: number[];\n contentType: string;\n filename: string;\n};\n\n// The export must be here to pass codegen even if not used\nexport default TurboModuleRegistry.getEnforcing<Spec>('RNSentry');\n"]}
1
+ {"version":3,"file":"NativeRNSentry.js","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA+JnD,2DAA2D;AAC3D,eAAe,mBAAmB,CAAC,YAAY,CAAO,UAAU,CAAC,CAAC","sourcesContent":["import type { Package } from '@sentry/core';\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\nimport type { UnsafeObject } from './utils/rnlibrariesinterface';\n\n// There has to be only one interface and it has to be named `Spec`\n// Only extra allowed definitions are types (probably codegen bug)\nexport interface Spec extends TurboModule {\n addListener: (eventType: string) => void;\n removeListeners: (id: number) => void;\n getNewScreenTimeToDisplay(): Promise<number | undefined | null>;\n addBreadcrumb(breadcrumb: UnsafeObject): void;\n captureEnvelope(\n bytes: string,\n options: {\n hardCrashed: boolean;\n },\n ): Promise<boolean>;\n captureScreenshot(): Promise<NativeScreenshot[] | undefined | null>;\n clearBreadcrumbs(): void;\n crash(): void;\n closeNativeSdk(): Promise<void>;\n disableNativeFramesTracking(): void;\n fetchNativeRelease(): Promise<NativeReleaseResponse>;\n fetchNativeSdkInfo(): Promise<Package | null>;\n fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): Promise<NativeAppStartResponse | null>;\n fetchNativeFrames(): Promise<NativeFramesResponse | null>;\n initNativeSdk(options: UnsafeObject): Promise<boolean>;\n setUser(defaultUserKeys: UnsafeObject | null, otherUserKeys: UnsafeObject | null): void;\n setContext(key: string, value: UnsafeObject | null): void;\n setExtra(key: string, value: string): void;\n setTag(key: string, value: string): void;\n setAttribute(key: string, value: string): void;\n setAttributes(attributes: UnsafeObject): void;\n enableNativeFramesTracking(): void;\n fetchModules(): Promise<string | undefined | null>;\n fetchViewHierarchy(): Promise<number[] | undefined | null>;\n startProfiling(platformProfilers: boolean): { started?: boolean; error?: string };\n stopProfiling(): {\n profile?: string;\n nativeProfile?: UnsafeObject;\n androidProfile?: UnsafeObject;\n error?: string;\n };\n fetchNativePackageName(): string | undefined | null;\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | undefined | null;\n initNativeReactNavigationNewFrameTracking(): Promise<void>;\n captureReplay(isHardCrash: boolean): Promise<string | undefined | null>;\n getCurrentReplayId(): string | undefined | null;\n crashedLastRun(): Promise<boolean | undefined | null>;\n getDataFromUri(uri: string): Promise<number[]>;\n popTimeToDisplayFor(key: string): Promise<number | undefined | null>;\n setActiveSpanId(spanId: string): boolean;\n encodeToBase64(data: number[]): Promise<string | undefined | null>;\n}\n\nexport type NativeStackFrame = {\n platform: string;\n /**\n * The instruction address of this frame.\n * Formatted as hex with 0x prefix.\n */\n instruction_addr: string;\n package?: string;\n /**\n * The debug image address of this frame.\n * Formatted as hex with 0x prefix.\n */\n image_addr?: string;\n in_app?: boolean;\n /**\n * The symbol name of this frame.\n * If symbolicated locally.\n */\n function?: string;\n /**\n * The symbol address of this frame.\n * If symbolicated locally.\n * Formatted as hex with 0x prefix.\n */\n symbol_addr?: string;\n};\n\nexport type NativeDebugImage = {\n name?: string;\n type?: string;\n uuid?: string;\n debug_id?: string;\n image_addr?: string;\n image_size?: number;\n code_file?: string;\n image_vmaddr?: string;\n};\n\nexport type NativeStackFrames = {\n frames: NativeStackFrame[];\n debugMetaImages?: NativeDebugImage[];\n};\n\nexport type NativeAppStartResponse = {\n type: 'cold' | 'warm' | 'unknown';\n has_fetched: boolean;\n app_start_timestamp_ms?: number;\n spans: {\n description: string;\n start_timestamp_ms: number;\n end_timestamp_ms: number;\n }[];\n};\n\nexport type NativeFramesResponse = {\n totalFrames: number;\n slowFrames: number;\n frozenFrames: number;\n};\n\nexport type NativeReleaseResponse = {\n build: string;\n id: string;\n version: string;\n};\n\n/**\n * This type describes serialized scope from sentry-cocoa and sentry-android\n * https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryScope.m\n * https://github.com/getsentry/sentry-java/blob/a461f7e125b65240004e6162b341f383ce2e1394/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java#L32\n */\nexport type NativeDeviceContextsResponse = {\n [key: string]: unknown;\n tags?: Record<string, string>;\n extra?: Record<string, unknown>;\n contexts?: Record<string, Record<string, unknown>>;\n user?: {\n userId?: string;\n email?: string;\n username?: string;\n ipAddress?: string;\n data?: Record<string, unknown>;\n };\n dist?: string;\n environment?: string;\n fingerprint?: string[];\n level?: string;\n breadcrumbs?: {\n level?: string;\n timestamp?: string;\n category?: string;\n type?: string;\n message?: string;\n data?: Record<string, unknown>;\n }[];\n};\n\nexport type NativeScreenshot = {\n data: number[];\n contentType: string;\n filename: string;\n};\n\n// The export must be here to pass codegen even if not used\nexport default TurboModuleRegistry.getEnforcing<Spec>('RNSentry');\n"]}
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { debug } from '@sentry/core';
10
+ import { debug, getCurrentScope, getGlobalScope, getIsolationScope } from '@sentry/core';
11
11
  import { NATIVE } from '../wrapper';
12
12
  const INTEGRATION_NAME = 'LogEnricher';
13
13
  export const logEnricherIntegration = () => {
@@ -32,11 +32,11 @@ let NativeCache = undefined;
32
32
  *
33
33
  * @param logAttributes - The log attributes object to modify.
34
34
  * @param key - The attribute key to set.
35
- * @param value - The value to set (only sets if truthy and key not present).
35
+ * @param value - The value to set (only sets if not null/undefined and key not present).
36
36
  * @param setEvenIfPresent - Whether to set the attribute if it is present. Defaults to true.
37
37
  */
38
38
  function setLogAttribute(logAttributes, key, value, setEvenIfPresent = true) {
39
- if (value && (!logAttributes[key] || setEvenIfPresent)) {
39
+ if (value != null && (!logAttributes[key] || setEvenIfPresent)) {
40
40
  logAttributes[key] = value;
41
41
  }
42
42
  }
@@ -69,6 +69,12 @@ function processLog(log, client) {
69
69
  }
70
70
  // Save log.attributes to a new variable
71
71
  const logAttributes = (_a = log.attributes) !== null && _a !== void 0 ? _a : {};
72
+ // Apply scope attributes from all active scopes (global, isolation, and current)
73
+ // These are applied first so they can be overridden by more specific attributes
74
+ const scopeAttributes = collectScopeAttributes();
75
+ Object.keys(scopeAttributes).forEach((key) => {
76
+ setLogAttribute(logAttributes, key, scopeAttributes[key], false);
77
+ });
72
78
  // Use setLogAttribute with the variable instead of direct assignment
73
79
  setLogAttribute(logAttributes, 'device.brand', NativeCache.brand);
74
80
  setLogAttribute(logAttributes, 'device.model', NativeCache.model);
@@ -81,4 +87,38 @@ function processLog(log, client) {
81
87
  // Set log.attributes to the variable
82
88
  log.attributes = logAttributes;
83
89
  }
90
+ /**
91
+ * Extracts primitive attributes from a scope and merges them into the target object.
92
+ * Only string, number, and boolean attribute values are included.
93
+ *
94
+ * @param scope - The scope to extract attributes from
95
+ * @param target - The target object to merge attributes into
96
+ */
97
+ function extractScopeAttributes(scope, target) {
98
+ var _a;
99
+ if (scope && typeof scope.getScopeData === 'function') {
100
+ const scopeAttrs = ((_a = scope === null || scope === void 0 ? void 0 : scope.getScopeData) === null || _a === void 0 ? void 0 : _a.call(scope).attributes) || {};
101
+ Object.keys(scopeAttrs).forEach(key => {
102
+ const value = scopeAttrs[key];
103
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
104
+ target[key] = value;
105
+ }
106
+ });
107
+ }
108
+ }
109
+ /**
110
+ * Collects attributes from all active scopes (global, isolation, and current).
111
+ * Only string, number, and boolean attribute values are supported.
112
+ * Attributes are merged in order of precedence: global < isolation < current.
113
+ *
114
+ * @returns A merged object containing all scope attributes.
115
+ */
116
+ function collectScopeAttributes() {
117
+ const attributes = {};
118
+ // Collect attributes from all scopes in order of precedence
119
+ extractScopeAttributes(getGlobalScope(), attributes);
120
+ extractScopeAttributes(getIsolationScope(), attributes);
121
+ extractScopeAttributes(getCurrentScope(), attributes);
122
+ return attributes;
123
+ }
84
124
  //# sourceMappingURL=logEnricherIntegration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logEnricherIntegration.js","sourceRoot":"","sources":["../../../src/js/integrations/logEnricherIntegration.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IACtD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,KAAK,CAAC,MAAyB;YAC7B,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;gBAC1B,eAAe,EAAE,CAAC,IAAI,CACpB,GAAG,EAAE;oBACH,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAC,GAAQ,EAAE,EAAE;wBACzC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;oBAC1B,CAAC,CAAC,CAAC;gBACL,CAAC,EACD,MAAM,CAAC,EAAE;oBACP,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACpB,CAAC,CACF,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,WAAW,GAAwC,SAAS,CAAC;AAEjE;;;;;;;GAOG;AACH,SAAS,eAAe,CACtB,aAAsC,EACtC,GAAW,EACX,KAAc,EACd,gBAAgB,GAAG,IAAI;IAEvB,IAAI,KAAK,IAAI,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,gBAAgB,CAAC,EAAE;QACtD,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;KAC5B;AACH,CA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CAAC,CAAC;IAClE,eAAe,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAClE,eAAe,CAAC,aAAa,EAAE,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpE,eAAe,CAAC,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IAC1D,eAAe,CAAC,aAAa,EAAE,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAClE,eAAe,CAAC,aAAa,EAAE,gBAAgB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAEtE,MAAM,MAAM,GAAG,MAAM,CAAC,oBAAoB,CAAqD,cAAc,CAAC,CAAC;IAC/G,eAAe,CAAC,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,EAAE,CAAC,CAAC;IAE1E,qCAAqC;IACrC,GAAG,CAAC,UAAU,GAAG,aAAa,CAAC;AACjC,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { Integration, Log } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport type { ReactNativeClient } from '../client';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'LogEnricher';\n\nexport const logEnricherIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setup(client: ReactNativeClient) {\n client.on('afterInit', () => {\n cacheLogContext().then(\n () => {\n client.on('beforeCaptureLog', (log: Log) => {\n processLog(log, client);\n });\n },\n reason => {\n debug.log(reason);\n },\n );\n });\n },\n };\n};\n\nlet NativeCache: Record<string, unknown> | undefined = undefined;\n\n/**\n * Sets a log attribute if the value exists and the attribute key is not already present.\n *\n * @param logAttributes - The log attributes object to modify.\n * @param key - The attribute key to set.\n * @param value - The value to set (only sets if truthy and key not present).\n * @param setEvenIfPresent - Whether to set the attribute if it is present. Defaults to true.\n */\nfunction setLogAttribute(\n logAttributes: Record<string, unknown>,\n key: string,\n value: unknown,\n setEvenIfPresent = true,\n): void {\n if (value && (!logAttributes[key] || setEvenIfPresent)) {\n logAttributes[key] = value;\n }\n}\n\nasync function cacheLogContext(): Promise<void> {\n try {\n const response = await NATIVE.fetchNativeLogAttributes();\n\n NativeCache = {\n ...(response?.contexts?.device && {\n brand: response.contexts.device?.brand,\n model: response.contexts.device?.model,\n family: response.contexts.device?.family,\n }),\n ...(response?.contexts?.os && {\n os: response.contexts.os.name,\n version: response.contexts.os.version,\n }),\n ...(response?.contexts?.release && {\n release: response.contexts.release,\n }),\n };\n } catch (e) {\n return Promise.reject(`[LOGS]: Failed to prepare attributes from Native Layer: ${e}`);\n }\n return Promise.resolve();\n}\n\nfunction processLog(log: Log, client: ReactNativeClient): void {\n if (NativeCache === undefined) {\n return;\n }\n\n // Save log.attributes to a new variable\n const logAttributes = log.attributes ?? {};\n\n // Use setLogAttribute with the variable instead of direct assignment\n setLogAttribute(logAttributes, 'device.brand', NativeCache.brand);\n setLogAttribute(logAttributes, 'device.model', NativeCache.model);\n setLogAttribute(logAttributes, 'device.family', NativeCache.family);\n setLogAttribute(logAttributes, 'os.name', NativeCache.os);\n setLogAttribute(logAttributes, 'os.version', NativeCache.version);\n setLogAttribute(logAttributes, 'sentry.release', NativeCache.release);\n\n const replay = client.getIntegrationByName<Integration & { getReplayId: () => string | null }>('MobileReplay');\n setLogAttribute(logAttributes, 'sentry.replay_id', replay?.getReplayId());\n\n // Set log.attributes to the variable\n log.attributes = logAttributes;\n}\n"]}
1
+ {"version":3,"file":"logEnricherIntegration.js","sourceRoot":"","sources":["../../../src/js/integrations/logEnricherIntegration.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEzF,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,G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,CAAC,CAAC;IACxD,sBAAsB,CAAC,eAAe,EAAE,EAAE,UAAU,CAAC,CAAC;IAEtD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { Integration, Log } from '@sentry/core';\nimport { debug, getCurrentScope, getGlobalScope, getIsolationScope } from '@sentry/core';\nimport type { ReactNativeClient } from '../client';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'LogEnricher';\n\nexport const logEnricherIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setup(client: ReactNativeClient) {\n client.on('afterInit', () => {\n cacheLogContext().then(\n () => {\n client.on('beforeCaptureLog', (log: Log) => {\n processLog(log, client);\n });\n },\n reason => {\n debug.log(reason);\n },\n );\n });\n },\n };\n};\n\nlet NativeCache: Record<string, unknown> | undefined = undefined;\n\n/**\n * Sets a log attribute if the value exists and the attribute key is not already present.\n *\n * @param logAttributes - The log attributes object to modify.\n * @param key - The attribute key to set.\n * @param value - The value to set (only sets if not null/undefined and key not present).\n * @param setEvenIfPresent - Whether to set the attribute if it is present. Defaults to true.\n */\nfunction setLogAttribute(\n logAttributes: Record<string, unknown>,\n key: string,\n value: unknown,\n setEvenIfPresent = true,\n): void {\n if (value != null && (!logAttributes[key] || setEvenIfPresent)) {\n logAttributes[key] = value;\n }\n}\n\nasync function cacheLogContext(): Promise<void> {\n try {\n const response = await NATIVE.fetchNativeLogAttributes();\n\n NativeCache = {\n ...(response?.contexts?.device && {\n brand: response.contexts.device?.brand,\n model: response.contexts.device?.model,\n family: response.contexts.device?.family,\n }),\n ...(response?.contexts?.os && {\n os: response.contexts.os.name,\n version: response.contexts.os.version,\n }),\n ...(response?.contexts?.release && {\n release: response.contexts.release,\n }),\n };\n } catch (e) {\n return Promise.reject(`[LOGS]: Failed to prepare attributes from Native Layer: ${e}`);\n }\n return Promise.resolve();\n}\n\nfunction processLog(log: Log, client: ReactNativeClient): void {\n if (NativeCache === undefined) {\n return;\n }\n\n // Save log.attributes to a new variable\n const logAttributes = log.attributes ?? {};\n\n // Apply scope attributes from all active scopes (global, isolation, and current)\n // These are applied first so they can be overridden by more specific attributes\n const scopeAttributes = collectScopeAttributes();\n Object.keys(scopeAttributes).forEach((key: string) => {\n setLogAttribute(logAttributes, key, scopeAttributes[key], false);\n });\n\n // Use setLogAttribute with the variable instead of direct assignment\n setLogAttribute(logAttributes, 'device.brand', NativeCache.brand);\n setLogAttribute(logAttributes, 'device.model', NativeCache.model);\n setLogAttribute(logAttributes, 'device.family', NativeCache.family);\n setLogAttribute(logAttributes, 'os.name', NativeCache.os);\n setLogAttribute(logAttributes, 'os.version', NativeCache.version);\n setLogAttribute(logAttributes, 'sentry.release', NativeCache.release);\n\n const replay = client.getIntegrationByName<Integration & { getReplayId: () => string | null }>('MobileReplay');\n setLogAttribute(logAttributes, 'sentry.replay_id', replay?.getReplayId());\n\n // Set log.attributes to the variable\n log.attributes = logAttributes;\n}\n\n/**\n * Extracts primitive attributes from a scope and merges them into the target object.\n * Only string, number, and boolean attribute values are included.\n *\n * @param scope - The scope to extract attributes from\n * @param target - The target object to merge attributes into\n */\nfunction extractScopeAttributes(\n scope: ReturnType<typeof getCurrentScope>,\n target: Record<string, string | number | boolean>,\n): void {\n if (scope && typeof scope.getScopeData === 'function') {\n const scopeAttrs = scope?.getScopeData?.().attributes || {};\n Object.keys(scopeAttrs).forEach(key => {\n const value = scopeAttrs[key];\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n target[key] = value;\n }\n });\n }\n}\n\n/**\n * Collects attributes from all active scopes (global, isolation, and current).\n * Only string, number, and boolean attribute values are supported.\n * Attributes are merged in order of precedence: global < isolation < current.\n *\n * @returns A merged object containing all scope attributes.\n */\nfunction collectScopeAttributes(): Record<string, string | number | boolean> {\n const attributes: Record<string, string | number | boolean> = {};\n\n // Collect attributes from all scopes in order of precedence\n extractScopeAttributes(getGlobalScope(), attributes);\n extractScopeAttributes(getIsolationScope(), attributes);\n extractScopeAttributes(getCurrentScope(), attributes);\n\n return attributes;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"scopeSync.d.ts","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,cAAc,CAAC;AAatD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAiErD"}
1
+ {"version":3,"file":"scopeSync.d.ts","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,cAAc,CAAC;AAatD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAyFrD"}
@@ -62,5 +62,26 @@ export function enableSyncToNative(scope) {
62
62
  NATIVE.setContext(key, context);
63
63
  return original.call(scope, key, context);
64
64
  });
65
+ fillTyped(scope, 'setAttribute', original => (key, value) => {
66
+ // Only sync primitive types
67
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
68
+ NATIVE.setAttribute(key, value);
69
+ }
70
+ return original.call(scope, key, value);
71
+ });
72
+ fillTyped(scope, 'setAttributes', original => (attributes) => {
73
+ // Filter to only primitive types
74
+ const primitiveAttrs = {};
75
+ Object.keys(attributes).forEach(key => {
76
+ const value = attributes[key];
77
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
78
+ primitiveAttrs[key] = value;
79
+ }
80
+ });
81
+ if (Object.keys(primitiveAttrs).length > 0) {
82
+ NATIVE.setAttributes(primitiveAttrs);
83
+ }
84
+ return original.call(scope, attributes);
85
+ });
65
86
  }
66
87
  //# sourceMappingURL=scopeSync.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scopeSync.js","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,wB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;QAClD,IAAI,eAAe,EAAE;YACnB,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;SACvC;aAAM;YACL,MAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;SAC3F;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAU,EAAE;QAC3D,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC1B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,8DAA8D;IAC9D,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAW,EAAE,OAAsC,EAAS,EAAE;QACxG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Breadcrumb, Scope } from '@sentry/core';\nimport { logger } from '@sentry/react';\nimport { DEFAULT_BREADCRUMB_LEVEL } from './breadcrumb';\nimport { fillTyped } from './utils/fill';\nimport { convertToNormalizedObject } from './utils/normalize';\nimport { NATIVE } from './wrapper';\n\n/**\n * This WeakMap is used to keep track of which scopes have been synced to the native SDKs.\n * This ensures that we don't double sync the same scope.\n */\nconst syncedToNativeMap = new WeakMap<Scope, true>();\n\n/**\n * Hooks into the scope set methods and sync new data added to the given scope with the native SDKs.\n */\nexport function enableSyncToNative(scope: Scope): void {\n if (syncedToNativeMap.has(scope)) {\n return;\n }\n syncedToNativeMap.set(scope, true);\n\n fillTyped(scope, 'setUser', original => (user): Scope => {\n NATIVE.setUser(user);\n return original.call(scope, user);\n });\n\n fillTyped(scope, 'setTag', original => (key, value): Scope => {\n NATIVE.setTag(key, NATIVE.primitiveProcessor(value));\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'setTags', original => (tags): Scope => {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach(key => {\n NATIVE.setTag(key, NATIVE.primitiveProcessor(tags[key]));\n });\n return original.call(scope, tags);\n });\n\n fillTyped(scope, 'setExtras', original => (extras): Scope => {\n Object.keys(extras).forEach(key => {\n NATIVE.setExtra(key, extras[key]);\n });\n return original.call(scope, extras);\n });\n\n fillTyped(scope, 'setExtra', original => (key, value): Scope => {\n NATIVE.setExtra(key, value);\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'addBreadcrumb', original => (breadcrumb, maxBreadcrumbs): Scope => {\n const mergedBreadcrumb: Breadcrumb = {\n ...breadcrumb,\n level: breadcrumb.level || DEFAULT_BREADCRUMB_LEVEL,\n data: breadcrumb.data ? convertToNormalizedObject(breadcrumb.data) : undefined,\n };\n\n original.call(scope, mergedBreadcrumb, maxBreadcrumbs);\n\n const finalBreadcrumb = scope.getLastBreadcrumb();\n if (finalBreadcrumb) {\n NATIVE.addBreadcrumb(finalBreadcrumb);\n } else {\n logger.warn('[ScopeSync] Last created breadcrumb is undefined. Skipping sync to native.');\n }\n\n return scope;\n });\n\n fillTyped(scope, 'clearBreadcrumbs', original => (): Scope => {\n NATIVE.clearBreadcrumbs();\n return original.call(scope);\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fillTyped(scope, 'setContext', original => (key: string, context: { [key: string]: any } | null): Scope => {\n NATIVE.setContext(key, context);\n return original.call(scope, key, context);\n });\n}\n"]}
1
+ {"version":3,"file":"scopeSync.js","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAA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,CAAC;YAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;gBACxF,cAAc,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aAC7B;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1C,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;SACtC;QACD,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Breadcrumb, Scope } from '@sentry/core';\nimport { logger } from '@sentry/react';\nimport { DEFAULT_BREADCRUMB_LEVEL } from './breadcrumb';\nimport { fillTyped } from './utils/fill';\nimport { convertToNormalizedObject } from './utils/normalize';\nimport { NATIVE } from './wrapper';\n\n/**\n * This WeakMap is used to keep track of which scopes have been synced to the native SDKs.\n * This ensures that we don't double sync the same scope.\n */\nconst syncedToNativeMap = new WeakMap<Scope, true>();\n\n/**\n * Hooks into the scope set methods and sync new data added to the given scope with the native SDKs.\n */\nexport function enableSyncToNative(scope: Scope): void {\n if (syncedToNativeMap.has(scope)) {\n return;\n }\n syncedToNativeMap.set(scope, true);\n\n fillTyped(scope, 'setUser', original => (user): Scope => {\n NATIVE.setUser(user);\n return original.call(scope, user);\n });\n\n fillTyped(scope, 'setTag', original => (key, value): Scope => {\n NATIVE.setTag(key, NATIVE.primitiveProcessor(value));\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'setTags', original => (tags): Scope => {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach(key => {\n NATIVE.setTag(key, NATIVE.primitiveProcessor(tags[key]));\n });\n return original.call(scope, tags);\n });\n\n fillTyped(scope, 'setExtras', original => (extras): Scope => {\n Object.keys(extras).forEach(key => {\n NATIVE.setExtra(key, extras[key]);\n });\n return original.call(scope, extras);\n });\n\n fillTyped(scope, 'setExtra', original => (key, value): Scope => {\n NATIVE.setExtra(key, value);\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'addBreadcrumb', original => (breadcrumb, maxBreadcrumbs): Scope => {\n const mergedBreadcrumb: Breadcrumb = {\n ...breadcrumb,\n level: breadcrumb.level || DEFAULT_BREADCRUMB_LEVEL,\n data: breadcrumb.data ? convertToNormalizedObject(breadcrumb.data) : undefined,\n };\n\n original.call(scope, mergedBreadcrumb, maxBreadcrumbs);\n\n const finalBreadcrumb = scope.getLastBreadcrumb();\n if (finalBreadcrumb) {\n NATIVE.addBreadcrumb(finalBreadcrumb);\n } else {\n logger.warn('[ScopeSync] Last created breadcrumb is undefined. Skipping sync to native.');\n }\n\n return scope;\n });\n\n fillTyped(scope, 'clearBreadcrumbs', original => (): Scope => {\n NATIVE.clearBreadcrumbs();\n return original.call(scope);\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fillTyped(scope, 'setContext', original => (key: string, context: { [key: string]: any } | null): Scope => {\n NATIVE.setContext(key, context);\n return original.call(scope, key, context);\n });\n\n fillTyped(scope, 'setAttribute', original => (key: string, value: unknown): Scope => {\n // Only sync primitive types\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n NATIVE.setAttribute(key, value);\n }\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'setAttributes', original => (attributes: Record<string, unknown>): Scope => {\n // Filter to only primitive types\n const primitiveAttrs: Record<string, string | number | boolean> = {};\n Object.keys(attributes).forEach(key => {\n const value = attributes[key];\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n primitiveAttrs[key] = value;\n }\n });\n\n if (Object.keys(primitiveAttrs).length > 0) {\n NATIVE.setAttributes(primitiveAttrs);\n }\n return original.call(scope, attributes);\n });\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import type { SpanAttributeValue } from '@sentry/core';
1
2
  import * as React from 'react';
2
3
  export type TouchEventBoundaryProps = {
3
4
  /**
@@ -30,6 +31,13 @@ export type TouchEventBoundaryProps = {
30
31
  * Label Name used to identify the touched element.
31
32
  */
32
33
  labelName?: string;
34
+ /**
35
+ * Custom attributes to add to user interaction spans.
36
+ * Accepts an object with string keys and values that are strings, numbers, booleans, or arrays.
37
+ *
38
+ * @experimental This API is experimental and may change in future releases.
39
+ */
40
+ spanAttributes?: Record<string, SpanAttributeValue>;
33
41
  };
34
42
  /**
35
43
  * Boundary to log breadcrumbs for interaction events.
@@ -1 +1 @@
1
- {"version":3,"file":"touchevents.d.ts","sourceRoot":"","sources":["../../src/js/touchevents.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAqCF;;GAEG;AACH,cAAM,kBAAmB,SAAQ,KAAK,CAAC,SAAS,CAAC,uBAAuB,CAAC;IACvE,OAAc,WAAW,EAAE,MAAM,CAAiC;IAClE,OAAc,YAAY,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAK1D;IAEF,SAAgB,IAAI,EAAE,MAAM,CAAwB;IAEpD;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAKhC;;OAEG;IACI,MAAM,IAAI,KAAK,CAAC,SA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uBAAuB,CAAC,CAK1D;IAEF,SAAgB,IAAI,EAAE,MAAM,CAAwB;IAEpD;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAKhC;;OAEG;IACI,MAAM,IAAI,KAAK,CAAC,SAAS;IAYhC;;OAEG;IACH,OAAO,CAAC,cAAc;IAsBtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAoBtB;;;OAGG;IAEH,OAAO,CAAC,aAAa;IA+DrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAuB1B;AA8ED;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,mBAEV,MAAM,aAAa,CAAC,GAAG,CAAC,kBACxB,uBAAuB,KACtC,MAAM,iBAUR,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC"}
@@ -14,6 +14,7 @@ const DEFAULT_BREADCRUMB_CATEGORY = 'touch';
14
14
  const DEFAULT_BREADCRUMB_TYPE = 'user';
15
15
  const DEFAULT_MAX_COMPONENT_TREE_SIZE = 20;
16
16
  const SENTRY_LABEL_PROP_KEY = 'sentry-label';
17
+ const SENTRY_SPAN_ATTRIBUTES_PROP_KEY = 'sentry-span-attributes';
17
18
  const SENTRY_COMPONENT_PROP_KEY = 'data-sentry-component';
18
19
  const SENTRY_ELEMENT_PROP_KEY = 'data-sentry-element';
19
20
  const SENTRY_FILE_PROP_KEY = 'data-sentry-source-file';
@@ -85,7 +86,7 @@ class TouchEventBoundary extends React.Component {
85
86
  */
86
87
  // eslint-disable-next-line complexity
87
88
  _onTouchStart(e) {
88
- var _a, _b;
89
+ var _a, _b, _c;
89
90
  if (!e._targetInst) {
90
91
  return;
91
92
  }
@@ -114,6 +115,23 @@ class TouchEventBoundary extends React.Component {
114
115
  });
115
116
  if (span) {
116
117
  span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_INTERACTION);
118
+ // Apply custom attributes from sentry-span-attributes prop
119
+ // Traverse the component tree to find custom attributes
120
+ let instForAttributes = e._targetInst;
121
+ let customAttributes;
122
+ while (instForAttributes) {
123
+ if (((_c = instForAttributes.elementType) === null || _c === void 0 ? void 0 : _c.displayName) === TouchEventBoundary.displayName) {
124
+ break;
125
+ }
126
+ customAttributes = getSpanAttributes(instForAttributes);
127
+ if (customAttributes && Object.keys(customAttributes).length > 0) {
128
+ break;
129
+ }
130
+ instForAttributes = instForAttributes.return;
131
+ }
132
+ if (customAttributes && Object.keys(customAttributes).length > 0) {
133
+ span.setAttributes(customAttributes);
134
+ }
117
135
  }
118
136
  }
119
137
  /**
@@ -196,6 +214,20 @@ function getLabelValue(props, labelKey) {
196
214
  ? props[labelKey]
197
215
  : undefined;
198
216
  }
217
+ function getSpanAttributes(currentInst) {
218
+ if (!currentInst.memoizedProps) {
219
+ return undefined;
220
+ }
221
+ const props = currentInst.memoizedProps;
222
+ const attributes = props[SENTRY_SPAN_ATTRIBUTES_PROP_KEY];
223
+ // Validate that it's an object (not null, not array)
224
+ if (typeof attributes === 'object' &&
225
+ attributes !== null &&
226
+ !Array.isArray(attributes)) {
227
+ return attributes;
228
+ }
229
+ return undefined;
230
+ }
199
231
  /**
200
232
  * Convenience Higher-Order-Component for TouchEventBoundary
201
233
  * @param WrappedComponent any React Component
@@ -1 +1 @@
1
- {"version":3,"file":"touchevents.js","sourceRoot":"","sources":["../../src/js/touchevents.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,E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CAAC,KAAK,CAAC,QAAQ,CAAW;YAC3B,CAAC,CAAC,SAAS,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,sBAAsB,GAAG;AAC7B,8DAA8D;AAC9D,cAAwC,EACxC,aAAuC,EACd,EAAE;IAC3B,MAAM,gBAAgB,GAA4B,KAAK,CAAC,EAAE,CAAC,CACzD,oBAAC,kBAAkB,oBAAK,CAAC,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,CAAC;QAC3C,oBAAC,cAAc,oBAAK,KAAK,EAAI,CACV,CACtB,CAAC;IAEF,gBAAgB,CAAC,WAAW,GAAG,wBAAwB,CAAC;IAExD,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC","sourcesContent":["import type { SeverityLevel } from '@sentry/core';\nimport { addBreadcrumb, debug, dropUndefinedKeys, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport * as React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { StyleSheet, View } from 'react-native';\nimport { createIntegration } from './integrations/factory';\nimport { startUserInteractionSpan } from './tracing/integrations/userInteraction';\nimport { UI_ACTION_TOUCH } from './tracing/ops';\nimport { SPAN_ORIGIN_AUTO_INTERACTION } from './tracing/origin';\n\nexport type TouchEventBoundaryProps = {\n /**\n * The category assigned to the breadcrumb that is logged by the touch event.\n */\n breadcrumbCategory?: string;\n /**\n * The type assigned to the breadcrumb that is logged by the touch event.\n */\n breadcrumbType?: string;\n /**\n * The max number of components to display when logging a touch's component tree.\n */\n maxComponentTreeSize?: number;\n /**\n * Component name(s) to ignore when logging the touch event. This prevents unhelpful logs such as\n * \"Touch event within element: View\" where you still can't tell which View it occurred in.\n */\n ignoreNames?: Array<string | RegExp>;\n /**\n * Deprecated, use ignoreNames instead\n * @deprecated\n */\n ignoredDisplayNames?: Array<string | RegExp>;\n /**\n * React Node wrapped by TouchEventBoundary.\n */\n children?: React.ReactNode;\n /**\n * Label Name used to identify the touched element.\n */\n labelName?: string;\n};\n\nconst touchEventStyles = StyleSheet.create({\n wrapperView: {\n flex: 1,\n },\n});\n\nconst DEFAULT_BREADCRUMB_CATEGORY = 'touch';\nconst DEFAULT_BREADCRUMB_TYPE = 'user';\nconst DEFAULT_MAX_COMPONENT_TREE_SIZE = 20;\n\nconst SENTRY_LABEL_PROP_KEY = 'sentry-label';\nconst SENTRY_COMPONENT_PROP_KEY = 'data-sentry-component';\nconst SENTRY_ELEMENT_PROP_KEY = 'data-sentry-element';\nconst SENTRY_FILE_PROP_KEY = 'data-sentry-source-file';\n\ninterface ElementInstance {\n elementType?: {\n displayName?: string;\n name?: string;\n };\n memoizedProps?: Record<string, unknown>;\n return?: ElementInstance;\n}\n\ninterface TouchedComponentInfo {\n name?: string;\n label?: string;\n element?: string;\n file?: string;\n}\n\ninterface PrivateGestureResponderEvent extends GestureResponderEvent {\n _targetInst?: ElementInstance;\n}\n\n/**\n * Boundary to log breadcrumbs for interaction events.\n */\nclass TouchEventBoundary extends React.Component<TouchEventBoundaryProps> {\n public static displayName: string = '__Sentry.TouchEventBoundary';\n public static defaultProps: Partial<TouchEventBoundaryProps> = {\n breadcrumbCategory: DEFAULT_BREADCRUMB_CATEGORY,\n breadcrumbType: DEFAULT_BREADCRUMB_TYPE,\n ignoreNames: [],\n maxComponentTreeSize: DEFAULT_MAX_COMPONENT_TREE_SIZE,\n };\n\n public readonly name: string = 'TouchEventBoundary';\n\n /**\n * Registers the TouchEventBoundary as a Sentry Integration.\n */\n public componentDidMount(): void {\n const client = getClient();\n client?.addIntegration?.(createIntegration(this.name));\n }\n\n /**\n *\n */\n public render(): React.ReactNode {\n return (\n <View\n style={touchEventStyles.wrapperView}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onTouchStart={this._onTouchStart.bind(this) as any}\n >\n {this.props.children}\n </View>\n );\n }\n\n /**\n * Logs the touch event given the component tree names and a label.\n */\n private _logTouchEvent(touchPath: TouchedComponentInfo[], label?: string): void {\n const level = 'info' as SeverityLevel;\n\n const root = touchPath[0];\n if (!root) {\n debug.warn('[TouchEvents] No root component found in touch path.');\n return;\n }\n\n const detail = label ? label : `${root.name}${root.file ? ` (${root.file})` : ''}`;\n const crumb = {\n category: this.props.breadcrumbCategory,\n data: { path: touchPath },\n level: level,\n message: `Touch event within element: ${detail}`,\n type: this.props.breadcrumbType,\n };\n addBreadcrumb(crumb);\n\n debug.log(`[TouchEvents] ${crumb.message}`);\n }\n\n /**\n * Checks if the name is supposed to be ignored.\n */\n private _isNameIgnored(name: string): boolean {\n let ignoreNames = this.props.ignoreNames || [];\n // eslint-disable-next-line deprecation/deprecation\n if (this.props.ignoredDisplayNames) {\n // This is to make it compatible with prior version.\n // eslint-disable-next-line deprecation/deprecation\n ignoreNames = [...ignoreNames, ...this.props.ignoredDisplayNames];\n }\n\n return ignoreNames.some(\n (ignoreName: string | RegExp) =>\n (typeof ignoreName === 'string' && name === ignoreName) ||\n (ignoreName instanceof RegExp && name.match(ignoreName)),\n );\n }\n\n // Originally was going to clean the names of any HOCs as well but decided that it might hinder debugging effectively. Will leave here in case\n // private readonly _cleanName = (name: string): string =>\n // name.replace(/.*\\(/g, \"\").replace(/\\)/g, \"\");\n\n /**\n * Traverses through the component tree when a touch happens and logs it.\n * @param e\n */\n // eslint-disable-next-line complexity\n private _onTouchStart(e: PrivateGestureResponderEvent): void {\n if (!e._targetInst) {\n return;\n }\n\n let currentInst: ElementInstance | undefined = e._targetInst;\n const touchPath: TouchedComponentInfo[] = [];\n\n while (\n currentInst &&\n // maxComponentTreeSize will always be defined as we have a defaultProps. But ts needs a check so this is here.\n this.props.maxComponentTreeSize &&\n touchPath.length < this.props.maxComponentTreeSize\n ) {\n if (\n // If the loop gets to the boundary itself, break.\n currentInst.elementType?.displayName === TouchEventBoundary.displayName\n ) {\n break;\n }\n\n const info = getTouchedComponentInfo(currentInst, this.props.labelName);\n this._pushIfNotIgnored(touchPath, info);\n\n currentInst = currentInst.return;\n }\n\n const label = touchPath.find(info => info.label)?.label;\n if (touchPath.length > 0) {\n this._logTouchEvent(touchPath, label);\n }\n\n const span = startUserInteractionSpan({\n elementId: label,\n op: UI_ACTION_TOUCH,\n });\n if (span) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_INTERACTION);\n }\n }\n\n /**\n * Pushes the name to the componentTreeNames array if it is not ignored.\n */\n private _pushIfNotIgnored(touchPath: TouchedComponentInfo[], value: TouchedComponentInfo | undefined): boolean {\n if (!value) {\n return false;\n }\n\n if (!value.name && !value.label) {\n return false;\n }\n if (value.name && this._isNameIgnored(value.name)) {\n return false;\n }\n if (value.label && this._isNameIgnored(value.label)) {\n return false;\n }\n\n // Deduplicate same subsequent items.\n if (touchPath.length > 0 && JSON.stringify(touchPath[touchPath.length - 1]) === JSON.stringify(value)) {\n return false;\n }\n\n touchPath.push(value);\n return true;\n }\n}\n\nfunction getTouchedComponentInfo(currentInst: ElementInstance, labelKey: string | undefined): TouchedComponentInfo | undefined {\n const displayName = currentInst.elementType?.displayName;\n\n const props = currentInst.memoizedProps;\n if (!props) {\n // Early return if no props are available, as we can't extract any useful information\n if (displayName) {\n return {\n name: displayName,\n };\n }\n return undefined;\n }\n\n return dropUndefinedKeys<TouchedComponentInfo>({\n // provided by @sentry/babel-plugin-component-annotate\n name: getComponentName(props) || displayName,\n element: getElementName(props),\n file: getFileName(props),\n\n // `sentry-label` or user defined label key\n label: getLabelValue(props, labelKey),\n });\n}\n\nfunction getComponentName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_COMPONENT_PROP_KEY] === 'string' &&\n props[SENTRY_COMPONENT_PROP_KEY].length > 0 &&\n props[SENTRY_COMPONENT_PROP_KEY] !== 'unknown' &&\n props[SENTRY_COMPONENT_PROP_KEY] || undefined;\n}\n\nfunction getElementName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_ELEMENT_PROP_KEY] === 'string' &&\n props[SENTRY_ELEMENT_PROP_KEY].length > 0 &&\n props[SENTRY_ELEMENT_PROP_KEY] !== 'unknown' &&\n props[SENTRY_ELEMENT_PROP_KEY] || undefined;\n}\n\nfunction getFileName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_FILE_PROP_KEY] === 'string' &&\n props[SENTRY_FILE_PROP_KEY].length > 0 &&\n props[SENTRY_FILE_PROP_KEY] !== 'unknown' &&\n props[SENTRY_FILE_PROP_KEY] || undefined;\n}\n\nfunction getLabelValue(props: Record<string, unknown>, labelKey: string | undefined): string | undefined {\n return typeof props[SENTRY_LABEL_PROP_KEY] === 'string' && props[SENTRY_LABEL_PROP_KEY].length > 0\n ? props[SENTRY_LABEL_PROP_KEY]\n // For some reason type narrowing doesn't work as expected with indexing when checking it all in one go in\n // the \"check-label\" if sentence, so we have to assign it to a variable here first\n : typeof labelKey === 'string' && typeof props[labelKey] == 'string' && (props[labelKey] as string).length > 0\n ? props[labelKey] as string\n : undefined;\n}\n\n/**\n * Convenience Higher-Order-Component for TouchEventBoundary\n * @param WrappedComponent any React Component\n * @param boundaryProps TouchEventBoundaryProps\n */\nconst withTouchEventBoundary = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n InnerComponent: React.ComponentType<any>,\n boundaryProps?: TouchEventBoundaryProps,\n): React.FunctionComponent => {\n const WrappedComponent: React.FunctionComponent = props => (\n <TouchEventBoundary {...(boundaryProps ?? {})}>\n <InnerComponent {...props} />\n </TouchEventBoundary>\n );\n\n WrappedComponent.displayName = 'WithTouchEventBoundary';\n\n return WrappedComponent;\n};\n\nexport { TouchEventBoundary, withTouchEventBoundary };\n"]}
1
+ {"version":3,"file":"touchevents.js","sourceRoot":"","sources":["../../src/js/touchevents.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,KAAK,KAAK,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,KAAK,QAAQ;QAC9B,UAAU,KAAK,IAAI;QACnB,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAC1B;QACA,OAAO,UAAgD,CAAC;KACzD;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,sBAAsB,GAAG;AAC7B,8DAA8D;AAC9D,cAAwC,EACxC,aAAuC,EACd,EAAE;IAC3B,MAAM,gBAAgB,GAA4B,KAAK,CAAC,EAAE,CAAC,CACzD,oBAAC,kBAAkB,oBAAK,CAAC,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,CAAC;QAC3C,oBAAC,cAAc,oBAAK,KAAK,EAAI,CACV,CACtB,CAAC;IAEF,gBAAgB,CAAC,WAAW,GAAG,wBAAwB,CAAC;IAExD,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC","sourcesContent":["import type { SeverityLevel, SpanAttributeValue } from '@sentry/core';\nimport { addBreadcrumb, debug, dropUndefinedKeys, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport * as React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { StyleSheet, View } from 'react-native';\nimport { createIntegration } from './integrations/factory';\nimport { startUserInteractionSpan } from './tracing/integrations/userInteraction';\nimport { UI_ACTION_TOUCH } from './tracing/ops';\nimport { SPAN_ORIGIN_AUTO_INTERACTION } from './tracing/origin';\n\nexport type TouchEventBoundaryProps = {\n /**\n * The category assigned to the breadcrumb that is logged by the touch event.\n */\n breadcrumbCategory?: string;\n /**\n * The type assigned to the breadcrumb that is logged by the touch event.\n */\n breadcrumbType?: string;\n /**\n * The max number of components to display when logging a touch's component tree.\n */\n maxComponentTreeSize?: number;\n /**\n * Component name(s) to ignore when logging the touch event. This prevents unhelpful logs such as\n * \"Touch event within element: View\" where you still can't tell which View it occurred in.\n */\n ignoreNames?: Array<string | RegExp>;\n /**\n * Deprecated, use ignoreNames instead\n * @deprecated\n */\n ignoredDisplayNames?: Array<string | RegExp>;\n /**\n * React Node wrapped by TouchEventBoundary.\n */\n children?: React.ReactNode;\n /**\n * Label Name used to identify the touched element.\n */\n labelName?: string;\n /**\n * Custom attributes to add to user interaction spans.\n * Accepts an object with string keys and values that are strings, numbers, booleans, or arrays.\n *\n * @experimental This API is experimental and may change in future releases.\n */\n spanAttributes?: Record<string, SpanAttributeValue>;\n};\n\nconst touchEventStyles = StyleSheet.create({\n wrapperView: {\n flex: 1,\n },\n});\n\nconst DEFAULT_BREADCRUMB_CATEGORY = 'touch';\nconst DEFAULT_BREADCRUMB_TYPE = 'user';\nconst DEFAULT_MAX_COMPONENT_TREE_SIZE = 20;\n\nconst SENTRY_LABEL_PROP_KEY = 'sentry-label';\nconst SENTRY_SPAN_ATTRIBUTES_PROP_KEY = 'sentry-span-attributes';\nconst SENTRY_COMPONENT_PROP_KEY = 'data-sentry-component';\nconst SENTRY_ELEMENT_PROP_KEY = 'data-sentry-element';\nconst SENTRY_FILE_PROP_KEY = 'data-sentry-source-file';\n\ninterface ElementInstance {\n elementType?: {\n displayName?: string;\n name?: string;\n };\n memoizedProps?: Record<string, unknown>;\n return?: ElementInstance;\n}\n\ninterface TouchedComponentInfo {\n name?: string;\n label?: string;\n element?: string;\n file?: string;\n}\n\ninterface PrivateGestureResponderEvent extends GestureResponderEvent {\n _targetInst?: ElementInstance;\n}\n\n/**\n * Boundary to log breadcrumbs for interaction events.\n */\nclass TouchEventBoundary extends React.Component<TouchEventBoundaryProps> {\n public static displayName: string = '__Sentry.TouchEventBoundary';\n public static defaultProps: Partial<TouchEventBoundaryProps> = {\n breadcrumbCategory: DEFAULT_BREADCRUMB_CATEGORY,\n breadcrumbType: DEFAULT_BREADCRUMB_TYPE,\n ignoreNames: [],\n maxComponentTreeSize: DEFAULT_MAX_COMPONENT_TREE_SIZE,\n };\n\n public readonly name: string = 'TouchEventBoundary';\n\n /**\n * Registers the TouchEventBoundary as a Sentry Integration.\n */\n public componentDidMount(): void {\n const client = getClient();\n client?.addIntegration?.(createIntegration(this.name));\n }\n\n /**\n *\n */\n public render(): React.ReactNode {\n return (\n <View\n style={touchEventStyles.wrapperView}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onTouchStart={this._onTouchStart.bind(this) as any}\n >\n {this.props.children}\n </View>\n );\n }\n\n /**\n * Logs the touch event given the component tree names and a label.\n */\n private _logTouchEvent(touchPath: TouchedComponentInfo[], label?: string): void {\n const level = 'info' as SeverityLevel;\n\n const root = touchPath[0];\n if (!root) {\n debug.warn('[TouchEvents] No root component found in touch path.');\n return;\n }\n\n const detail = label ? label : `${root.name}${root.file ? ` (${root.file})` : ''}`;\n const crumb = {\n category: this.props.breadcrumbCategory,\n data: { path: touchPath },\n level: level,\n message: `Touch event within element: ${detail}`,\n type: this.props.breadcrumbType,\n };\n addBreadcrumb(crumb);\n\n debug.log(`[TouchEvents] ${crumb.message}`);\n }\n\n /**\n * Checks if the name is supposed to be ignored.\n */\n private _isNameIgnored(name: string): boolean {\n let ignoreNames = this.props.ignoreNames || [];\n // eslint-disable-next-line deprecation/deprecation\n if (this.props.ignoredDisplayNames) {\n // This is to make it compatible with prior version.\n // eslint-disable-next-line deprecation/deprecation\n ignoreNames = [...ignoreNames, ...this.props.ignoredDisplayNames];\n }\n\n return ignoreNames.some(\n (ignoreName: string | RegExp) =>\n (typeof ignoreName === 'string' && name === ignoreName) ||\n (ignoreName instanceof RegExp && name.match(ignoreName)),\n );\n }\n\n // Originally was going to clean the names of any HOCs as well but decided that it might hinder debugging effectively. Will leave here in case\n // private readonly _cleanName = (name: string): string =>\n // name.replace(/.*\\(/g, \"\").replace(/\\)/g, \"\");\n\n /**\n * Traverses through the component tree when a touch happens and logs it.\n * @param e\n */\n // eslint-disable-next-line complexity\n private _onTouchStart(e: PrivateGestureResponderEvent): void {\n if (!e._targetInst) {\n return;\n }\n\n let currentInst: ElementInstance | undefined = e._targetInst;\n const touchPath: TouchedComponentInfo[] = [];\n\n while (\n currentInst &&\n // maxComponentTreeSize will always be defined as we have a defaultProps. But ts needs a check so this is here.\n this.props.maxComponentTreeSize &&\n touchPath.length < this.props.maxComponentTreeSize\n ) {\n if (\n // If the loop gets to the boundary itself, break.\n currentInst.elementType?.displayName === TouchEventBoundary.displayName\n ) {\n break;\n }\n\n const info = getTouchedComponentInfo(currentInst, this.props.labelName);\n this._pushIfNotIgnored(touchPath, info);\n\n currentInst = currentInst.return;\n }\n\n const label = touchPath.find(info => info.label)?.label;\n if (touchPath.length > 0) {\n this._logTouchEvent(touchPath, label);\n }\n\n const span = startUserInteractionSpan({\n elementId: label,\n op: UI_ACTION_TOUCH,\n });\n if (span) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_INTERACTION);\n\n // Apply custom attributes from sentry-span-attributes prop\n // Traverse the component tree to find custom attributes\n let instForAttributes: ElementInstance | undefined = e._targetInst;\n let customAttributes: Record<string, SpanAttributeValue> | undefined;\n\n while (instForAttributes) {\n if (instForAttributes.elementType?.displayName === TouchEventBoundary.displayName) {\n break;\n }\n\n customAttributes = getSpanAttributes(instForAttributes);\n if (customAttributes && Object.keys(customAttributes).length > 0) {\n break;\n }\n\n instForAttributes = instForAttributes.return;\n }\n\n if (customAttributes && Object.keys(customAttributes).length > 0) {\n span.setAttributes(customAttributes);\n }\n }\n }\n\n /**\n * Pushes the name to the componentTreeNames array if it is not ignored.\n */\n private _pushIfNotIgnored(touchPath: TouchedComponentInfo[], value: TouchedComponentInfo | undefined): boolean {\n if (!value) {\n return false;\n }\n\n if (!value.name && !value.label) {\n return false;\n }\n if (value.name && this._isNameIgnored(value.name)) {\n return false;\n }\n if (value.label && this._isNameIgnored(value.label)) {\n return false;\n }\n\n // Deduplicate same subsequent items.\n if (touchPath.length > 0 && JSON.stringify(touchPath[touchPath.length - 1]) === JSON.stringify(value)) {\n return false;\n }\n\n touchPath.push(value);\n return true;\n }\n}\n\nfunction getTouchedComponentInfo(currentInst: ElementInstance, labelKey: string | undefined): TouchedComponentInfo | undefined {\n const displayName = currentInst.elementType?.displayName;\n\n const props = currentInst.memoizedProps;\n if (!props) {\n // Early return if no props are available, as we can't extract any useful information\n if (displayName) {\n return {\n name: displayName,\n };\n }\n return undefined;\n }\n\n return dropUndefinedKeys<TouchedComponentInfo>({\n // provided by @sentry/babel-plugin-component-annotate\n name: getComponentName(props) || displayName,\n element: getElementName(props),\n file: getFileName(props),\n\n // `sentry-label` or user defined label key\n label: getLabelValue(props, labelKey),\n });\n}\n\nfunction getComponentName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_COMPONENT_PROP_KEY] === 'string' &&\n props[SENTRY_COMPONENT_PROP_KEY].length > 0 &&\n props[SENTRY_COMPONENT_PROP_KEY] !== 'unknown' &&\n props[SENTRY_COMPONENT_PROP_KEY] || undefined;\n}\n\nfunction getElementName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_ELEMENT_PROP_KEY] === 'string' &&\n props[SENTRY_ELEMENT_PROP_KEY].length > 0 &&\n props[SENTRY_ELEMENT_PROP_KEY] !== 'unknown' &&\n props[SENTRY_ELEMENT_PROP_KEY] || undefined;\n}\n\nfunction getFileName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_FILE_PROP_KEY] === 'string' &&\n props[SENTRY_FILE_PROP_KEY].length > 0 &&\n props[SENTRY_FILE_PROP_KEY] !== 'unknown' &&\n props[SENTRY_FILE_PROP_KEY] || undefined;\n}\n\nfunction getLabelValue(props: Record<string, unknown>, labelKey: string | undefined): string | undefined {\n return typeof props[SENTRY_LABEL_PROP_KEY] === 'string' && props[SENTRY_LABEL_PROP_KEY].length > 0\n ? props[SENTRY_LABEL_PROP_KEY]\n // For some reason type narrowing doesn't work as expected with indexing when checking it all in one go in\n // the \"check-label\" if sentence, so we have to assign it to a variable here first\n : typeof labelKey === 'string' && typeof props[labelKey] == 'string' && (props[labelKey] as string).length > 0\n ? props[labelKey] as string\n : undefined;\n}\n\nfunction getSpanAttributes(currentInst: ElementInstance): Record<string, SpanAttributeValue> | undefined {\n if (!currentInst.memoizedProps) {\n return undefined;\n }\n\n const props = currentInst.memoizedProps;\n const attributes = props[SENTRY_SPAN_ATTRIBUTES_PROP_KEY];\n\n // Validate that it's an object (not null, not array)\n if (\n typeof attributes === 'object' &&\n attributes !== null &&\n !Array.isArray(attributes)\n ) {\n return attributes as Record<string, SpanAttributeValue>;\n }\n\n return undefined;\n}\n\n/**\n * Convenience Higher-Order-Component for TouchEventBoundary\n * @param WrappedComponent any React Component\n * @param boundaryProps TouchEventBoundaryProps\n */\nconst withTouchEventBoundary = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n InnerComponent: React.ComponentType<any>,\n boundaryProps?: TouchEventBoundaryProps,\n): React.FunctionComponent => {\n const WrappedComponent: React.FunctionComponent = props => (\n <TouchEventBoundary {...(boundaryProps ?? {})}>\n <InnerComponent {...props} />\n </TouchEventBoundary>\n );\n\n WrappedComponent.displayName = 'WithTouchEventBoundary';\n\n return WrappedComponent;\n};\n\nexport { TouchEventBoundary, withTouchEventBoundary };\n"]}
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "7.10.0";
3
+ export declare const SDK_VERSION = "7.11.0";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
2
2
  export const SDK_NAME = 'sentry.javascript.react-native';
3
- export const SDK_VERSION = '7.10.0';
3
+ export const SDK_VERSION = '7.11.0';
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '7.10.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '7.11.0';\n"]}
@@ -60,6 +60,8 @@ interface SentryNativeWrapper {
60
60
  setExtra(key: string, extra: unknown): void;
61
61
  setUser(user: User | null): void;
62
62
  setTag(key: string, value?: string): void;
63
+ setAttribute(key: string, value: string | number | boolean): void;
64
+ setAttributes(attributes: Record<string, string | number | boolean>): void;
63
65
  nativeCrash(): void;
64
66
  fetchModules(): Promise<Record<string, string> | null>;
65
67
  fetchViewHierarchy(): PromiseLike<Uint8Array | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,OAAO,EACP,SAAS,EACT,aAAa,EACb,IAAI,EACL,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAiB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EACV,sBAAsB,EACtB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EAErB,iBAAiB,EACjB,IAAI,EACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK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IAEzD,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;CAC9C;AAID;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,mBAsyBpB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAE5E"}
@@ -392,6 +392,38 @@ export const NATIVE = {
392
392
  RNSentry.setContext(key, { error: '**non-serializable**' });
393
393
  }
394
394
  },
395
+ /**
396
+ * Sets an attribute on the native scope.
397
+ * @param key string
398
+ * @param value primitive value (string, number, or boolean)
399
+ */
400
+ setAttribute(key, value) {
401
+ if (!this.enableNative) {
402
+ return;
403
+ }
404
+ if (!this._isModuleLoaded(RNSentry)) {
405
+ throw this._NativeClientError;
406
+ }
407
+ const stringifiedValue = this.primitiveProcessor(value);
408
+ RNSentry.setAttribute(key, stringifiedValue);
409
+ },
410
+ /**
411
+ * Sets multiple attributes on the native scope.
412
+ * @param attributes key-value map of attributes (only string, number, and boolean values)
413
+ */
414
+ setAttributes(attributes) {
415
+ if (!this.enableNative) {
416
+ return;
417
+ }
418
+ if (!this._isModuleLoaded(RNSentry)) {
419
+ throw this._NativeClientError;
420
+ }
421
+ const serializedAttributes = {};
422
+ Object.keys(attributes).forEach(key => {
423
+ serializedAttributes[key] = this.primitiveProcessor(attributes[key]);
424
+ });
425
+ RNSentry.setAttributes(serializedAttributes);
426
+ },
395
427
  /**
396
428
  * Closes the Native Layer SDK
397
429
  */
@@ -1 +1 @@
1
- {"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,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AC,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAChE,WAAW,EAAE,MAAA,KAAK,CAAC,WAAW,0CAAE,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,iCAC7C,UAAU,KACb,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,IAC1E,CAAC,GACJ,CAAC;QAEF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,aAAa,CAAC,KAAoB;QAChC,IAAI,KAAK,IAAK,KAAuB,EAAE;YACrC,OAAO,OAAwB,CAAC;SACjC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,MAAwB;QACtC,OAAO,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;IAED,sBAAsB,EAAE,UAAU,SAAoC;QACpE,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACtC,CAAC;IAED,oBAAoB,EAAE,IAAI,WAAW,CAAC,oBAAoB,CAAC;IAE3D,kBAAkB,EAAE,IAAI,WAAW,CAAC,wDAAwD,CAAC;IAE7F,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,QAAQ,CAAC,EAAE;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAgB,cAAc,CAAC,GAAW;;QAC9C,OAAO,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;CAAA","sourcesContent":["/* eslint-disable max-lines */\nimport type {\n BaseEnvelopeItemHeaders,\n Breadcrumb,\n Envelope,\n EnvelopeItem,\n Event,\n Package,\n Primitive,\n SeverityLevel,\n User,\n} from '@sentry/core';\nimport { debug, normalize, SentryError } from '@sentry/core';\nimport { NativeModules, Platform } from 'react-native';\nimport { isHardCrash } from './misc';\nimport type {\n NativeAppStartResponse,\n NativeDeviceContextsResponse,\n NativeFramesResponse,\n NativeReleaseResponse,\n NativeScreenshot,\n NativeStackFrames,\n Spec,\n} from './NativeRNSentry';\nimport type { AndroidProfilingOptions, ReactNativeClientOptions } from './options';\nimport type * as Hermes from './profiling/hermes';\nimport type { NativeAndroidProfileEvent, NativeProfileEvent } from './profiling/nativeTypes';\nimport type { MobileReplayOptions } from './replay/mobilereplay';\nimport type { RequiredKeysUser } from './user';\nimport { encodeUTF8 } from './utils/encode';\nimport { isTurboModuleEnabled } from './utils/environment';\nimport { convertToNormalizedObject } from './utils/normalize';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { base64StringFromByteArray } from './vendor';\n\n/**\n * Returns the RNSentry module. Dynamically resolves if NativeModule or TurboModule is used.\n */\nexport function getRNSentryModule(): Spec | undefined {\n return isTurboModuleEnabled()\n ? ReactNativeLibraries.TurboModuleRegistry?.get<Spec>('RNSentry')\n : NativeModules.RNSentry;\n}\n\nconst RNSentry: Spec | undefined = getRNSentryModule();\n\nexport interface Screenshot {\n data: Uint8Array;\n contentType: string;\n filename: string;\n}\n\nexport type NativeSdkOptions = Partial<ReactNativeClientOptions> & {\n devServerUrl: string | undefined;\n defaultSidecarUrl: string | undefined;\n ignoreErrorsStr?: string[] | undefined;\n ignoreErrorsRegex?: string[] | undefined;\n} & {\n mobileReplayOptions: MobileReplayOptions | undefined;\n androidProfilingOptions?: AndroidProfilingOptions | undefined;\n};\n\ninterface SentryNativeWrapper {\n enableNative: boolean;\n nativeIsReady: boolean;\n platform: typeof Platform.OS;\n\n _NativeClientError: Error;\n _DisabledNativeError: Error;\n\n _setPrimitiveProcessor: (processor: (value: Primitive) => void) => void;\n _processItem(envelopeItem: EnvelopeItem): EnvelopeItem;\n _processLevels(event: Event): Event;\n _processLevel(level: SeverityLevel): SeverityLevel;\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string };\n _isModuleLoaded(module: Spec | undefined): module is Spec;\n\n isNativeAvailable(): boolean;\n\n initNativeSdk(options: NativeSdkOptions): PromiseLike<boolean>;\n closeNativeSdk(): PromiseLike<void>;\n\n sendEnvelope(envelope: Envelope): Promise<void>;\n captureScreenshot(): Promise<Screenshot[] | null>;\n\n fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;\n fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse | null>;\n fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;\n fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;\n fetchNativeSdkInfo(): PromiseLike<Package | null>;\n\n disableNativeFramesTracking(): void;\n enableNativeFramesTracking(): void;\n\n addBreadcrumb(breadcrumb: Breadcrumb): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(key: string, context: { [key: string]: any } | null): void;\n clearBreadcrumbs(): void;\n setExtra(key: string, extra: unknown): void;\n setUser(user: User | null): void;\n setTag(key: string, value?: string): void;\n\n nativeCrash(): void;\n\n fetchModules(): Promise<Record<string, string> | null>;\n fetchViewHierarchy(): PromiseLike<Uint8Array | null>;\n\n startProfiling(platformProfilers: boolean): boolean;\n stopProfiling(): {\n hermesProfile: Hermes.Profile;\n nativeProfile?: NativeProfileEvent;\n androidProfile?: NativeAndroidProfileEvent;\n } | null;\n\n fetchNativePackageName(): string | null;\n\n /**\n * Fetches native stack frames and debug images for the instructions addresses.\n */\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null;\n initNativeReactNavigationNewFrameTracking(): Promise<void>;\n\n captureReplay(isHardCrash: boolean): Promise<string | null>;\n getCurrentReplayId(): string | null;\n\n crashedLastRun(): Promise<boolean | null>;\n getNewScreenTimeToDisplay(): Promise<number | null | undefined>;\n\n getDataFromUri(uri: string): Promise<Uint8Array | null>;\n popTimeToDisplayFor(key: string): Promise<number | undefined | null>;\n\n setActiveSpanId(spanId: string): void;\n\n encodeToBase64(data: Uint8Array): Promise<string | null>;\n\n primitiveProcessor(value: Primitive): string;\n}\n\nconst EOL = encodeUTF8('\\n');\n\n/**\n * Our internal interface for calling native functions\n */\nexport const NATIVE: SentryNativeWrapper = {\n async fetchModules(): Promise<Record<string, string> | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchModules();\n if (raw) {\n return JSON.parse(raw);\n }\n return null;\n },\n /**\n * Sending the envelope over the bridge to native\n * @param envelope Envelope\n */\n async sendEnvelope(envelope: Envelope): Promise<void> {\n if (!this.enableNative) {\n debug.warn('Event was skipped as native SDK is not enabled.');\n return;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const [envelopeHeader, envelopeItems] = envelope;\n\n const headerString = JSON.stringify(envelopeHeader);\n const headerBytes = encodeUTF8(headerString);\n let envelopeBytes: Uint8Array = new Uint8Array(headerBytes.length + EOL.length);\n envelopeBytes.set(headerBytes);\n envelopeBytes.set(EOL, headerBytes.length);\n\n let hardCrashed: boolean = false;\n for (const rawItem of envelopeItems) {\n const [itemHeader, itemPayload] = this._processItem(rawItem);\n\n let bytesContentType: string;\n let bytesPayload: number[] | Uint8Array | undefined;\n\n if (typeof itemPayload === 'string') {\n bytesContentType = 'text/plain';\n bytesPayload = encodeUTF8(itemPayload);\n } else if (itemPayload instanceof Uint8Array) {\n bytesContentType =\n typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/octet-stream';\n bytesPayload = itemPayload;\n } else {\n bytesContentType = typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/json';\n bytesPayload = encodeUTF8(JSON.stringify(itemPayload));\n if (!hardCrashed) {\n hardCrashed = isHardCrash(itemPayload);\n }\n }\n\n // Content type is not inside BaseEnvelopeItemHeaders.\n (itemHeader as BaseEnvelopeItemHeaders).content_type = bytesContentType;\n (itemHeader as BaseEnvelopeItemHeaders).length = bytesPayload.length;\n const serializedItemHeader = JSON.stringify(itemHeader);\n\n const bytesItemHeader = encodeUTF8(serializedItemHeader);\n const newBytes = new Uint8Array(\n envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length + EOL.length,\n );\n newBytes.set(envelopeBytes);\n newBytes.set(bytesItemHeader, envelopeBytes.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length);\n newBytes.set(bytesPayload, envelopeBytes.length + bytesItemHeader.length + EOL.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length);\n envelopeBytes = newBytes;\n }\n\n await RNSentry.captureEnvelope(base64StringFromByteArray(envelopeBytes), { hardCrashed });\n },\n\n /**\n * Starts native with the provided options.\n * @param options ReactNativeClientOptions\n */\n async initNativeSdk(originalOptions: NativeSdkOptions): Promise<boolean> {\n const options: NativeSdkOptions = {\n enableNative: true,\n autoInitializeNativeSdk: true,\n ...originalOptions,\n // Keeps original behavior of enableLogs by not setting it when not defined.\n ...(originalOptions.enableLogs !== undefined\n ? { enableLogs: originalOptions.enableLogs && originalOptions.logsOrigin !== 'js' }\n : {}),\n };\n\n if (!options.enableNative) {\n if (options.enableNativeNagger) {\n debug.warn('Note: Native Sentry SDK is disabled.');\n }\n this.enableNative = false;\n return false;\n }\n if (!options.autoInitializeNativeSdk) {\n if (options.enableNativeNagger) {\n debug.warn(\n 'Note: Native Sentry SDK was not initialized automatically, you will need to initialize it manually. If you wish to disable the native SDK and get rid of this warning, pass enableNative: false',\n );\n }\n this.enableNative = true;\n return false;\n }\n\n if (!options.dsn) {\n debug.warn(\n 'Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized.',\n );\n this.enableNative = false;\n return false;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n const ignoreErrorsStr = options.ignoreErrors?.filter(item => typeof item === 'string') as string[] | undefined;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const ignoreErrorsRegex = options.ignoreErrors\n ?.filter(item => item instanceof RegExp)\n .map(item => (item as RegExp).source) as string[] | undefined;\n\n if (ignoreErrorsStr && ignoreErrorsStr.length > 0) {\n options.ignoreErrorsStr = ignoreErrorsStr;\n }\n if (ignoreErrorsRegex && ignoreErrorsRegex.length > 0) {\n options.ignoreErrorsRegex = ignoreErrorsRegex;\n }\n\n // filter out all the options that would crash native.\n /* eslint-disable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n const {\n beforeSend,\n beforeBreadcrumb,\n beforeSendTransaction,\n beforeSendMetric,\n integrations,\n ignoreErrors,\n logsOrigin,\n androidProfilingOptions,\n ...filteredOptions\n } = options;\n /* eslint-enable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n\n // Move androidProfilingOptions into _experiments\n if (androidProfilingOptions) {\n filteredOptions._experiments = {\n ...filteredOptions._experiments,\n androidProfilingOptions,\n };\n }\n\n const nativeIsReady = await RNSentry.initNativeSdk(filteredOptions);\n\n this.nativeIsReady = nativeIsReady;\n this.enableNative = true;\n\n return nativeIsReady;\n },\n\n /**\n * Fetches the attributes to be set into logs from Native\n */\n async fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeLogAttributes();\n },\n /**\n * Fetches the release from native\n */\n async fetchNativeRelease(): Promise<NativeReleaseResponse> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeRelease();\n },\n\n /**\n * Fetches the Sdk info for the native sdk.\n */\n async fetchNativeSdkInfo(): Promise<Package | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeSdkInfo();\n },\n\n /**\n * Fetches the device contexts. Not used on Android.\n */\n async fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeDeviceContexts();\n },\n\n async fetchNativeAppStart(): Promise<NativeAppStartResponse | null> {\n if (!this.enableNative) {\n debug.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.error(this._NativeClientError);\n return null;\n }\n\n return RNSentry.fetchNativeAppStart();\n },\n\n async fetchNativeFrames(): Promise<NativeFramesResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeFrames();\n },\n\n /**\n * Triggers a native crash.\n * Use this only for testing purposes.\n */\n nativeCrash(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.crash();\n },\n\n /**\n * Sets the user in the native scope.\n * Passing null clears the user.\n */\n setUser(user: User | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // separate and serialize all non-default user keys.\n let userKeys = null;\n let userDataKeys = null;\n if (user) {\n const { id, ip_address, email, username, geo, ...otherKeys } = user;\n const requiredUser: RequiredKeysUser = {\n id,\n ip_address,\n email,\n username,\n geo,\n };\n userKeys = this._serializeObject(requiredUser);\n userDataKeys = this._serializeObject(otherKeys);\n }\n\n RNSentry.setUser(userKeys, userDataKeys);\n },\n\n /**\n * Sets a tag in the native module.\n * @param key string\n * @param value string\n */\n setTag(key: string, value?: string): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const stringifiedValue = typeof value === 'string' ? value : JSON.stringify(value);\n\n RNSentry.setTag(key, stringifiedValue);\n },\n\n /**\n * Sets an extra in the native scope, will stringify\n * extra value if it isn't already a string.\n * @param key string\n * @param extra any\n */\n setExtra(key: string, extra: unknown): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n if (typeof extra === 'string') {\n return RNSentry.setExtra(key, extra);\n }\n if (typeof extra === 'undefined') {\n return RNSentry.setExtra(key, 'undefined');\n }\n\n let stringifiedExtra: string | undefined;\n try {\n const normalizedExtra = normalize(extra);\n stringifiedExtra = JSON.stringify(normalizedExtra);\n } catch (e) {\n debug.error('Extra for key ${key} not passed to native SDK, because it contains non-stringifiable values', e);\n }\n\n if (typeof stringifiedExtra === 'string') {\n return RNSentry.setExtra(key, stringifiedExtra);\n }\n return RNSentry.setExtra(key, '**non-stringifiable**');\n },\n\n /**\n * Adds breadcrumb to the native scope.\n * @param breadcrumb Breadcrumb\n */\n addBreadcrumb(breadcrumb: Breadcrumb): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.addBreadcrumb({\n ...breadcrumb,\n // Process and convert deprecated levels\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n });\n },\n\n /**\n * Clears breadcrumbs on the native scope.\n */\n clearBreadcrumbs(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.clearBreadcrumbs();\n },\n\n /**\n * Sets context on the native scope.\n * @param key string\n * @param context key-value map\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(key: string, context: { [key: string]: any } | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n if (context === null) {\n return RNSentry.setContext(key, null);\n }\n\n let normalizedContext: Record<string, unknown> | undefined;\n try {\n normalizedContext = convertToNormalizedObject(context);\n } catch (e) {\n debug.error('Context for key ${key} not passed to native SDK, because it contains non-serializable values', e);\n }\n\n if (normalizedContext) {\n RNSentry.setContext(key, normalizedContext);\n } else {\n RNSentry.setContext(key, { error: '**non-serializable**' });\n }\n },\n\n /**\n * Closes the Native Layer SDK\n */\n async closeNativeSdk(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.closeNativeSdk().then(() => {\n this.enableNative = false;\n });\n },\n\n disableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.disableNativeFramesTracking();\n },\n\n enableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.enableNativeFramesTracking();\n },\n\n isNativeAvailable(): boolean {\n return this._isModuleLoaded(RNSentry);\n },\n\n async captureScreenshot(): Promise<Screenshot[] | null> {\n if (!this.enableNative) {\n debug.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.error(this._NativeClientError);\n return null;\n }\n\n let raw: NativeScreenshot[] | null | undefined;\n try {\n raw = await RNSentry.captureScreenshot();\n } catch (e) {\n debug.warn('Failed to capture screenshot', e);\n }\n\n if (raw) {\n return raw.map((item: NativeScreenshot) => ({\n ...item,\n data: new Uint8Array(item.data),\n }));\n } else {\n return null;\n }\n },\n\n async fetchViewHierarchy(): Promise<Uint8Array | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchViewHierarchy();\n return raw ? new Uint8Array(raw) : null;\n },\n\n startProfiling(platformProfilers: boolean): boolean {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { started, error } = RNSentry.startProfiling(platformProfilers);\n if (started) {\n debug.log('[NATIVE] Start Profiling');\n } else {\n debug.error('[NATIVE] Start Profiling Failed', error);\n }\n\n return !!started;\n },\n\n stopProfiling(): {\n hermesProfile: Hermes.Profile;\n nativeProfile?: NativeProfileEvent;\n androidProfile?: NativeAndroidProfileEvent;\n } | null {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { profile, nativeProfile, androidProfile, error } = RNSentry.stopProfiling();\n if (!profile || error) {\n debug.error('[NATIVE] Stop Profiling Failed', error);\n return null;\n }\n if (Platform.OS === 'ios' && !nativeProfile) {\n debug.warn('[NATIVE] Stop Profiling Failed: No Native Profile');\n }\n if (Platform.OS === 'android' && !androidProfile) {\n debug.warn('[NATIVE] Stop Profiling Failed: No Android Profile');\n }\n\n try {\n return {\n hermesProfile: JSON.parse(profile) as Hermes.Profile,\n nativeProfile: nativeProfile as NativeProfileEvent | undefined,\n androidProfile: androidProfile as NativeAndroidProfileEvent | undefined,\n };\n } catch (e) {\n debug.error('[NATIVE] Failed to parse Hermes Profile JSON', e);\n return null;\n }\n },\n\n fetchNativePackageName(): string | null {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return RNSentry.fetchNativePackageName() || null;\n },\n\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return RNSentry.fetchNativeStackFramesBy(instructionsAddr) || null;\n },\n\n async initNativeReactNavigationNewFrameTracking(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.initNativeReactNavigationNewFrameTracking();\n },\n\n async captureReplay(isHardCrash: boolean): Promise<string | null> {\n if (!this.enableNative) {\n debug.warn(`[NATIVE] \\`${this.captureReplay.name}\\` is not available when native is disabled.`);\n return Promise.resolve(null);\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.warn(`[NATIVE] \\`${this.captureReplay.name}\\` is not available when native is not available.`);\n return Promise.resolve(null);\n }\n\n return (await RNSentry.captureReplay(isHardCrash)) || null;\n },\n\n getCurrentReplayId(): string | null {\n if (!this.enableNative) {\n debug.warn(`[NATIVE] \\`${this.getCurrentReplayId.name}\\` is not available when native is disabled.`);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.warn(`[NATIVE] \\`${this.getCurrentReplayId.name}\\` is not available when native is not available.`);\n return null;\n }\n\n return RNSentry.getCurrentReplayId() || null;\n },\n\n async crashedLastRun(): Promise<boolean | null> {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n const result = await RNSentry.crashedLastRun();\n return typeof result === 'boolean' ? result : null;\n },\n\n getNewScreenTimeToDisplay(): Promise<number | null | undefined> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n return RNSentry.getNewScreenTimeToDisplay();\n },\n\n async getDataFromUri(uri: string): Promise<Uint8Array | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return null;\n }\n try {\n const data: number[] = await RNSentry.getDataFromUri(uri);\n return new Uint8Array(data);\n } catch (error) {\n debug.error('Error:', error);\n return null;\n }\n },\n\n popTimeToDisplayFor(key: string): Promise<number | undefined | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n try {\n return RNSentry.popTimeToDisplayFor(key);\n } catch (error) {\n debug.error('Error:', error);\n return Promise.resolve(null);\n }\n },\n\n setActiveSpanId(spanId): void {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return undefined;\n }\n\n try {\n RNSentry.setActiveSpanId(spanId);\n } catch (error) {\n debug.error('Error:', error);\n return undefined;\n }\n },\n\n async encodeToBase64(data: Uint8Array): Promise<string | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n try {\n const byteArray = Array.from(data);\n const base64 = await RNSentry.encodeToBase64(byteArray);\n return base64 || null;\n } catch (error) {\n debug.error('Error:', error);\n return Promise.resolve(null);\n }\n },\n\n primitiveProcessor: function (value: Primitive): string {\n return value as string;\n },\n\n /**\n * Gets the event from envelopeItem and applies the level filter to the selected event.\n * @param data An envelope item containing the event.\n * @returns The event from envelopeItem or undefined.\n */\n _processItem(item: EnvelopeItem): EnvelopeItem {\n const [itemHeader, itemPayload] = item;\n\n if (itemHeader.type == 'event' || itemHeader.type == 'transaction') {\n const event = this._processLevels(itemPayload as Event);\n\n if (NATIVE.platform === 'android') {\n if ('message' in event) {\n // @ts-expect-error Android still uses the old message object, without this the serialization of events will break.\n event.message = { message: event.message };\n }\n }\n\n return [itemHeader, event];\n }\n\n return item;\n },\n\n /**\n * Serializes all values of root-level keys into strings.\n * @param data key-value map.\n * @returns An object where all root-level values are strings.\n */\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string } {\n const serialized: { [key: string]: string } = {};\n\n Object.keys(data).forEach(dataKey => {\n const value = data[dataKey];\n serialized[dataKey] = typeof value === 'string' ? value : JSON.stringify(value);\n });\n\n return serialized;\n },\n\n /**\n * Convert js severity level in event.level and event.breadcrumbs to more widely supported levels.\n * @param event\n * @returns Event with more widely supported Severity level strings\n */\n _processLevels(event: Event): Event {\n const processed: Event = {\n ...event,\n level: event.level ? this._processLevel(event.level) : undefined,\n breadcrumbs: event.breadcrumbs?.map(breadcrumb => ({\n ...breadcrumb,\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n })),\n };\n\n return processed;\n },\n\n /**\n * Convert js severity level which has critical and log to more widely supported levels.\n * @param level\n * @returns More widely supported Severity level strings\n */\n _processLevel(level: SeverityLevel): SeverityLevel {\n if (level == ('log' as SeverityLevel)) {\n return 'debug' as SeverityLevel;\n }\n return level;\n },\n\n /**\n * Checks whether the RNSentry module is loaded.\n */\n _isModuleLoaded(module: Spec | undefined): module is Spec {\n return !!module;\n },\n\n _setPrimitiveProcessor: function (processor: (value: Primitive) => any): void {\n this.primitiveProcessor = processor;\n },\n\n _DisabledNativeError: new SentryError('Native is disabled'),\n\n _NativeClientError: new SentryError(\"Native Client is not available, can't start on native.\"),\n\n enableNative: true,\n nativeIsReady: false,\n platform: Platform.OS,\n};\n\n/**\n * Fethces the data from the given uri in Uint8Array format.\n * @param uri string\n * @returns Uint8Array | null\n */\nexport async function getDataFromUri(uri: string): Promise<Uint8Array | null> {\n return NATIVE.getDataFromUri(uri);\n}\n"]}
1
+ {"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAerC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,iBAAiB;;IAC/B,OAAO,oBAAoB,EAAE;QAC3B,CAAC,CAAC,MAAA,oBAAoB,CAAC,mBAAmB,0CAAE,GAAG,CAAO,UAAU,CAAC;QACjE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC;AAC7B,CAAC;AAED,MAAM,QAAQ,GAAqB,iBAAiB,EAAE,CAAC;AAiGvD,MAAM,GAAG,GAAG,UAAU,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,UAAgB,cAAc,CAAC,GAAW;;QAC9C,OAAO,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;CAAA","sourcesContent":["/* eslint-disable max-lines */\nimport type {\n BaseEnvelopeItemHeaders,\n Breadcrumb,\n Envelope,\n EnvelopeItem,\n Event,\n Package,\n Primitive,\n SeverityLevel,\n User,\n} from '@sentry/core';\nimport { debug, normalize, SentryError } from '@sentry/core';\nimport { NativeModules, Platform } from 'react-native';\nimport { isHardCrash } from './misc';\nimport type {\n NativeAppStartResponse,\n NativeDeviceContextsResponse,\n NativeFramesResponse,\n NativeReleaseResponse,\n NativeScreenshot,\n NativeStackFrames,\n Spec,\n} from './NativeRNSentry';\nimport type { AndroidProfilingOptions, ReactNativeClientOptions } from './options';\nimport type * as Hermes from './profiling/hermes';\nimport type { NativeAndroidProfileEvent, NativeProfileEvent } from './profiling/nativeTypes';\nimport type { MobileReplayOptions } from './replay/mobilereplay';\nimport type { RequiredKeysUser } from './user';\nimport { encodeUTF8 } from './utils/encode';\nimport { isTurboModuleEnabled } from './utils/environment';\nimport { convertToNormalizedObject } from './utils/normalize';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { base64StringFromByteArray } from './vendor';\n\n/**\n * Returns the RNSentry module. Dynamically resolves if NativeModule or TurboModule is used.\n */\nexport function getRNSentryModule(): Spec | undefined {\n return isTurboModuleEnabled()\n ? ReactNativeLibraries.TurboModuleRegistry?.get<Spec>('RNSentry')\n : NativeModules.RNSentry;\n}\n\nconst RNSentry: Spec | undefined = getRNSentryModule();\n\nexport interface Screenshot {\n data: Uint8Array;\n contentType: string;\n filename: string;\n}\n\nexport type NativeSdkOptions = Partial<ReactNativeClientOptions> & {\n devServerUrl: string | undefined;\n defaultSidecarUrl: string | undefined;\n ignoreErrorsStr?: string[] | undefined;\n ignoreErrorsRegex?: string[] | undefined;\n} & {\n mobileReplayOptions: MobileReplayOptions | undefined;\n androidProfilingOptions?: AndroidProfilingOptions | undefined;\n};\n\ninterface SentryNativeWrapper {\n enableNative: boolean;\n nativeIsReady: boolean;\n platform: typeof Platform.OS;\n\n _NativeClientError: Error;\n _DisabledNativeError: Error;\n\n _setPrimitiveProcessor: (processor: (value: Primitive) => void) => void;\n _processItem(envelopeItem: EnvelopeItem): EnvelopeItem;\n _processLevels(event: Event): Event;\n _processLevel(level: SeverityLevel): SeverityLevel;\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string };\n _isModuleLoaded(module: Spec | undefined): module is Spec;\n\n isNativeAvailable(): boolean;\n\n initNativeSdk(options: NativeSdkOptions): PromiseLike<boolean>;\n closeNativeSdk(): PromiseLike<void>;\n\n sendEnvelope(envelope: Envelope): Promise<void>;\n captureScreenshot(): Promise<Screenshot[] | null>;\n\n fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;\n fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse | null>;\n fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;\n fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;\n fetchNativeSdkInfo(): PromiseLike<Package | null>;\n\n disableNativeFramesTracking(): void;\n enableNativeFramesTracking(): void;\n\n addBreadcrumb(breadcrumb: Breadcrumb): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(key: string, context: { [key: string]: any } | null): void;\n clearBreadcrumbs(): void;\n setExtra(key: string, extra: unknown): void;\n setUser(user: User | null): void;\n setTag(key: string, value?: string): void;\n setAttribute(key: string, value: string | number | boolean): void;\n setAttributes(attributes: Record<string, string | number | boolean>): void;\n\n nativeCrash(): void;\n\n fetchModules(): Promise<Record<string, string> | null>;\n fetchViewHierarchy(): PromiseLike<Uint8Array | null>;\n\n startProfiling(platformProfilers: boolean): boolean;\n stopProfiling(): {\n hermesProfile: Hermes.Profile;\n nativeProfile?: NativeProfileEvent;\n androidProfile?: NativeAndroidProfileEvent;\n } | null;\n\n fetchNativePackageName(): string | null;\n\n /**\n * Fetches native stack frames and debug images for the instructions addresses.\n */\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null;\n initNativeReactNavigationNewFrameTracking(): Promise<void>;\n\n captureReplay(isHardCrash: boolean): Promise<string | null>;\n getCurrentReplayId(): string | null;\n\n crashedLastRun(): Promise<boolean | null>;\n getNewScreenTimeToDisplay(): Promise<number | null | undefined>;\n\n getDataFromUri(uri: string): Promise<Uint8Array | null>;\n popTimeToDisplayFor(key: string): Promise<number | undefined | null>;\n\n setActiveSpanId(spanId: string): void;\n\n encodeToBase64(data: Uint8Array): Promise<string | null>;\n\n primitiveProcessor(value: Primitive): string;\n}\n\nconst EOL = encodeUTF8('\\n');\n\n/**\n * Our internal interface for calling native functions\n */\nexport const NATIVE: SentryNativeWrapper = {\n async fetchModules(): Promise<Record<string, string> | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchModules();\n if (raw) {\n return JSON.parse(raw);\n }\n return null;\n },\n /**\n * Sending the envelope over the bridge to native\n * @param envelope Envelope\n */\n async sendEnvelope(envelope: Envelope): Promise<void> {\n if (!this.enableNative) {\n debug.warn('Event was skipped as native SDK is not enabled.');\n return;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const [envelopeHeader, envelopeItems] = envelope;\n\n const headerString = JSON.stringify(envelopeHeader);\n const headerBytes = encodeUTF8(headerString);\n let envelopeBytes: Uint8Array = new Uint8Array(headerBytes.length + EOL.length);\n envelopeBytes.set(headerBytes);\n envelopeBytes.set(EOL, headerBytes.length);\n\n let hardCrashed: boolean = false;\n for (const rawItem of envelopeItems) {\n const [itemHeader, itemPayload] = this._processItem(rawItem);\n\n let bytesContentType: string;\n let bytesPayload: number[] | Uint8Array | undefined;\n\n if (typeof itemPayload === 'string') {\n bytesContentType = 'text/plain';\n bytesPayload = encodeUTF8(itemPayload);\n } else if (itemPayload instanceof Uint8Array) {\n bytesContentType =\n typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/octet-stream';\n bytesPayload = itemPayload;\n } else {\n bytesContentType = typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/json';\n bytesPayload = encodeUTF8(JSON.stringify(itemPayload));\n if (!hardCrashed) {\n hardCrashed = isHardCrash(itemPayload);\n }\n }\n\n // Content type is not inside BaseEnvelopeItemHeaders.\n (itemHeader as BaseEnvelopeItemHeaders).content_type = bytesContentType;\n (itemHeader as BaseEnvelopeItemHeaders).length = bytesPayload.length;\n const serializedItemHeader = JSON.stringify(itemHeader);\n\n const bytesItemHeader = encodeUTF8(serializedItemHeader);\n const newBytes = new Uint8Array(\n envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length + EOL.length,\n );\n newBytes.set(envelopeBytes);\n newBytes.set(bytesItemHeader, envelopeBytes.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length);\n newBytes.set(bytesPayload, envelopeBytes.length + bytesItemHeader.length + EOL.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length);\n envelopeBytes = newBytes;\n }\n\n await RNSentry.captureEnvelope(base64StringFromByteArray(envelopeBytes), { hardCrashed });\n },\n\n /**\n * Starts native with the provided options.\n * @param options ReactNativeClientOptions\n */\n async initNativeSdk(originalOptions: NativeSdkOptions): Promise<boolean> {\n const options: NativeSdkOptions = {\n enableNative: true,\n autoInitializeNativeSdk: true,\n ...originalOptions,\n // Keeps original behavior of enableLogs by not setting it when not defined.\n ...(originalOptions.enableLogs !== undefined\n ? { enableLogs: originalOptions.enableLogs && originalOptions.logsOrigin !== 'js' }\n : {}),\n };\n\n if (!options.enableNative) {\n if (options.enableNativeNagger) {\n debug.warn('Note: Native Sentry SDK is disabled.');\n }\n this.enableNative = false;\n return false;\n }\n if (!options.autoInitializeNativeSdk) {\n if (options.enableNativeNagger) {\n debug.warn(\n 'Note: Native Sentry SDK was not initialized automatically, you will need to initialize it manually. If you wish to disable the native SDK and get rid of this warning, pass enableNative: false',\n );\n }\n this.enableNative = true;\n return false;\n }\n\n if (!options.dsn) {\n debug.warn(\n 'Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized.',\n );\n this.enableNative = false;\n return false;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n const ignoreErrorsStr = options.ignoreErrors?.filter(item => typeof item === 'string') as string[] | undefined;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const ignoreErrorsRegex = options.ignoreErrors\n ?.filter(item => item instanceof RegExp)\n .map(item => (item as RegExp).source) as string[] | undefined;\n\n if (ignoreErrorsStr && ignoreErrorsStr.length > 0) {\n options.ignoreErrorsStr = ignoreErrorsStr;\n }\n if (ignoreErrorsRegex && ignoreErrorsRegex.length > 0) {\n options.ignoreErrorsRegex = ignoreErrorsRegex;\n }\n\n // filter out all the options that would crash native.\n /* eslint-disable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n const {\n beforeSend,\n beforeBreadcrumb,\n beforeSendTransaction,\n beforeSendMetric,\n integrations,\n ignoreErrors,\n logsOrigin,\n androidProfilingOptions,\n ...filteredOptions\n } = options;\n /* eslint-enable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n\n // Move androidProfilingOptions into _experiments\n if (androidProfilingOptions) {\n filteredOptions._experiments = {\n ...filteredOptions._experiments,\n androidProfilingOptions,\n };\n }\n\n const nativeIsReady = await RNSentry.initNativeSdk(filteredOptions);\n\n this.nativeIsReady = nativeIsReady;\n this.enableNative = true;\n\n return nativeIsReady;\n },\n\n /**\n * Fetches the attributes to be set into logs from Native\n */\n async fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeLogAttributes();\n },\n /**\n * Fetches the release from native\n */\n async fetchNativeRelease(): Promise<NativeReleaseResponse> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeRelease();\n },\n\n /**\n * Fetches the Sdk info for the native sdk.\n */\n async fetchNativeSdkInfo(): Promise<Package | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeSdkInfo();\n },\n\n /**\n * Fetches the device contexts. Not used on Android.\n */\n async fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeDeviceContexts();\n },\n\n async fetchNativeAppStart(): Promise<NativeAppStartResponse | null> {\n if (!this.enableNative) {\n debug.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.error(this._NativeClientError);\n return null;\n }\n\n return RNSentry.fetchNativeAppStart();\n },\n\n async fetchNativeFrames(): Promise<NativeFramesResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeFrames();\n },\n\n /**\n * Triggers a native crash.\n * Use this only for testing purposes.\n */\n nativeCrash(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.crash();\n },\n\n /**\n * Sets the user in the native scope.\n * Passing null clears the user.\n */\n setUser(user: User | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // separate and serialize all non-default user keys.\n let userKeys = null;\n let userDataKeys = null;\n if (user) {\n const { id, ip_address, email, username, geo, ...otherKeys } = user;\n const requiredUser: RequiredKeysUser = {\n id,\n ip_address,\n email,\n username,\n geo,\n };\n userKeys = this._serializeObject(requiredUser);\n userDataKeys = this._serializeObject(otherKeys);\n }\n\n RNSentry.setUser(userKeys, userDataKeys);\n },\n\n /**\n * Sets a tag in the native module.\n * @param key string\n * @param value string\n */\n setTag(key: string, value?: string): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const stringifiedValue = typeof value === 'string' ? value : JSON.stringify(value);\n\n RNSentry.setTag(key, stringifiedValue);\n },\n\n /**\n * Sets an extra in the native scope, will stringify\n * extra value if it isn't already a string.\n * @param key string\n * @param extra any\n */\n setExtra(key: string, extra: unknown): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n if (typeof extra === 'string') {\n return RNSentry.setExtra(key, extra);\n }\n if (typeof extra === 'undefined') {\n return RNSentry.setExtra(key, 'undefined');\n }\n\n let stringifiedExtra: string | undefined;\n try {\n const normalizedExtra = normalize(extra);\n stringifiedExtra = JSON.stringify(normalizedExtra);\n } catch (e) {\n debug.error('Extra for key ${key} not passed to native SDK, because it contains non-stringifiable values', e);\n }\n\n if (typeof stringifiedExtra === 'string') {\n return RNSentry.setExtra(key, stringifiedExtra);\n }\n return RNSentry.setExtra(key, '**non-stringifiable**');\n },\n\n /**\n * Adds breadcrumb to the native scope.\n * @param breadcrumb Breadcrumb\n */\n addBreadcrumb(breadcrumb: Breadcrumb): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.addBreadcrumb({\n ...breadcrumb,\n // Process and convert deprecated levels\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n });\n },\n\n /**\n * Clears breadcrumbs on the native scope.\n */\n clearBreadcrumbs(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.clearBreadcrumbs();\n },\n\n /**\n * Sets context on the native scope.\n * @param key string\n * @param context key-value map\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(key: string, context: { [key: string]: any } | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n if (context === null) {\n return RNSentry.setContext(key, null);\n }\n\n let normalizedContext: Record<string, unknown> | undefined;\n try {\n normalizedContext = convertToNormalizedObject(context);\n } catch (e) {\n debug.error('Context for key ${key} not passed to native SDK, because it contains non-serializable values', e);\n }\n\n if (normalizedContext) {\n RNSentry.setContext(key, normalizedContext);\n } else {\n RNSentry.setContext(key, { error: '**non-serializable**' });\n }\n },\n\n /**\n * Sets an attribute on the native scope.\n * @param key string\n * @param value primitive value (string, number, or boolean)\n */\n setAttribute(key: string, value: string | number | boolean): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const stringifiedValue = this.primitiveProcessor(value);\n RNSentry.setAttribute(key, stringifiedValue);\n },\n\n /**\n * Sets multiple attributes on the native scope.\n * @param attributes key-value map of attributes (only string, number, and boolean values)\n */\n setAttributes(attributes: Record<string, string | number | boolean>): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const serializedAttributes: Record<string, string> = {};\n Object.keys(attributes).forEach(key => {\n serializedAttributes[key] = this.primitiveProcessor(attributes[key]);\n });\n\n RNSentry.setAttributes(serializedAttributes);\n },\n\n /**\n * Closes the Native Layer SDK\n */\n async closeNativeSdk(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.closeNativeSdk().then(() => {\n this.enableNative = false;\n });\n },\n\n disableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.disableNativeFramesTracking();\n },\n\n enableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.enableNativeFramesTracking();\n },\n\n isNativeAvailable(): boolean {\n return this._isModuleLoaded(RNSentry);\n },\n\n async captureScreenshot(): Promise<Screenshot[] | null> {\n if (!this.enableNative) {\n debug.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.error(this._NativeClientError);\n return null;\n }\n\n let raw: NativeScreenshot[] | null | undefined;\n try {\n raw = await RNSentry.captureScreenshot();\n } catch (e) {\n debug.warn('Failed to capture screenshot', e);\n }\n\n if (raw) {\n return raw.map((item: NativeScreenshot) => ({\n ...item,\n data: new Uint8Array(item.data),\n }));\n } else {\n return null;\n }\n },\n\n async fetchViewHierarchy(): Promise<Uint8Array | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchViewHierarchy();\n return raw ? new Uint8Array(raw) : null;\n },\n\n startProfiling(platformProfilers: boolean): boolean {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { started, error } = RNSentry.startProfiling(platformProfilers);\n if (started) {\n debug.log('[NATIVE] Start Profiling');\n } else {\n debug.error('[NATIVE] Start Profiling Failed', error);\n }\n\n return !!started;\n },\n\n stopProfiling(): {\n hermesProfile: Hermes.Profile;\n nativeProfile?: NativeProfileEvent;\n androidProfile?: NativeAndroidProfileEvent;\n } | null {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { profile, nativeProfile, androidProfile, error } = RNSentry.stopProfiling();\n if (!profile || error) {\n debug.error('[NATIVE] Stop Profiling Failed', error);\n return null;\n }\n if (Platform.OS === 'ios' && !nativeProfile) {\n debug.warn('[NATIVE] Stop Profiling Failed: No Native Profile');\n }\n if (Platform.OS === 'android' && !androidProfile) {\n debug.warn('[NATIVE] Stop Profiling Failed: No Android Profile');\n }\n\n try {\n return {\n hermesProfile: JSON.parse(profile) as Hermes.Profile,\n nativeProfile: nativeProfile as NativeProfileEvent | undefined,\n androidProfile: androidProfile as NativeAndroidProfileEvent | undefined,\n };\n } catch (e) {\n debug.error('[NATIVE] Failed to parse Hermes Profile JSON', e);\n return null;\n }\n },\n\n fetchNativePackageName(): string | null {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return RNSentry.fetchNativePackageName() || null;\n },\n\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return RNSentry.fetchNativeStackFramesBy(instructionsAddr) || null;\n },\n\n async initNativeReactNavigationNewFrameTracking(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.initNativeReactNavigationNewFrameTracking();\n },\n\n async captureReplay(isHardCrash: boolean): Promise<string | null> {\n if (!this.enableNative) {\n debug.warn(`[NATIVE] \\`${this.captureReplay.name}\\` is not available when native is disabled.`);\n return Promise.resolve(null);\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.warn(`[NATIVE] \\`${this.captureReplay.name}\\` is not available when native is not available.`);\n return Promise.resolve(null);\n }\n\n return (await RNSentry.captureReplay(isHardCrash)) || null;\n },\n\n getCurrentReplayId(): string | null {\n if (!this.enableNative) {\n debug.warn(`[NATIVE] \\`${this.getCurrentReplayId.name}\\` is not available when native is disabled.`);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.warn(`[NATIVE] \\`${this.getCurrentReplayId.name}\\` is not available when native is not available.`);\n return null;\n }\n\n return RNSentry.getCurrentReplayId() || null;\n },\n\n async crashedLastRun(): Promise<boolean | null> {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n const result = await RNSentry.crashedLastRun();\n return typeof result === 'boolean' ? result : null;\n },\n\n getNewScreenTimeToDisplay(): Promise<number | null | undefined> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n return RNSentry.getNewScreenTimeToDisplay();\n },\n\n async getDataFromUri(uri: string): Promise<Uint8Array | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return null;\n }\n try {\n const data: number[] = await RNSentry.getDataFromUri(uri);\n return new Uint8Array(data);\n } catch (error) {\n debug.error('Error:', error);\n return null;\n }\n },\n\n popTimeToDisplayFor(key: string): Promise<number | undefined | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n try {\n return RNSentry.popTimeToDisplayFor(key);\n } catch (error) {\n debug.error('Error:', error);\n return Promise.resolve(null);\n }\n },\n\n setActiveSpanId(spanId): void {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return undefined;\n }\n\n try {\n RNSentry.setActiveSpanId(spanId);\n } catch (error) {\n debug.error('Error:', error);\n return undefined;\n }\n },\n\n async encodeToBase64(data: Uint8Array): Promise<string | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n try {\n const byteArray = Array.from(data);\n const base64 = await RNSentry.encodeToBase64(byteArray);\n return base64 || null;\n } catch (error) {\n debug.error('Error:', error);\n return Promise.resolve(null);\n }\n },\n\n primitiveProcessor: function (value: Primitive): string {\n return value as string;\n },\n\n /**\n * Gets the event from envelopeItem and applies the level filter to the selected event.\n * @param data An envelope item containing the event.\n * @returns The event from envelopeItem or undefined.\n */\n _processItem(item: EnvelopeItem): EnvelopeItem {\n const [itemHeader, itemPayload] = item;\n\n if (itemHeader.type == 'event' || itemHeader.type == 'transaction') {\n const event = this._processLevels(itemPayload as Event);\n\n if (NATIVE.platform === 'android') {\n if ('message' in event) {\n // @ts-expect-error Android still uses the old message object, without this the serialization of events will break.\n event.message = { message: event.message };\n }\n }\n\n return [itemHeader, event];\n }\n\n return item;\n },\n\n /**\n * Serializes all values of root-level keys into strings.\n * @param data key-value map.\n * @returns An object where all root-level values are strings.\n */\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string } {\n const serialized: { [key: string]: string } = {};\n\n Object.keys(data).forEach(dataKey => {\n const value = data[dataKey];\n serialized[dataKey] = typeof value === 'string' ? value : JSON.stringify(value);\n });\n\n return serialized;\n },\n\n /**\n * Convert js severity level in event.level and event.breadcrumbs to more widely supported levels.\n * @param event\n * @returns Event with more widely supported Severity level strings\n */\n _processLevels(event: Event): Event {\n const processed: Event = {\n ...event,\n level: event.level ? this._processLevel(event.level) : undefined,\n breadcrumbs: event.breadcrumbs?.map(breadcrumb => ({\n ...breadcrumb,\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n })),\n };\n\n return processed;\n },\n\n /**\n * Convert js severity level which has critical and log to more widely supported levels.\n * @param level\n * @returns More widely supported Severity level strings\n */\n _processLevel(level: SeverityLevel): SeverityLevel {\n if (level == ('log' as SeverityLevel)) {\n return 'debug' as SeverityLevel;\n }\n return level;\n },\n\n /**\n * Checks whether the RNSentry module is loaded.\n */\n _isModuleLoaded(module: Spec | undefined): module is Spec {\n return !!module;\n },\n\n _setPrimitiveProcessor: function (processor: (value: Primitive) => any): void {\n this.primitiveProcessor = processor;\n },\n\n _DisabledNativeError: new SentryError('Native is disabled'),\n\n _NativeClientError: new SentryError(\"Native Client is not available, can't start on native.\"),\n\n enableNative: true,\n nativeIsReady: false,\n platform: Platform.OS,\n};\n\n/**\n * Fethces the data from the given uri in Uint8Array format.\n * @param uri string\n * @returns Uint8Array | null\n */\nexport async function getDataFromUri(uri: string): Promise<Uint8Array | null> {\n return NATIVE.getDataFromUri(uri);\n}\n"]}
package/ios/RNSentry.mm CHANGED
@@ -723,6 +723,22 @@ RCT_EXPORT_METHOD(setTag : (NSString *)key value : (NSString *)value)
723
723
  configureScope:^(SentryScope *_Nonnull scope) { [scope setTagValue:value forKey:key]; }];
724
724
  }
725
725
 
726
+ RCT_EXPORT_METHOD(setAttribute : (NSString *)key value : (NSString *)value)
727
+ {
728
+ // TODO(alwx): This is not implemented in sentry-cocoa yet
729
+ /*[SentrySDKWrapper
730
+ configureScope:^(SentryScope *_Nonnull scope) { [scope setAttribute:value forKey:key]; }];*/
731
+ }
732
+
733
+ RCT_EXPORT_METHOD(setAttributes : (NSDictionary *)attributes)
734
+ {
735
+ // TODO(alwx): This is not implemented in sentry-cocoa yet
736
+ /*[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
737
+ [attributes enumerateKeysAndObjectsUsingBlock:^(
738
+ NSString *key, NSString *value, BOOL *stop) { [scope setAttribute:value forKey:key]; }];
739
+ }];*/
740
+ }
741
+
726
742
  RCT_EXPORT_METHOD(crash) { [SentrySDKWrapper crash]; }
727
743
 
728
744
  RCT_EXPORT_METHOD(
@@ -3,4 +3,4 @@
3
3
  NSString *const NATIVE_SDK_NAME = @"sentry.cocoa.react-native";
4
4
  NSString *const REACT_NATIVE_SDK_NAME = @"sentry.javascript.react-native";
5
5
  NSString *const REACT_NATIVE_SDK_PACKAGE_NAME = @"npm:@sentry/react-native";
6
- NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"7.10.0";
6
+ NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"7.11.0";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sentry/react-native",
3
3
  "homepage": "https://github.com/getsentry/sentry-react-native",
4
4
  "repository": "https://github.com/getsentry/sentry-react-native",
5
- "version": "7.10.0",
5
+ "version": "7.11.0",
6
6
  "description": "Official Sentry SDK for react-native",
7
7
  "typings": "dist/js/index.d.ts",
8
8
  "types": "dist/js/index.d.ts",
@@ -68,21 +68,21 @@
68
68
  "react-native": ">=0.65.0"
69
69
  },
70
70
  "dependencies": {
71
- "@sentry/babel-plugin-component-annotate": "4.7.0",
72
- "@sentry/browser": "10.36.0",
71
+ "@sentry/babel-plugin-component-annotate": "4.8.0",
72
+ "@sentry/browser": "10.37.0",
73
73
  "@sentry/cli": "2.58.4",
74
- "@sentry/core": "10.36.0",
75
- "@sentry/react": "10.36.0",
76
- "@sentry/types": "10.36.0"
74
+ "@sentry/core": "10.37.0",
75
+ "@sentry/react": "10.37.0",
76
+ "@sentry/types": "10.37.0"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@babel/core": "^7.26.7",
80
80
  "@expo/metro-config": "~0.20.0",
81
81
  "@mswjs/interceptors": "^0.25.15",
82
82
  "@react-native/babel-preset": "0.80.0",
83
- "@sentry-internal/eslint-config-sdk": "10.36.0",
84
- "@sentry-internal/eslint-plugin-sdk": "10.36.0",
85
- "@sentry-internal/typescript": "10.36.0",
83
+ "@sentry-internal/eslint-config-sdk": "10.37.0",
84
+ "@sentry-internal/eslint-plugin-sdk": "10.37.0",
85
+ "@sentry-internal/typescript": "10.37.0",
86
86
  "@sentry/wizard": "6.11.0",
87
87
  "@testing-library/react-native": "^13.2.2",
88
88
  "@types/jest": "^29.5.13",
@@ -32,6 +32,8 @@ export interface Spec extends TurboModule {
32
32
  setContext(key: string, value: UnsafeObject | null): void;
33
33
  setExtra(key: string, value: string): void;
34
34
  setTag(key: string, value: string): void;
35
+ setAttribute(key: string, value: string): void;
36
+ setAttributes(attributes: UnsafeObject): void;
35
37
  enableNativeFramesTracking(): void;
36
38
  fetchModules(): Promise<string | undefined | null>;
37
39
  fetchViewHierarchy(): Promise<number[] | undefined | null>;
@@ -25,6 +25,8 @@ export interface Spec extends TurboModule {
25
25
  setContext(key: string, value: UnsafeObject | null): void;
26
26
  setExtra(key: string, value: string): void;
27
27
  setTag(key: string, value: string): void;
28
+ setAttribute(key: string, value: string): void;
29
+ setAttributes(attributes: UnsafeObject): void;
28
30
  enableNativeFramesTracking(): void;
29
31
  fetchModules(): Promise<string | undefined | null>;
30
32
  fetchViewHierarchy(): Promise<number[] | undefined | null>;
@@ -1,3 +1,4 @@
1
+ import type { SpanAttributeValue } from '@sentry/core';
1
2
  import * as React from 'react';
2
3
  export type TouchEventBoundaryProps = {
3
4
  /**
@@ -30,6 +31,13 @@ export type TouchEventBoundaryProps = {
30
31
  * Label Name used to identify the touched element.
31
32
  */
32
33
  labelName?: string;
34
+ /**
35
+ * Custom attributes to add to user interaction spans.
36
+ * Accepts an object with string keys and values that are strings, numbers, booleans, or arrays.
37
+ *
38
+ * @experimental This API is experimental and may change in future releases.
39
+ */
40
+ spanAttributes?: Record<string, SpanAttributeValue>;
33
41
  };
34
42
  /**
35
43
  * Boundary to log breadcrumbs for interaction events.
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "7.10.0";
3
+ export declare const SDK_VERSION = "7.11.0";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -60,6 +60,8 @@ interface SentryNativeWrapper {
60
60
  setExtra(key: string, extra: unknown): void;
61
61
  setUser(user: User | null): void;
62
62
  setTag(key: string, value?: string): void;
63
+ setAttribute(key: string, value: string | number | boolean): void;
64
+ setAttributes(attributes: Record<string, string | number | boolean>): void;
63
65
  nativeCrash(): void;
64
66
  fetchModules(): Promise<Record<string, string> | null>;
65
67
  fetchViewHierarchy(): PromiseLike<Uint8Array | null>;