@sentry/react-native 5.25.0 → 5.26.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.
Files changed (101) hide show
  1. package/CHANGELOG.md +139 -3
  2. package/RNSentry.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +63 -2
  5. package/android/src/main/java/io/sentry/react/RNSentryReplayBreadcrumbConverter.java +187 -0
  6. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +10 -0
  7. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +10 -0
  8. package/dist/js/NativeRNSentry.d.ts +2 -0
  9. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  10. package/dist/js/NativeRNSentry.js.map +1 -1
  11. package/dist/js/client.d.ts +4 -0
  12. package/dist/js/client.d.ts.map +1 -1
  13. package/dist/js/client.js +12 -2
  14. package/dist/js/client.js.map +1 -1
  15. package/dist/js/integrations/default.d.ts.map +1 -1
  16. package/dist/js/integrations/default.js +9 -1
  17. package/dist/js/integrations/default.js.map +1 -1
  18. package/dist/js/integrations/exports.d.ts +2 -1
  19. package/dist/js/integrations/exports.d.ts.map +1 -1
  20. package/dist/js/integrations/exports.js +2 -1
  21. package/dist/js/integrations/exports.js.map +1 -1
  22. package/dist/js/integrations/index.d.ts +1 -0
  23. package/dist/js/integrations/index.d.ts.map +1 -1
  24. package/dist/js/integrations/index.js +1 -0
  25. package/dist/js/integrations/index.js.map +1 -1
  26. package/dist/js/options.d.ts +24 -2
  27. package/dist/js/options.d.ts.map +1 -1
  28. package/dist/js/options.js.map +1 -1
  29. package/dist/js/replay/mobilereplay.d.ts +47 -0
  30. package/dist/js/replay/mobilereplay.d.ts.map +1 -0
  31. package/dist/js/replay/mobilereplay.js +100 -0
  32. package/dist/js/replay/mobilereplay.js.map +1 -0
  33. package/dist/js/replay/networkUtils.d.ts +8 -0
  34. package/dist/js/replay/networkUtils.d.ts.map +1 -0
  35. package/dist/js/replay/networkUtils.js +52 -0
  36. package/dist/js/replay/networkUtils.js.map +1 -0
  37. package/dist/js/replay/xhrUtils.d.ts +6 -0
  38. package/dist/js/replay/xhrUtils.d.ts.map +1 -0
  39. package/dist/js/replay/xhrUtils.js +31 -0
  40. package/dist/js/replay/xhrUtils.js.map +1 -0
  41. package/dist/js/tools/enableLogger.d.ts +5 -0
  42. package/dist/js/tools/enableLogger.d.ts.map +1 -0
  43. package/dist/js/tools/enableLogger.js +13 -0
  44. package/dist/js/tools/enableLogger.js.map +1 -0
  45. package/dist/js/tools/metroconfig.d.ts +19 -4
  46. package/dist/js/tools/metroconfig.d.ts.map +1 -1
  47. package/dist/js/tools/metroconfig.js +38 -3
  48. package/dist/js/tools/metroconfig.js.map +1 -1
  49. package/dist/js/tools/sentryBabelTransformer.d.ts +4 -0
  50. package/dist/js/tools/sentryBabelTransformer.d.ts.map +1 -0
  51. package/dist/js/tools/sentryBabelTransformer.js +28 -0
  52. package/dist/js/tools/sentryBabelTransformer.js.map +1 -0
  53. package/dist/js/tools/sentryBabelTransformerUtils.d.ts +18 -0
  54. package/dist/js/tools/sentryBabelTransformerUtils.d.ts.map +1 -0
  55. package/dist/js/tools/sentryBabelTransformerUtils.js +67 -0
  56. package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -0
  57. package/dist/js/tools/vendor/metro/metroBabelTransformer.d.ts +35 -0
  58. package/dist/js/tools/vendor/metro/metroBabelTransformer.d.ts.map +1 -0
  59. package/dist/js/tools/vendor/metro/metroBabelTransformer.js +3 -0
  60. package/dist/js/tools/vendor/metro/metroBabelTransformer.js.map +1 -0
  61. package/dist/js/touchevents.d.ts.map +1 -1
  62. package/dist/js/touchevents.js +57 -30
  63. package/dist/js/touchevents.js.map +1 -1
  64. package/dist/js/utils/clientutils.d.ts +10 -0
  65. package/dist/js/utils/clientutils.d.ts.map +1 -0
  66. package/dist/js/utils/clientutils.js +9 -0
  67. package/dist/js/utils/clientutils.js.map +1 -0
  68. package/dist/js/utils/environment.d.ts +4 -0
  69. package/dist/js/utils/environment.d.ts.map +1 -1
  70. package/dist/js/utils/environment.js +8 -0
  71. package/dist/js/utils/environment.js.map +1 -1
  72. package/dist/js/utils/worldwide.d.ts +6 -0
  73. package/dist/js/utils/worldwide.d.ts.map +1 -1
  74. package/dist/js/utils/worldwide.js.map +1 -1
  75. package/dist/js/version.d.ts +1 -1
  76. package/dist/js/version.js +1 -1
  77. package/dist/js/version.js.map +1 -1
  78. package/dist/js/wrapper.d.ts +7 -1
  79. package/dist/js/wrapper.d.ts.map +1 -1
  80. package/dist/js/wrapper.js +24 -0
  81. package/dist/js/wrapper.js.map +1 -1
  82. package/ios/RNSentry.mm +33 -1
  83. package/ios/RNSentryReplay.h +8 -0
  84. package/ios/RNSentryReplay.m +72 -0
  85. package/ios/RNSentryReplayBreadcrumbConverter.h +16 -0
  86. package/ios/RNSentryReplayBreadcrumbConverter.m +168 -0
  87. package/package.json +2 -1
  88. package/src/js/NativeRNSentry.ts +2 -0
  89. package/ts3.8/dist/js/NativeRNSentry.d.ts +2 -0
  90. package/ts3.8/dist/js/client.d.ts +4 -0
  91. package/ts3.8/dist/js/integrations/exports.d.ts +2 -1
  92. package/ts3.8/dist/js/integrations/index.d.ts +1 -0
  93. package/ts3.8/dist/js/options.d.ts +24 -2
  94. package/ts3.8/dist/js/replay/mobilereplay.d.ts +47 -0
  95. package/ts3.8/dist/js/replay/networkUtils.d.ts +8 -0
  96. package/ts3.8/dist/js/replay/xhrUtils.d.ts +6 -0
  97. package/ts3.8/dist/js/utils/clientutils.d.ts +10 -0
  98. package/ts3.8/dist/js/utils/environment.d.ts +4 -0
  99. package/ts3.8/dist/js/utils/worldwide.d.ts +6 -0
  100. package/ts3.8/dist/js/version.d.ts +1 -1
  101. package/ts3.8/dist/js/wrapper.d.ts +7 -1
@@ -0,0 +1,168 @@
1
+ #import "RNSentryReplayBreadcrumbConverter.h"
2
+
3
+ @import Sentry;
4
+
5
+ #if SENTRY_TARGET_REPLAY_SUPPORTED
6
+
7
+ @implementation RNSentryReplayBreadcrumbConverter {
8
+ SentrySRDefaultBreadcrumbConverter *defaultConverter;
9
+ }
10
+
11
+ - (instancetype _Nonnull)init {
12
+ if (self = [super init]) {
13
+ self->defaultConverter =
14
+ [SentrySessionReplayIntegration createDefaultBreadcrumbConverter];
15
+ }
16
+ return self;
17
+ }
18
+
19
+ - (id<SentryRRWebEvent> _Nullable)convertFrom:
20
+ (SentryBreadcrumb *_Nonnull)breadcrumb {
21
+ assert(breadcrumb.timestamp != nil);
22
+
23
+ if ([breadcrumb.category isEqualToString:@"sentry.event"] ||
24
+ [breadcrumb.category isEqualToString:@"sentry.transaction"]) {
25
+ // Do not add Sentry Event breadcrumbs to replay
26
+ return nil;
27
+ }
28
+
29
+ if ([breadcrumb.category isEqualToString:@"http"]) {
30
+ // Drop native network breadcrumbs to avoid duplicates
31
+ return nil;
32
+ }
33
+
34
+ if ([breadcrumb.category isEqualToString:@"touch"]) {
35
+ return [self convertTouch:breadcrumb];
36
+ }
37
+
38
+ if ([breadcrumb.category isEqualToString:@"navigation"]) {
39
+ return [SentrySessionReplayIntegration
40
+ createBreadcrumbwithTimestamp:breadcrumb.timestamp
41
+ category:breadcrumb.category
42
+ message:nil
43
+ level:breadcrumb.level
44
+ data:breadcrumb.data];
45
+ }
46
+
47
+ if ([breadcrumb.category isEqualToString:@"xhr"]) {
48
+ return [self convertNavigation:breadcrumb];
49
+ }
50
+
51
+ SentryRRWebEvent *nativeBreadcrumb =
52
+ [self->defaultConverter convertFrom:breadcrumb];
53
+
54
+ // ignore native navigation breadcrumbs
55
+ if (nativeBreadcrumb && nativeBreadcrumb.data &&
56
+ nativeBreadcrumb.data[@"payload"] &&
57
+ nativeBreadcrumb.data[@"payload"][@"category"] &&
58
+ [nativeBreadcrumb.data[@"payload"][@"category"]
59
+ isEqualToString:@"navigation"]) {
60
+ return nil;
61
+ }
62
+
63
+ return nativeBreadcrumb;
64
+ }
65
+
66
+ - (id<SentryRRWebEvent> _Nullable) convertTouch:(SentryBreadcrumb *_Nonnull)breadcrumb {
67
+ if (breadcrumb.data == nil) {
68
+ return nil;
69
+ }
70
+
71
+ NSMutableArray *path = [breadcrumb.data valueForKey:@"path"];
72
+ NSString* message = [RNSentryReplayBreadcrumbConverter getTouchPathMessageFrom:path];
73
+
74
+ return [SentrySessionReplayIntegration
75
+ createBreadcrumbwithTimestamp:breadcrumb.timestamp
76
+ category:@"ui.tap"
77
+ message:message
78
+ level:breadcrumb.level
79
+ data:breadcrumb.data];
80
+ }
81
+
82
+ + (NSString* _Nullable) getTouchPathMessageFrom:(NSArray* _Nullable) path {
83
+ if (path == nil) {
84
+ return nil;
85
+ }
86
+
87
+ NSInteger pathCount = [path count];
88
+ if (pathCount <= 0) {
89
+ return nil;
90
+ }
91
+
92
+ NSMutableString *message = [[NSMutableString alloc] init];
93
+ for (NSInteger i = MIN(3, pathCount - 1); i >= 0; i--) {
94
+ NSDictionary *item = [path objectAtIndex:i];
95
+ if (item == nil) {
96
+ return nil; // There should be no nil (undefined) from JS, but to be safe we check it here
97
+ }
98
+
99
+ id name = [item objectForKey:@"name"];
100
+ id label = [item objectForKey:@"label"];
101
+ BOOL hasName = [name isKindOfClass:[NSString class]];
102
+ BOOL hasLabel = [label isKindOfClass:[NSString class]];
103
+ if (!hasName && !hasLabel) {
104
+ return nil; // This again should never be allowed in JS, but to be safe we check it here
105
+ }
106
+ if (hasLabel) {
107
+ [message appendString:(NSString *)label];
108
+ } else if (hasName) {
109
+ [message appendString:(NSString *)name];
110
+ }
111
+
112
+ id element = [item objectForKey:@"element"];
113
+ id file = [item objectForKey:@"file"];
114
+ BOOL hasElement = [element isKindOfClass:[NSString class]];
115
+ BOOL hasFile = [file isKindOfClass:[NSString class]];
116
+ if (hasElement && hasFile) {
117
+ [message appendFormat:@"(%@, %@)", (NSString *)element, (NSString *)file];
118
+ } else if (hasElement) {
119
+ [message appendFormat:@"(%@)", (NSString *)element];
120
+ } else if (hasFile) {
121
+ [message appendFormat:@"(%@)", (NSString *)file];
122
+ }
123
+
124
+ if (i > 0) {
125
+ [message appendString:@" > "];
126
+ }
127
+ }
128
+
129
+ return message;
130
+ }
131
+
132
+ - (id<SentryRRWebEvent> _Nullable)convertNavigation: (SentryBreadcrumb *_Nonnull)breadcrumb {
133
+ NSNumber* startTimestamp = [breadcrumb.data[@"start_timestamp"] isKindOfClass:[NSNumber class]]
134
+ ? breadcrumb.data[@"start_timestamp"] : nil;
135
+ NSNumber* endTimestamp = [breadcrumb.data[@"end_timestamp"] isKindOfClass:[NSNumber class]]
136
+ ? breadcrumb.data[@"end_timestamp"] : nil;
137
+ NSString* url = [breadcrumb.data[@"url"] isKindOfClass:[NSString class]]
138
+ ? breadcrumb.data[@"url"] : nil;
139
+
140
+ if (startTimestamp == nil || endTimestamp == nil || url == nil) {
141
+ return nil;
142
+ }
143
+
144
+ NSMutableDictionary* data = [[NSMutableDictionary alloc] init];
145
+ if ([breadcrumb.data[@"method"] isKindOfClass:[NSString class]]) {
146
+ data[@"method"] = breadcrumb.data[@"method"];
147
+ }
148
+ if ([breadcrumb.data[@"status_code"] isKindOfClass:[NSNumber class]]) {
149
+ data[@"statusCode"] = breadcrumb.data[@"status_code"];
150
+ }
151
+ if ([breadcrumb.data[@"request_body_size"] isKindOfClass:[NSNumber class]]) {
152
+ data[@"requestBodySize"] = breadcrumb.data[@"request_body_size"];
153
+ }
154
+ if ([breadcrumb.data[@"response_body_size"] isKindOfClass:[NSNumber class]]) {
155
+ data[@"responseBodySize"] = breadcrumb.data[@"response_body_size"];
156
+ }
157
+
158
+ return [SentrySessionReplayIntegration
159
+ createNetworkBreadcrumbWithTimestamp:[NSDate dateWithTimeIntervalSince1970:(startTimestamp.doubleValue / 1000)]
160
+ endTimestamp:[NSDate dateWithTimeIntervalSince1970:(endTimestamp.doubleValue / 1000)]
161
+ operation:@"resource.http"
162
+ description:url
163
+ data:data];
164
+ }
165
+
166
+ @end
167
+
168
+ #endif
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": "5.25.0",
5
+ "version": "5.26.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",
@@ -67,6 +67,7 @@
67
67
  "react-native": ">=0.65.0"
68
68
  },
69
69
  "dependencies": {
70
+ "@sentry/babel-plugin-component-annotate": "2.20.1",
70
71
  "@sentry/browser": "7.117.0",
71
72
  "@sentry/cli": "2.31.2",
72
73
  "@sentry/core": "7.117.0",
@@ -44,6 +44,8 @@ export interface Spec extends TurboModule {
44
44
  fetchNativePackageName(): string | undefined | null;
45
45
  fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | undefined | null;
46
46
  initNativeReactNavigationNewFrameTracking(): Promise<void>;
47
+ captureReplay(isHardCrash: boolean): Promise<string | undefined | null>;
48
+ getCurrentReplayId(): string | undefined | null;
47
49
  }
48
50
 
49
51
  export type NativeStackFrame = {
@@ -39,6 +39,8 @@ export interface Spec extends TurboModule {
39
39
  fetchNativePackageName(): string | undefined | null;
40
40
  fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | undefined | null;
41
41
  initNativeReactNavigationNewFrameTracking(): Promise<void>;
42
+ captureReplay(isHardCrash: boolean): Promise<string | undefined | null>;
43
+ getCurrentReplayId(): string | undefined | null;
42
44
  }
43
45
  export type NativeStackFrame = {
44
46
  platform: string;
@@ -35,6 +35,10 @@ export declare class ReactNativeClient extends BaseClient<ReactNativeClientOptio
35
35
  * Sends user feedback to Sentry.
36
36
  */
37
37
  captureUserFeedback(feedback: UserFeedback): void;
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ init(): void;
38
42
  /**
39
43
  * Sets up the integrations
40
44
  */
@@ -12,5 +12,6 @@ export { screenshotIntegration } from './screenshot';
12
12
  export { viewHierarchyIntegration } from './viewhierarchy';
13
13
  export { expoContextIntegration } from './expocontext';
14
14
  export { spotlightIntegration } from './spotlight';
15
- export { breadcrumbsIntegration, browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, } from '@sentry/react';
15
+ export { mobileReplayIntegration } from '../replay/mobilereplay';
16
+ export { breadcrumbsIntegration, browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, replayIntegration as browserReplayIntegration, } from '@sentry/react';
16
17
  //# sourceMappingURL=exports.d.ts.map
@@ -12,4 +12,5 @@ export { Screenshot } from './screenshot';
12
12
  export { ViewHierarchy } from './viewhierarchy';
13
13
  export { ExpoContext } from './expocontext';
14
14
  export { Spotlight } from './spotlight';
15
+ export { mobileReplayIntegration } from '../replay/mobilereplay';
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -159,6 +159,28 @@ export interface BaseReactNativeOptions {
159
159
  * from the function, no screenshot will be attached.
160
160
  */
161
161
  beforeScreenshot?: (event: Event, hint: EventHint) => boolean;
162
+ /**
163
+ * Options which are in beta, or otherwise not guaranteed to be stable.
164
+ */
165
+ _experiments?: {
166
+ [key: string]: unknown;
167
+ /**
168
+ * The sample rate for profiling
169
+ * 1.0 will profile all transactions and 0 will profile none.
170
+ */
171
+ profilesSampleRate?: number;
172
+ /**
173
+ * The sample rate for session-long replays.
174
+ * 1.0 will record all sessions and 0 will record none.
175
+ */
176
+ replaysSessionSampleRate?: number;
177
+ /**
178
+ * The sample rate for sessions that has had an error occur.
179
+ * This is independent of `sessionSampleRate`.
180
+ * 1.0 will record all sessions and 0 will record none.
181
+ */
182
+ replaysOnErrorSampleRate?: number;
183
+ };
162
184
  }
163
185
  export interface ReactNativeTransportOptions extends BrowserTransportOptions {
164
186
  /**
@@ -170,9 +192,9 @@ export interface ReactNativeTransportOptions extends BrowserTransportOptions {
170
192
  * Configuration options for the Sentry ReactNative SDK.
171
193
  * @see ReactNativeFrontend for more information.
172
194
  */
173
- export interface ReactNativeOptions extends Options<ReactNativeTransportOptions>, BaseReactNativeOptions {
195
+ export interface ReactNativeOptions extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>, BaseReactNativeOptions {
174
196
  }
175
- export interface ReactNativeClientOptions extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel'>, BaseReactNativeOptions {
197
+ export interface ReactNativeClientOptions extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>, BaseReactNativeOptions {
176
198
  }
177
199
  export interface ReactNativeWrapperOptions {
178
200
  /** Props for the root React profiler */
@@ -0,0 +1,47 @@
1
+ import type { IntegrationFnResult } from '@sentry/types';
2
+ export declare const MOBILE_REPLAY_INTEGRATION_NAME = "MobileReplay";
3
+ export interface MobileReplayOptions {
4
+ /**
5
+ * Mask all text in recordings
6
+ *
7
+ * @default true
8
+ */
9
+ maskAllText?: boolean;
10
+ /**
11
+ * Mask all text in recordings
12
+ *
13
+ * @default true
14
+ */
15
+ maskAllImages?: boolean;
16
+ /**
17
+ * Mask all vector graphics in recordings
18
+ * Supports `react-native-svg`
19
+ *
20
+ * @default true
21
+ */
22
+ maskAllVectors?: boolean;
23
+ }
24
+ type MobileReplayIntegration = IntegrationFnResult & {
25
+ options: Required<MobileReplayOptions>;
26
+ };
27
+ /**
28
+ * The Mobile Replay Integration, let's you adjust the default mobile replay options.
29
+ * To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.
30
+ *
31
+ * ```javascript
32
+ * Sentry.init({
33
+ * _experiments: {
34
+ * replaysOnErrorSampleRate: 1.0,
35
+ * replaysSessionSampleRate: 1.0,
36
+ * },
37
+ * integrations: [mobileReplayIntegration({
38
+ * // Adjust the default options
39
+ * })],
40
+ * });
41
+ * ```
42
+ *
43
+ * @experimental
44
+ */
45
+ export declare const mobileReplayIntegration: (initOptions?: MobileReplayOptions) => MobileReplayIntegration;
46
+ export {};
47
+ //# sourceMappingURL=mobilereplay.d.ts.map
@@ -0,0 +1,8 @@
1
+ /// <reference types="react-native" />
2
+ /// <reference types="react" />
3
+ /** Convert a Content-Length header to number/undefined. */
4
+ export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
5
+ export type RequestBody = null | Blob | FormData | URLSearchParams | string | ArrayBuffer | undefined;
6
+ /** Get the size of a body. */
7
+ export declare function getBodySize(body: RequestBody): number | undefined;
8
+ //# sourceMappingURL=networkUtils.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { Breadcrumb, BreadcrumbHint } from '@sentry/types';
2
+ /**
3
+ * Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.
4
+ */
5
+ export declare function enrichXhrBreadcrumbsForMobileReplay(breadcrumb: Breadcrumb, hint: BreadcrumbHint | undefined): void;
6
+ //# sourceMappingURL=xhrUtils.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { Client } from '@sentry/types';
2
+ /**
3
+ * Checks if the provided Sentry client has hooks implemented.
4
+ * @param client The Sentry client object to check.
5
+ * @returns True if the client has hooks, false otherwise.
6
+ */
7
+ export declare function hasHooks(client: Client): client is Client & {
8
+ on: Required<Client>['on'];
9
+ };
10
+ //# sourceMappingURL=clientutils.d.ts.map
@@ -16,6 +16,10 @@ export declare function getExpoGoVersion(): string | undefined;
16
16
  export declare function getExpoSdkVersion(): string | undefined;
17
17
  /** Checks if the current platform is not web */
18
18
  export declare function notWeb(): boolean;
19
+ /** Checks if the current platform is supported mobile platform (iOS or Android) */
20
+ export declare function isMobileOs(): boolean;
21
+ /** Checks if the current platform is not supported mobile platform (iOS or Android) */
22
+ export declare function notMobileOs(): boolean;
19
23
  /** Returns Hermes Version if hermes is present in the runtime */
20
24
  export declare function getHermesVersion(): string | undefined;
21
25
  /** Returns default environment based on __DEV__ */
@@ -22,7 +22,13 @@ export interface ReactNativeInternalGlobal extends InternalGlobal {
22
22
  };
23
23
  __BUNDLE_START_TIME__?: number;
24
24
  nativePerformanceNow?: () => number;
25
+ TextEncoder?: TextEncoder;
25
26
  }
27
+ type TextEncoder = {
28
+ new (): TextEncoder;
29
+ encode(input?: string): Uint8Array;
30
+ };
26
31
  /** Get's the global object for the current JavaScript runtime */
27
32
  export declare const RN_GLOBAL_OBJ: ReactNativeInternalGlobal;
33
+ export {};
28
34
  //# sourceMappingURL=worldwide.d.ts.map
@@ -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 = "5.25.0";
3
+ export declare const SDK_VERSION = "5.26.0";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -4,6 +4,7 @@ import type { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFrames
4
4
  import type { ReactNativeClientOptions } from './options';
5
5
  import type * as Hermes from './profiling/hermes';
6
6
  import type { NativeAndroidProfileEvent, NativeProfileEvent } from './profiling/nativeTypes';
7
+ import type { MobileReplayOptions } from './replay/mobilereplay';
7
8
  /**
8
9
  * Returns the RNSentry module. Dynamically resolves if NativeModule or TurboModule is used.
9
10
  */
@@ -13,6 +14,9 @@ export interface Screenshot {
13
14
  contentType: string;
14
15
  filename: string;
15
16
  }
17
+ export type NativeSdkOptions = Partial<ReactNativeClientOptions> & {
18
+ mobileReplayOptions: MobileReplayOptions | undefined;
19
+ };
16
20
  interface SentryNativeWrapper {
17
21
  enableNative: boolean;
18
22
  nativeIsReady: boolean;
@@ -29,7 +33,7 @@ interface SentryNativeWrapper {
29
33
  };
30
34
  _isModuleLoaded(module: Spec | undefined): module is Spec;
31
35
  isNativeAvailable(): boolean;
32
- initNativeSdk(options: Partial<ReactNativeClientOptions>): PromiseLike<boolean>;
36
+ initNativeSdk(options: NativeSdkOptions): PromiseLike<boolean>;
33
37
  closeNativeSdk(): PromiseLike<void>;
34
38
  sendEnvelope(envelope: Envelope): Promise<void>;
35
39
  captureScreenshot(): Promise<Screenshot[] | null>;
@@ -63,6 +67,8 @@ interface SentryNativeWrapper {
63
67
  */
64
68
  fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null;
65
69
  initNativeReactNavigationNewFrameTracking(): Promise<void>;
70
+ captureReplay(isHardCrash: boolean): Promise<string | null>;
71
+ getCurrentReplayId(): string | null;
66
72
  }
67
73
  /**
68
74
  * Our internal interface for calling native functions