@sentry/react-native 6.4.0 → 6.5.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 (301) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +31 -22
  4. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +8 -0
  5. package/dist/js/NativeRNSentry.d.ts +1 -1
  6. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  7. package/dist/js/NativeRNSentry.js.map +1 -1
  8. package/dist/js/breadcrumb.d.ts +1 -1
  9. package/dist/js/breadcrumb.d.ts.map +1 -1
  10. package/dist/js/breadcrumb.js +1 -1
  11. package/dist/js/breadcrumb.js.map +1 -1
  12. package/dist/js/client.d.ts +2 -1
  13. package/dist/js/client.d.ts.map +1 -1
  14. package/dist/js/client.js +2 -2
  15. package/dist/js/client.js.map +1 -1
  16. package/dist/js/index.d.ts +2 -2
  17. package/dist/js/index.d.ts.map +1 -1
  18. package/dist/js/index.js +1 -1
  19. package/dist/js/index.js.map +1 -1
  20. package/dist/js/integrations/debugsymbolicator.d.ts +1 -1
  21. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  22. package/dist/js/integrations/debugsymbolicator.js +1 -1
  23. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  24. package/dist/js/integrations/debugsymbolicatorutils.d.ts +1 -1
  25. package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -1
  26. package/dist/js/integrations/debugsymbolicatorutils.js +1 -1
  27. package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
  28. package/dist/js/integrations/default.d.ts +1 -1
  29. package/dist/js/integrations/default.d.ts.map +1 -1
  30. package/dist/js/integrations/default.js +13 -12
  31. package/dist/js/integrations/default.js.map +1 -1
  32. package/dist/js/integrations/devicecontext.d.ts +1 -1
  33. package/dist/js/integrations/devicecontext.d.ts.map +1 -1
  34. package/dist/js/integrations/devicecontext.js +1 -1
  35. package/dist/js/integrations/devicecontext.js.map +1 -1
  36. package/dist/js/integrations/eventorigin.d.ts +1 -1
  37. package/dist/js/integrations/eventorigin.d.ts.map +1 -1
  38. package/dist/js/integrations/eventorigin.js.map +1 -1
  39. package/dist/js/integrations/expocontext.d.ts +1 -1
  40. package/dist/js/integrations/expocontext.d.ts.map +1 -1
  41. package/dist/js/integrations/expocontext.js.map +1 -1
  42. package/dist/js/integrations/factory.d.ts +1 -1
  43. package/dist/js/integrations/factory.d.ts.map +1 -1
  44. package/dist/js/integrations/factory.js.map +1 -1
  45. package/dist/js/integrations/modulesloader.d.ts +1 -1
  46. package/dist/js/integrations/modulesloader.d.ts.map +1 -1
  47. package/dist/js/integrations/modulesloader.js +1 -1
  48. package/dist/js/integrations/modulesloader.js.map +1 -1
  49. package/dist/js/integrations/nativelinkederrors.d.ts +1 -1
  50. package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
  51. package/dist/js/integrations/nativelinkederrors.js +1 -1
  52. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  53. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +1 -1
  54. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  55. package/dist/js/integrations/reactnativeerrorhandlers.js +1 -2
  56. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  57. package/dist/js/integrations/reactnativeerrorhandlersutils.js +1 -1
  58. package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
  59. package/dist/js/integrations/reactnativeinfo.d.ts +1 -1
  60. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
  61. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  62. package/dist/js/integrations/release.d.ts +1 -1
  63. package/dist/js/integrations/release.d.ts.map +1 -1
  64. package/dist/js/integrations/release.js.map +1 -1
  65. package/dist/js/integrations/rewriteframes.d.ts +1 -1
  66. package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
  67. package/dist/js/integrations/rewriteframes.js.map +1 -1
  68. package/dist/js/integrations/screenshot.d.ts +1 -1
  69. package/dist/js/integrations/screenshot.d.ts.map +1 -1
  70. package/dist/js/integrations/screenshot.js.map +1 -1
  71. package/dist/js/integrations/sdkinfo.d.ts +1 -1
  72. package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
  73. package/dist/js/integrations/sdkinfo.js +1 -1
  74. package/dist/js/integrations/sdkinfo.js.map +1 -1
  75. package/dist/js/integrations/spotlight.d.ts +1 -1
  76. package/dist/js/integrations/spotlight.d.ts.map +1 -1
  77. package/dist/js/integrations/spotlight.js +1 -1
  78. package/dist/js/integrations/spotlight.js.map +1 -1
  79. package/dist/js/integrations/viewhierarchy.d.ts +1 -1
  80. package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
  81. package/dist/js/integrations/viewhierarchy.js +1 -1
  82. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  83. package/dist/js/misc.d.ts +1 -1
  84. package/dist/js/misc.d.ts.map +1 -1
  85. package/dist/js/misc.js.map +1 -1
  86. package/dist/js/options.d.ts +18 -6
  87. package/dist/js/options.d.ts.map +1 -1
  88. package/dist/js/options.js.map +1 -1
  89. package/dist/js/profiling/cache.d.ts.map +1 -1
  90. package/dist/js/profiling/cache.js +53 -1
  91. package/dist/js/profiling/cache.js.map +1 -1
  92. package/dist/js/profiling/convertHermesProfile.d.ts +1 -1
  93. package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
  94. package/dist/js/profiling/convertHermesProfile.js +1 -1
  95. package/dist/js/profiling/convertHermesProfile.js.map +1 -1
  96. package/dist/js/profiling/debugid.d.ts +1 -1
  97. package/dist/js/profiling/debugid.d.ts.map +1 -1
  98. package/dist/js/profiling/debugid.js +1 -1
  99. package/dist/js/profiling/debugid.js.map +1 -1
  100. package/dist/js/profiling/integration.d.ts +1 -1
  101. package/dist/js/profiling/integration.d.ts.map +1 -1
  102. package/dist/js/profiling/integration.js +1 -3
  103. package/dist/js/profiling/integration.js.map +1 -1
  104. package/dist/js/profiling/types.d.ts +1 -1
  105. package/dist/js/profiling/types.d.ts.map +1 -1
  106. package/dist/js/profiling/types.js.map +1 -1
  107. package/dist/js/profiling/utils.d.ts +1 -1
  108. package/dist/js/profiling/utils.d.ts.map +1 -1
  109. package/dist/js/profiling/utils.js +1 -1
  110. package/dist/js/profiling/utils.js.map +1 -1
  111. package/dist/js/replay/CustomMask.js +1 -1
  112. package/dist/js/replay/CustomMask.js.map +1 -1
  113. package/dist/js/replay/mobilereplay.d.ts +3 -5
  114. package/dist/js/replay/mobilereplay.d.ts.map +1 -1
  115. package/dist/js/replay/mobilereplay.js +3 -5
  116. package/dist/js/replay/mobilereplay.js.map +1 -1
  117. package/dist/js/replay/networkUtils.d.ts +1 -0
  118. package/dist/js/replay/networkUtils.d.ts.map +1 -1
  119. package/dist/js/replay/xhrUtils.d.ts +1 -1
  120. package/dist/js/replay/xhrUtils.d.ts.map +1 -1
  121. package/dist/js/replay/xhrUtils.js +1 -1
  122. package/dist/js/replay/xhrUtils.js.map +1 -1
  123. package/dist/js/scopeSync.d.ts +1 -1
  124. package/dist/js/scopeSync.d.ts.map +1 -1
  125. package/dist/js/scopeSync.js.map +1 -1
  126. package/dist/js/sdk.d.ts +2 -1
  127. package/dist/js/sdk.d.ts.map +1 -1
  128. package/dist/js/sdk.js +9 -5
  129. package/dist/js/sdk.js.map +1 -1
  130. package/dist/js/tools/ModulesCollector.js +13 -13
  131. package/dist/js/tools/ModulesCollector.js.map +1 -1
  132. package/dist/js/tools/enableLogger.js +2 -2
  133. package/dist/js/tools/enableLogger.js.map +1 -1
  134. package/dist/js/tools/metroMiddleware.js +8 -8
  135. package/dist/js/tools/metroMiddleware.js.map +1 -1
  136. package/dist/js/tools/metroconfig.js +4 -4
  137. package/dist/js/tools/metroconfig.js.map +1 -1
  138. package/dist/js/tools/sentryBabelTransformerUtils.js +3 -3
  139. package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
  140. package/dist/js/touchevents.d.ts.map +1 -1
  141. package/dist/js/touchevents.js +1 -2
  142. package/dist/js/touchevents.js.map +1 -1
  143. package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
  144. package/dist/js/tracing/gesturetracing.js +1 -2
  145. package/dist/js/tracing/gesturetracing.js.map +1 -1
  146. package/dist/js/tracing/integrations/appStart.d.ts +1 -1
  147. package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
  148. package/dist/js/tracing/integrations/appStart.js +1 -3
  149. package/dist/js/tracing/integrations/appStart.js.map +1 -1
  150. package/dist/js/tracing/integrations/nativeFrames.d.ts +1 -1
  151. package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -1
  152. package/dist/js/tracing/integrations/nativeFrames.js +1 -1
  153. package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
  154. package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  155. package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
  156. package/dist/js/tracing/integrations/stalltracking.js +1 -3
  157. package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
  158. package/dist/js/tracing/integrations/userInteraction.d.ts +1 -1
  159. package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -1
  160. package/dist/js/tracing/integrations/userInteraction.js +1 -2
  161. package/dist/js/tracing/integrations/userInteraction.js.map +1 -1
  162. package/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
  163. package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
  164. package/dist/js/tracing/onSpanEndUtils.js +1 -2
  165. package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
  166. package/dist/js/tracing/reactnativenavigation.d.ts +1 -1
  167. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  168. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  169. package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
  170. package/dist/js/tracing/reactnativeprofiler.js +1 -1
  171. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  172. package/dist/js/tracing/reactnativetracing.d.ts +1 -1
  173. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  174. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  175. package/dist/js/tracing/reactnavigation.d.ts +1 -1
  176. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  177. package/dist/js/tracing/reactnavigation.js +1 -3
  178. package/dist/js/tracing/reactnavigation.js.map +1 -1
  179. package/dist/js/tracing/span.d.ts +3 -4
  180. package/dist/js/tracing/span.d.ts.map +1 -1
  181. package/dist/js/tracing/span.js +3 -3
  182. package/dist/js/tracing/span.js.map +1 -1
  183. package/dist/js/tracing/timetodisplay.d.ts +1 -1
  184. package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
  185. package/dist/js/tracing/timetodisplay.js +1 -2
  186. package/dist/js/tracing/timetodisplay.js.map +1 -1
  187. package/dist/js/tracing/timetodisplaynative.types.d.ts +1 -0
  188. package/dist/js/tracing/timetodisplaynative.types.d.ts.map +1 -1
  189. package/dist/js/tracing/types.d.ts +1 -1
  190. package/dist/js/tracing/types.d.ts.map +1 -1
  191. package/dist/js/tracing/types.js.map +1 -1
  192. package/dist/js/tracing/utils.d.ts +1 -1
  193. package/dist/js/tracing/utils.d.ts.map +1 -1
  194. package/dist/js/tracing/utils.js +1 -2
  195. package/dist/js/tracing/utils.js.map +1 -1
  196. package/dist/js/transports/native.d.ts +1 -2
  197. package/dist/js/transports/native.d.ts.map +1 -1
  198. package/dist/js/transports/native.js +1 -1
  199. package/dist/js/transports/native.js.map +1 -1
  200. package/dist/js/user.d.ts +1 -1
  201. package/dist/js/user.d.ts.map +1 -1
  202. package/dist/js/user.js.map +1 -1
  203. package/dist/js/utils/clientutils.d.ts +1 -1
  204. package/dist/js/utils/clientutils.d.ts.map +1 -1
  205. package/dist/js/utils/clientutils.js.map +1 -1
  206. package/dist/js/utils/envelope.d.ts +1 -1
  207. package/dist/js/utils/envelope.d.ts.map +1 -1
  208. package/dist/js/utils/envelope.js +1 -1
  209. package/dist/js/utils/envelope.js.map +1 -1
  210. package/dist/js/utils/fill.d.ts +1 -1
  211. package/dist/js/utils/fill.js +2 -2
  212. package/dist/js/utils/fill.js.map +1 -1
  213. package/dist/js/utils/normalize.js +1 -1
  214. package/dist/js/utils/normalize.js.map +1 -1
  215. package/dist/js/utils/outcome.d.ts +1 -1
  216. package/dist/js/utils/outcome.d.ts.map +1 -1
  217. package/dist/js/utils/outcome.js.map +1 -1
  218. package/dist/js/utils/safe.js +1 -1
  219. package/dist/js/utils/safe.js.map +1 -1
  220. package/dist/js/utils/sentryeventemitter.js +1 -1
  221. package/dist/js/utils/sentryeventemitter.js.map +1 -1
  222. package/dist/js/utils/sentryeventemitterfallback.js +1 -1
  223. package/dist/js/utils/sentryeventemitterfallback.js.map +1 -1
  224. package/dist/js/utils/span.d.ts +1 -1
  225. package/dist/js/utils/span.d.ts.map +1 -1
  226. package/dist/js/utils/span.js.map +1 -1
  227. package/dist/js/utils/worldwide.d.ts +1 -1
  228. package/dist/js/utils/worldwide.d.ts.map +1 -1
  229. package/dist/js/utils/worldwide.js +1 -1
  230. package/dist/js/utils/worldwide.js.map +1 -1
  231. package/dist/js/vendor/react-native/index.d.ts +1 -0
  232. package/dist/js/vendor/react-native/index.d.ts.map +1 -1
  233. package/dist/js/version.d.ts +1 -1
  234. package/dist/js/version.js +1 -1
  235. package/dist/js/version.js.map +1 -1
  236. package/dist/js/wrapper.d.ts +1 -1
  237. package/dist/js/wrapper.d.ts.map +1 -1
  238. package/dist/js/wrapper.js +1 -1
  239. package/dist/js/wrapper.js.map +1 -1
  240. package/ios/RNSentry.mm +1 -1
  241. package/ios/RNSentryReplay.mm +8 -17
  242. package/package.json +17 -17
  243. package/scripts/expo-upload-sourcemaps.js +6 -2
  244. package/src/js/NativeRNSentry.ts +1 -1
  245. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -1
  246. package/ts3.8/dist/js/breadcrumb.d.ts +1 -1
  247. package/ts3.8/dist/js/client.d.ts +2 -1
  248. package/ts3.8/dist/js/index.d.ts +2 -2
  249. package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +1 -1
  250. package/ts3.8/dist/js/integrations/debugsymbolicatorutils.d.ts +1 -1
  251. package/ts3.8/dist/js/integrations/default.d.ts +1 -1
  252. package/ts3.8/dist/js/integrations/devicecontext.d.ts +1 -1
  253. package/ts3.8/dist/js/integrations/eventorigin.d.ts +1 -1
  254. package/ts3.8/dist/js/integrations/expocontext.d.ts +1 -1
  255. package/ts3.8/dist/js/integrations/factory.d.ts +1 -1
  256. package/ts3.8/dist/js/integrations/modulesloader.d.ts +1 -1
  257. package/ts3.8/dist/js/integrations/nativelinkederrors.d.ts +1 -1
  258. package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +1 -1
  259. package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +1 -1
  260. package/ts3.8/dist/js/integrations/release.d.ts +1 -1
  261. package/ts3.8/dist/js/integrations/rewriteframes.d.ts +1 -1
  262. package/ts3.8/dist/js/integrations/screenshot.d.ts +1 -1
  263. package/ts3.8/dist/js/integrations/sdkinfo.d.ts +1 -1
  264. package/ts3.8/dist/js/integrations/spotlight.d.ts +1 -1
  265. package/ts3.8/dist/js/integrations/viewhierarchy.d.ts +1 -1
  266. package/ts3.8/dist/js/misc.d.ts +1 -1
  267. package/ts3.8/dist/js/options.d.ts +18 -6
  268. package/ts3.8/dist/js/profiling/convertHermesProfile.d.ts +1 -1
  269. package/ts3.8/dist/js/profiling/debugid.d.ts +1 -1
  270. package/ts3.8/dist/js/profiling/integration.d.ts +1 -1
  271. package/ts3.8/dist/js/profiling/types.d.ts +1 -1
  272. package/ts3.8/dist/js/profiling/utils.d.ts +1 -1
  273. package/ts3.8/dist/js/replay/mobilereplay.d.ts +3 -5
  274. package/ts3.8/dist/js/replay/networkUtils.d.ts +1 -0
  275. package/ts3.8/dist/js/replay/xhrUtils.d.ts +1 -1
  276. package/ts3.8/dist/js/scopeSync.d.ts +1 -1
  277. package/ts3.8/dist/js/sdk.d.ts +2 -1
  278. package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +1 -1
  279. package/ts3.8/dist/js/tracing/integrations/nativeFrames.d.ts +1 -1
  280. package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  281. package/ts3.8/dist/js/tracing/integrations/userInteraction.d.ts +1 -1
  282. package/ts3.8/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
  283. package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +1 -1
  284. package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +1 -1
  285. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +1 -1
  286. package/ts3.8/dist/js/tracing/span.d.ts +3 -4
  287. package/ts3.8/dist/js/tracing/timetodisplay.d.ts +1 -1
  288. package/ts3.8/dist/js/tracing/timetodisplaynative.types.d.ts +1 -0
  289. package/ts3.8/dist/js/tracing/types.d.ts +1 -1
  290. package/ts3.8/dist/js/tracing/utils.d.ts +1 -1
  291. package/ts3.8/dist/js/transports/native.d.ts +1 -2
  292. package/ts3.8/dist/js/user.d.ts +1 -1
  293. package/ts3.8/dist/js/utils/clientutils.d.ts +1 -1
  294. package/ts3.8/dist/js/utils/envelope.d.ts +1 -1
  295. package/ts3.8/dist/js/utils/fill.d.ts +1 -1
  296. package/ts3.8/dist/js/utils/outcome.d.ts +1 -1
  297. package/ts3.8/dist/js/utils/span.d.ts +1 -1
  298. package/ts3.8/dist/js/utils/worldwide.d.ts +1 -1
  299. package/ts3.8/dist/js/vendor/react-native/index.d.ts +1 -0
  300. package/ts3.8/dist/js/version.d.ts +1 -1
  301. package/ts3.8/dist/js/wrapper.d.ts +1 -1
package/RNSentry.podspec CHANGED
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
 
38
38
  s.compiler_flags = other_cflags
39
39
 
40
- s.dependency 'Sentry/HybridSDK', '8.41.0'
40
+ s.dependency 'Sentry/HybridSDK', '8.43.0'
41
41
 
42
42
  if defined? install_modules_dependencies
43
43
  # Default React Native dependencies for 0.71 and above (new and legacy architecture)
@@ -54,5 +54,5 @@ android {
54
54
 
55
55
  dependencies {
56
56
  implementation 'com.facebook.react:react-native:+'
57
- api 'io.sentry:sentry-android:7.18.0'
57
+ api 'io.sentry:sentry-android:7.20.0'
58
58
  }
@@ -93,8 +93,6 @@ public class RNSentryModuleImpl {
93
93
 
94
94
  public static final String NAME = "RNSentry";
95
95
 
96
- private static final String NATIVE_SDK_NAME = "sentry.native.android.react-native";
97
- private static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
98
96
  private static final ILogger logger = new AndroidLogger(NAME);
99
97
  private static final BuildInfoProvider buildInfo = new BuildInfoProvider(logger);
100
98
  private static final String modulesPath = "modules.json";
@@ -191,13 +189,16 @@ public class RNSentryModuleImpl {
191
189
  @NotNull SentryAndroidOptions options, @NotNull ReadableMap rnOptions, ILogger logger) {
192
190
  @Nullable SdkVersion sdkVersion = options.getSdkVersion();
193
191
  if (sdkVersion == null) {
194
- sdkVersion = new SdkVersion(ANDROID_SDK_NAME, BuildConfig.VERSION_NAME);
192
+ sdkVersion = new SdkVersion(RNSentryVersion.ANDROID_SDK_NAME, BuildConfig.VERSION_NAME);
195
193
  } else {
196
- sdkVersion.setName(ANDROID_SDK_NAME);
194
+ sdkVersion.setName(RNSentryVersion.ANDROID_SDK_NAME);
197
195
  }
196
+ sdkVersion.addPackage(
197
+ RNSentryVersion.REACT_NATIVE_SDK_PACKAGE_NAME,
198
+ RNSentryVersion.REACT_NATIVE_SDK_PACKAGE_VERSION);
198
199
 
199
200
  options.setSentryClientName(sdkVersion.getName() + "/" + sdkVersion.getVersion());
200
- options.setNativeSdkName(NATIVE_SDK_NAME);
201
+ options.setNativeSdkName(RNSentryVersion.NATIVE_SDK_NAME);
201
202
  options.setSdkVersion(sdkVersion);
202
203
 
203
204
  if (rnOptions.hasKey("debug") && rnOptions.getBoolean("debug")) {
@@ -276,8 +277,10 @@ public class RNSentryModuleImpl {
276
277
  options.setSpotlightConnectionUrl(rnOptions.getString("spotlight"));
277
278
  }
278
279
  }
279
- if (rnOptions.hasKey("_experiments")) {
280
- options.getExperimental().setSessionReplay(getReplayOptions(rnOptions));
280
+
281
+ SentryReplayOptions replayOptions = getReplayOptions(rnOptions);
282
+ options.setSessionReplay(replayOptions);
283
+ if (isReplayEnabled(replayOptions)) {
281
284
  options.getReplayController().setBreadcrumbConverter(new RNSentryReplayBreadcrumbConverter());
282
285
  }
283
286
 
@@ -329,26 +332,32 @@ public class RNSentryModuleImpl {
329
332
  }
330
333
  }
331
334
 
332
- private SentryReplayOptions getReplayOptions(@NotNull ReadableMap rnOptions) {
333
- @NotNull final SentryReplayOptions androidReplayOptions = new SentryReplayOptions(false);
334
-
335
- @Nullable final ReadableMap rnExperimentsOptions = rnOptions.getMap("_experiments");
336
- if (rnExperimentsOptions == null) {
337
- return androidReplayOptions;
338
- }
335
+ private boolean isReplayEnabled(SentryReplayOptions replayOptions) {
336
+ return replayOptions.getSessionSampleRate() != null
337
+ || replayOptions.getOnErrorSampleRate() != null;
338
+ }
339
339
 
340
- if (!(rnExperimentsOptions.hasKey("replaysSessionSampleRate")
341
- || rnExperimentsOptions.hasKey("replaysOnErrorSampleRate"))) {
340
+ private SentryReplayOptions getReplayOptions(@NotNull ReadableMap rnOptions) {
341
+ final SdkVersion replaySdkVersion =
342
+ new SdkVersion(
343
+ RNSentryVersion.REACT_NATIVE_SDK_PACKAGE_NAME,
344
+ RNSentryVersion.REACT_NATIVE_SDK_PACKAGE_VERSION);
345
+ @NotNull
346
+ final SentryReplayOptions androidReplayOptions =
347
+ new SentryReplayOptions(false, replaySdkVersion);
348
+
349
+ if (!(rnOptions.hasKey("replaysSessionSampleRate")
350
+ || rnOptions.hasKey("replaysOnErrorSampleRate"))) {
342
351
  return androidReplayOptions;
343
352
  }
344
353
 
345
354
  androidReplayOptions.setSessionSampleRate(
346
- rnExperimentsOptions.hasKey("replaysSessionSampleRate")
347
- ? rnExperimentsOptions.getDouble("replaysSessionSampleRate")
355
+ rnOptions.hasKey("replaysSessionSampleRate")
356
+ ? rnOptions.getDouble("replaysSessionSampleRate")
348
357
  : null);
349
358
  androidReplayOptions.setOnErrorSampleRate(
350
- rnExperimentsOptions.hasKey("replaysOnErrorSampleRate")
351
- ? rnExperimentsOptions.getDouble("replaysOnErrorSampleRate")
359
+ rnOptions.hasKey("replaysOnErrorSampleRate")
360
+ ? rnOptions.getDouble("replaysOnErrorSampleRate")
352
361
  : null);
353
362
 
354
363
  if (!rnOptions.hasKey("mobileReplayOptions")) {
@@ -970,10 +979,10 @@ public class RNSentryModuleImpl {
970
979
  SdkVersion sdk = event.getSdk();
971
980
  if (sdk != null) {
972
981
  switch (sdk.getName()) {
973
- case NATIVE_SDK_NAME:
982
+ case RNSentryVersion.NATIVE_SDK_NAME:
974
983
  setEventEnvironmentTag(event, "native");
975
984
  break;
976
- case ANDROID_SDK_NAME:
985
+ case RNSentryVersion.ANDROID_SDK_NAME:
977
986
  setEventEnvironmentTag(event, "java");
978
987
  break;
979
988
  default:
@@ -0,0 +1,8 @@
1
+ package io.sentry.react;
2
+
3
+ class RNSentryVersion {
4
+ static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native";
5
+ static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "6.5.0";
6
+ static final String NATIVE_SDK_NAME = "sentry.native.android.react-native";
7
+ static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
8
+ }
@@ -1,4 +1,4 @@
1
- import type { Package } from '@sentry/types';
1
+ import type { Package } from '@sentry/core';
2
2
  import type { TurboModule } from 'react-native';
3
3
  import type { UnsafeObject } from './utils/rnlibrariesinterface';
4
4
  export interface Spec extends TurboModule {
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRNSentry.d.ts","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OA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,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;AA0JnD,2DAA2D;AAC3D,eAAe,mBAAmB,CAAC,YAAY,CAAO,UAAU,CAAC,CAAC","sourcesContent":["import type { Package } from '@sentry/types';\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\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 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}\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 segment?: 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;AA0JnD,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';\n\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 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}\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 segment?: 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,4 +1,4 @@
1
- import type { Breadcrumb, SeverityLevel } from '@sentry/types';
1
+ import type { Breadcrumb, SeverityLevel } from '@sentry/core';
2
2
  export declare const DEFAULT_BREADCRUMB_LEVEL: SeverityLevel;
3
3
  type BreadcrumbCandidate = {
4
4
  [K in keyof Partial<Breadcrumb>]: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/js/breadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG/D,eAAO,MAAM,wBAAwB,EAAE,aAAsB,CAAC;AAE9D,KAAK,mBAAmB,GAAG;KACxB,CAAC,IAAI,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO;CAC1C,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,mBAAmB,GAAG,UAAU,CA6B/E"}
1
+ {"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/js/breadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG9D,eAAO,MAAM,wBAAwB,EAAE,aAAsB,CAAC;AAE9D,KAAK,mBAAmB,GAAG;KACxB,CAAC,IAAI,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO;CAC1C,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,mBAAmB,GAAG,UAAU,CA6B/E"}
@@ -1,4 +1,4 @@
1
- import { severityLevelFromString } from '@sentry/utils';
1
+ import { severityLevelFromString } from '@sentry/core';
2
2
  export const DEFAULT_BREADCRUMB_LEVEL = 'info';
3
3
  /**
4
4
  * Convert plain object to a valid Breadcrumb
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.js","sourceRoot":"","sources":["../../src/js/breadcrumb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,CAAC,MAAM,wBAAwB,GAAkB,MAAM,CAAC;AAM9D;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAA8B;IACjE,MAAM,UAAU,GAAe,EAAE,CAAC;IAElC,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,EAAE;QACtC,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;KAClC;IACD,IAAI,OAAO,SAAS,CAAC,KAAK,KAAK,QAAQ,EAAE;QACvC,UAAU,CAAC,KAAK,GAAG,uBAAuB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KAC7D;IACD,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,EAAE;QAC1C,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;KAC1C;IACD,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,EAAE;QAC1C,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;KAC1C;IACD,IAAI,OAAO,SAAS,CAAC,OAAO,KAAK,QAAQ,EAAE;QACzC,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;KACxC;IACD,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,EAAE;QACjE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;KAClC;IACD,IAAI,OAAO,SAAS,CAAC,SAAS,KAAK,QAAQ,EAAE;QAC3C,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,qCAAqC;QACtG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE;YAC5B,UAAU,CAAC,SAAS,GAAG,gBAAgB,CAAC;SACzC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { Breadcrumb, SeverityLevel } from '@sentry/types';\nimport { severityLevelFromString } from '@sentry/utils';\n\nexport const DEFAULT_BREADCRUMB_LEVEL: SeverityLevel = 'info';\n\ntype BreadcrumbCandidate = {\n [K in keyof Partial<Breadcrumb>]: unknown;\n};\n\n/**\n * Convert plain object to a valid Breadcrumb\n */\nexport function breadcrumbFromObject(candidate: BreadcrumbCandidate): Breadcrumb {\n const breadcrumb: Breadcrumb = {};\n\n if (typeof candidate.type === 'string') {\n breadcrumb.type = candidate.type;\n }\n if (typeof candidate.level === 'string') {\n breadcrumb.level = severityLevelFromString(candidate.level);\n }\n if (typeof candidate.event_id === 'string') {\n breadcrumb.event_id = candidate.event_id;\n }\n if (typeof candidate.category === 'string') {\n breadcrumb.category = candidate.category;\n }\n if (typeof candidate.message === 'string') {\n breadcrumb.message = candidate.message;\n }\n if (typeof candidate.data === 'object' && candidate.data !== null) {\n breadcrumb.data = candidate.data;\n }\n if (typeof candidate.timestamp === 'string') {\n const timestampSeconds = Date.parse(candidate.timestamp) / 1000; // breadcrumb timestamp is in seconds\n if (!isNaN(timestampSeconds)) {\n breadcrumb.timestamp = timestampSeconds;\n }\n }\n\n return breadcrumb;\n}\n"]}
1
+ {"version":3,"file":"breadcrumb.js","sourceRoot":"","sources":["../../src/js/breadcrumb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,CAAC,MAAM,wBAAwB,GAAkB,MAAM,CAAC;AAM9D;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAA8B;IACjE,MAAM,UAAU,GAAe,EAAE,CAAC;IAElC,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,EAAE;QACtC,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;KAClC;IACD,IAAI,OAAO,SAAS,CAAC,KAAK,KAAK,QAAQ,EAAE;QACvC,UAAU,CAAC,KAAK,GAAG,uBAAuB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KAC7D;IACD,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,EAAE;QAC1C,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;KAC1C;IACD,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,EAAE;QAC1C,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;KAC1C;IACD,IAAI,OAAO,SAAS,CAAC,OAAO,KAAK,QAAQ,EAAE;QACzC,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;KACxC;IACD,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,EAAE;QACjE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;KAClC;IACD,IAAI,OAAO,SAAS,CAAC,SAAS,KAAK,QAAQ,EAAE;QAC3C,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,qCAAqC;QACtG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE;YAC5B,UAAU,CAAC,SAAS,GAAG,gBAAgB,CAAC;SACzC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { Breadcrumb, SeverityLevel } from '@sentry/core';\nimport { severityLevelFromString } from '@sentry/core';\n\nexport const DEFAULT_BREADCRUMB_LEVEL: SeverityLevel = 'info';\n\ntype BreadcrumbCandidate = {\n [K in keyof Partial<Breadcrumb>]: unknown;\n};\n\n/**\n * Convert plain object to a valid Breadcrumb\n */\nexport function breadcrumbFromObject(candidate: BreadcrumbCandidate): Breadcrumb {\n const breadcrumb: Breadcrumb = {};\n\n if (typeof candidate.type === 'string') {\n breadcrumb.type = candidate.type;\n }\n if (typeof candidate.level === 'string') {\n breadcrumb.level = severityLevelFromString(candidate.level);\n }\n if (typeof candidate.event_id === 'string') {\n breadcrumb.event_id = candidate.event_id;\n }\n if (typeof candidate.category === 'string') {\n breadcrumb.category = candidate.category;\n }\n if (typeof candidate.message === 'string') {\n breadcrumb.message = candidate.message;\n }\n if (typeof candidate.data === 'object' && candidate.data !== null) {\n breadcrumb.data = candidate.data;\n }\n if (typeof candidate.timestamp === 'string') {\n const timestampSeconds = Date.parse(candidate.timestamp) / 1000; // breadcrumb timestamp is in seconds\n if (!isNaN(timestampSeconds)) {\n breadcrumb.timestamp = timestampSeconds;\n }\n }\n\n return breadcrumb;\n}\n"]}
@@ -1,5 +1,5 @@
1
+ import type { Envelope, Event, EventHint, SeverityLevel, TransportMakeRequestResponse, UserFeedback } from '@sentry/core';
1
2
  import { BaseClient } from '@sentry/core';
2
- import type { Envelope, Event, EventHint, SeverityLevel, TransportMakeRequestResponse, UserFeedback } from '@sentry/types';
3
3
  import type { ReactNativeClientOptions } from './options';
4
4
  /**
5
5
  * The Sentry React Native SDK Client.
@@ -33,6 +33,7 @@ export declare class ReactNativeClient extends BaseClient<ReactNativeClientOptio
33
33
  close(): PromiseLike<boolean>;
34
34
  /**
35
35
  * Sends user feedback to Sentry.
36
+ * @deprecated Use `Sentry.captureFeedback` instead.
36
37
  */
37
38
  captureUserFeedback(feedback: UserFeedback): void;
38
39
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAGV,QAAQ,EACR,KAAK,EACL,SAAS,EAET,aAAa,EACb,4BAA4B,EAC5B,YAAY,EACb,MAAM,eAAe,CAAC;AAOvB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAS1D;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IACzE,OAAO,CAAC,eAAe,CAAY;IAEnC;;;OAGG;gBACgB,OAAO,EAAE,wBAAwB;IAYpD;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,GAAE,SAAc,GAAG,WAAW,CAAC,KAAK,CAAC;IAIvF;;OAEG;IACI,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAA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AAQ,EAAE,YAAY,GAAG,IAAI;IAUxD;;OAEG;IACI,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC,4BAA4B,CAAC;IAiClF;;OAEG;IACI,IAAI,IAAI,IAAI;IAKnB;;OAEG;IACH,OAAO,CAAC,cAAc;IA4BtB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAa9B"}
package/dist/js/client.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { eventFromException, eventFromMessage } from '@sentry/browser';
2
- import { BaseClient } from '@sentry/core';
3
- import { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';
2
+ import { BaseClient, dateTimestampInSeconds, logger, SentryError } from '@sentry/core';
4
3
  import { Alert } from 'react-native';
5
4
  import { getDevServer } from './integrations/debugsymbolicatorutils';
6
5
  import { defaultSdkInfo } from './integrations/sdkinfo';
@@ -63,6 +62,7 @@ export class ReactNativeClient extends BaseClient {
63
62
  }
64
63
  /**
65
64
  * Sends user feedback to Sentry.
65
+ * @deprecated Use `Sentry.captureFeedback` instead.
66
66
  */
67
67
  captureUserFeedback(feedback) {
68
68
  const envelope = createUserFeedbackEnvelope(feedback, {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAY1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC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;QACf,CAAC,CACF;aACA,IAAI,CAAC,CAAC,iBAA0B,EAAE,EAAE;;YACnC,MAAA,MAAA,IAAI,CAAC,QAAQ,EAAC,OAAO,mDAAG,EAAE,iBAAiB,EAAE,CAAC,CAAC;QACjD,CAAC,CAAC;aACD,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE;YACvB,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,6NAA6N,CAC9N,CAAC;SACH;IACH,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport { BaseClient } from '@sentry/core';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Outcome,\n SeverityLevel,\n TransportMakeRequestResponse,\n UserFeedback,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';\nimport { Alert } from 'react-native';\n\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport { getDefaultSidecarUrl } from './integrations/spotlight';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs(ReactNativeLibraries.ReactNativeVersion?.version);\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n // We default this to true, as it is the safer scenario\n options.parentSpanIsAlwaysRootSpan =\n options.parentSpanIsAlwaysRootSpan === undefined ? true : options.parentSpanIsAlwaysRootSpan;\n super(options);\n\n this._outcomesBuffer = [];\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n }\n\n /**\n * @inheritdoc\n */\n public sendEnvelope(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n\n return Promise.resolve({});\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n defaultSidecarUrl: getDefaultSidecarUrl(),\n devServerUrl: getDevServer()?.url || '',\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAYvE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB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AC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,6NAA6N,CAC9N,CAAC;SACH;IACH,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Outcome,\n SeverityLevel,\n TransportMakeRequestResponse,\n UserFeedback,\n} from '@sentry/core';\nimport { BaseClient, dateTimestampInSeconds, logger, SentryError } from '@sentry/core';\nimport { Alert } from 'react-native';\n\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport { getDefaultSidecarUrl } from './integrations/spotlight';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs(ReactNativeLibraries.ReactNativeVersion?.version);\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n // We default this to true, as it is the safer scenario\n options.parentSpanIsAlwaysRootSpan =\n options.parentSpanIsAlwaysRootSpan === undefined ? true : options.parentSpanIsAlwaysRootSpan;\n super(options);\n\n this._outcomesBuffer = [];\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n * @deprecated Use `Sentry.captureFeedback` instead.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n }\n\n /**\n * @inheritdoc\n */\n public sendEnvelope(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n\n return Promise.resolve({});\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n defaultSidecarUrl: getDefaultSidecarUrl(),\n devServerUrl: getDevServer()?.url || '',\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- export type { Breadcrumb, Request, SdkInfo, Event, Exception, SeverityLevel, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/types';
2
- export { addBreadcrumb, captureException, captureEvent, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metricsDefault as metrics, } from '@sentry/core';
1
+ export type { Breadcrumb, Request, SdkInfo, Event, Exception, SendFeedbackParams, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/core';
2
+ export { addBreadcrumb, captureException, captureEvent, captureFeedback, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metricsDefault as metrics, lastEventId, } from '@sentry/core';
3
3
  export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
4
4
  export * from './integrations/exports';
5
5
  export { SDK_NAME, SDK_VERSION } from './version';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,U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kB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mCAAmC,GACpC,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/js/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { addBreadcrumb, captureException, captureEvent, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metricsDefault as metrics, } from '@sentry/core';
1
+ export { addBreadcrumb, captureException, captureEvent, captureFeedback, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metricsDefault as metrics, lastEventId, } from '@sentry/core';
2
2
  export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
3
3
  export * from './integrations/exports';
4
4
  export { SDK_NAME, SDK_VERSION } from './version';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,IAAI,OAAO,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mCAAmC,GACpC,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export type {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n SeverityLevel,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n} from '@sentry/types';\n\nexport {\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n getRootSpan,\n withActiveSpan,\n suppressTracing,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n metricsDefault as metrics,\n} from '@sentry/core';\n\nexport {\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport { init, wrap, nativeCrash, flush, close, captureUserFeedback, withScope, crashedLastRun } from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n reactNativeTracingIntegration,\n getCurrentReactNativeTracingIntegration,\n getReactNativeTracingIntegration,\n reactNavigationIntegration,\n reactNativeNavigationIntegration,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n startIdleNavigationSpan,\n startIdleSpan,\n getDefaultIdleNavigationSpanOptions,\n} from './tracing';\n\nexport type { TimeToDisplayProps } from './tracing';\n\nexport { Mask, Unmask } from './replay/CustomMask';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,IAAI,OAAO,EACzB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mCAAmC,GACpC,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export type {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n SendFeedbackParams,\n SeverityLevel,\n Span,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n} from '@sentry/core';\n\nexport {\n addBreadcrumb,\n captureException,\n captureEvent,\n captureFeedback,\n captureMessage,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n getRootSpan,\n withActiveSpan,\n suppressTracing,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n metricsDefault as metrics,\n lastEventId,\n} from '@sentry/core';\n\nexport {\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport { init, wrap, nativeCrash, flush, close, captureUserFeedback, withScope, crashedLastRun } from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n reactNativeTracingIntegration,\n getCurrentReactNativeTracingIntegration,\n getReactNativeTracingIntegration,\n reactNavigationIntegration,\n reactNativeNavigationIntegration,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n startIdleNavigationSpan,\n startIdleSpan,\n getDefaultIdleNavigationSpanOptions,\n} from './tracing';\n\nexport type { TimeToDisplayProps } from './tracing';\n\nexport { Mask, Unmask } from './replay/CustomMask';\n"]}
@@ -1,4 +1,4 @@
1
- import type { Integration } from '@sentry/types';
1
+ import type { Integration } from '@sentry/core';
2
2
  /**
3
3
  * React Native Error
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"debugsymbolicator.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+B,WAAW,EAAkC,MAAM,eAAe,CAAC;AAa9G;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,QAAO,WAQ/C,CAAC"}
1
+ {"version":3,"file":"debugsymbolicator.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+B,WAAW,EAAkC,MAAM,cAAc,CAAC;AAa7G;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,QAAO,WAQ/C,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { __awaiter } from "tslib";
2
- import { logger } from '@sentry/utils';
2
+ import { logger } from '@sentry/core';
3
3
  import { getFramesToPop, isErrorLike } from '../utils/error';
4
4
  import { fetchSourceContext, parseErrorStack, symbolicateStackTrace } from './debugsymbolicatorutils';
5
5
  const INTEGRATION_NAME = 'DebugSymbolicator';
@@ -1 +1 @@
1
- {"version":3,"file":"debugsymbolicator.js","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicator.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtG,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C,sEAAsE;AACtE,MAAM,wBAAwB,GAAG,IAAI,MAAM,CAAC,CAAC,+BAA+B,EAAE,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAY/G,6DAA6D;AAC7D,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAgB,EAAE;IAC5D,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAA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AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,iBAA0B;IACnD,MAAM,GAAG,GAAG,iBAAkC,CAAC;IAC/C,MAAM,UAAU,GAAkC,EAAE,CAAC;IACrD,KAAK,IAAI,KAAK,GAA8B,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE;QACxF,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { Event, EventHint, Exception, Integration, StackFrame as SentryStackFrame } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type { ExtendedError } from '../utils/error';\nimport { getFramesToPop, isErrorLike } from '../utils/error';\nimport type * as ReactNative from '../vendor/react-native';\nimport { fetchSourceContext, parseErrorStack, symbolicateStackTrace } from './debugsymbolicatorutils';\n\nconst INTEGRATION_NAME = 'DebugSymbolicator';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\nconst INTERNAL_CALLSITES_REGEX = new RegExp(['ReactNativeRenderer-dev\\\\.js$', 'MessageQueue\\\\.js$'].join('|'));\n\n/**\n * React Native Error\n */\nexport type ReactNativeError = Error & {\n framesToPop?: number;\n jsEngine?: string;\n preventSymbolication?: boolean;\n componentStack?: string;\n};\n\n/** Tries to symbolicate the JS stack trace on the device. */\nexport const debugSymbolicatorIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n /* noop */\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, hint: EventHint): Promise<Event> {\n if (event.exception?.values && isErrorLike(hint.originalException)) {\n // originalException is ErrorLike object\n const errorGroup = getExceptionGroup(hint.originalException);\n for (const [index, error] of errorGroup.entries()) {\n const symbolicatedFrames = await symbolicate(error.stack, getFramesToPop(error));\n\n symbolicatedFrames && replaceExceptionFramesInException(event.exception.values[index], symbolicatedFrames);\n }\n } else if (hint.syntheticException && isErrorLike(hint.syntheticException)) {\n // syntheticException is Error object\n const symbolicatedFrames = await symbolicate(\n hint.syntheticException.stack,\n getFramesToPop(hint.syntheticException),\n );\n\n if (event.exception) {\n symbolicatedFrames &&\n event.exception.values &&\n replaceExceptionFramesInException(event.exception.values[0], symbolicatedFrames);\n } else if (event.threads) {\n // RN JS doesn't have threads\n symbolicatedFrames && replaceThreadFramesInEvent(event, symbolicatedFrames);\n }\n }\n\n return event;\n}\n\n/**\n * Symbolicates the stack on the device talking to local dev server.\n * Mutates the passed event.\n */\nasync function symbolicate(rawStack: string, skipFirstFrames: number = 0): Promise<SentryStackFrame[] | null> {\n try {\n const parsedStack = parseErrorStack(rawStack);\n\n const prettyStack = await symbolicateStackTrace(parsedStack);\n if (!prettyStack) {\n logger.error('React Native DevServer could not symbolicate the stack trace.');\n return null;\n }\n\n // This has been changed in an react-native version so stack is contained in here\n const newStack = 'stack' in prettyStack ? prettyStack.stack : prettyStack;\n\n // https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23\n // Match SentryParser which counts lines of stack (-1 for first line with the Error message)\n const skipFirstAdjustedToSentryStackParser = Math.max(skipFirstFrames - 1, 0);\n const stackWithoutPoppedFrames = skipFirstAdjustedToSentryStackParser\n ? newStack.slice(skipFirstAdjustedToSentryStackParser)\n : newStack;\n\n const stackWithoutInternalCallsites = stackWithoutPoppedFrames.filter(\n (frame: { file?: string }) => frame.file && frame.file.match(INTERNAL_CALLSITES_REGEX) === null,\n );\n\n const sentryFrames = await convertReactNativeFramesToSentryFrames(stackWithoutInternalCallsites);\n return await fetchSourceContext(sentryFrames);\n } catch (error) {\n if (error instanceof Error) {\n logger.warn(`Unable to symbolicate stack trace: ${error.message}`);\n }\n return null;\n }\n}\n\n/**\n * Converts ReactNativeFrames to frames in the Sentry format\n * @param frames ReactNativeFrame[]\n */\nasync function convertReactNativeFramesToSentryFrames(frames: ReactNative.StackFrame[]): Promise<SentryStackFrame[]> {\n return Promise.all(\n frames.map(async (frame: ReactNative.StackFrame): Promise<SentryStackFrame> => {\n let inApp = !!frame.column && !!frame.lineNumber;\n inApp =\n inApp &&\n frame.file !== undefined &&\n !frame.file.includes('node_modules') &&\n !frame.file.includes('native code');\n\n const newFrame: SentryStackFrame = {\n lineno: frame.lineNumber,\n colno: frame.column,\n filename: frame.file,\n function: frame.methodName,\n in_app: inApp,\n };\n\n return newFrame;\n }),\n );\n}\n\n/**\n * Replaces the frames in the exception of a error.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceExceptionFramesInException(exception: Exception, frames: SentryStackFrame[]): void {\n if (exception?.stacktrace) {\n exception.stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Replaces the frames in the thread of a message.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceThreadFramesInEvent(event: Event, frames: SentryStackFrame[]): void {\n if (event.threads && event.threads.values && event.threads.values[0] && event.threads.values[0].stacktrace) {\n event.threads.values[0].stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Return a list containing the original exception and also the cause if found.\n *\n * @param originalException The original exception.\n */\nfunction getExceptionGroup(originalException: unknown): (Error & { stack: string })[] {\n const err = originalException as ExtendedError;\n const errorGroup: (Error & { stack: string })[] = [];\n for (let cause: ExtendedError | undefined = err; isErrorLike(cause); cause = cause.cause) {\n errorGroup.push(cause);\n }\n return errorGroup;\n}\n"]}
1
+ {"version":3,"file":"debugsymbolicator.js","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicator.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtG,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C,sEAAsE;AACtE,MAAM,wBAAwB,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AAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE;QAC1G,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;KAC9D;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,iBAA0B;IACnD,MAAM,GAAG,GAAG,iBAAkC,CAAC;IAC/C,MAAM,UAAU,GAAkC,EAAE,CAAC;IACrD,KAAK,IAAI,KAAK,GAA8B,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE;QACxF,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { Event, EventHint, Exception, Integration, StackFrame as SentryStackFrame } from '@sentry/core';\nimport { logger } from '@sentry/core';\n\nimport type { ExtendedError } from '../utils/error';\nimport { getFramesToPop, isErrorLike } from '../utils/error';\nimport type * as ReactNative from '../vendor/react-native';\nimport { fetchSourceContext, parseErrorStack, symbolicateStackTrace } from './debugsymbolicatorutils';\n\nconst INTEGRATION_NAME = 'DebugSymbolicator';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\nconst INTERNAL_CALLSITES_REGEX = new RegExp(['ReactNativeRenderer-dev\\\\.js$', 'MessageQueue\\\\.js$'].join('|'));\n\n/**\n * React Native Error\n */\nexport type ReactNativeError = Error & {\n framesToPop?: number;\n jsEngine?: string;\n preventSymbolication?: boolean;\n componentStack?: string;\n};\n\n/** Tries to symbolicate the JS stack trace on the device. */\nexport const debugSymbolicatorIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n /* noop */\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, hint: EventHint): Promise<Event> {\n if (event.exception?.values && isErrorLike(hint.originalException)) {\n // originalException is ErrorLike object\n const errorGroup = getExceptionGroup(hint.originalException);\n for (const [index, error] of errorGroup.entries()) {\n const symbolicatedFrames = await symbolicate(error.stack, getFramesToPop(error));\n\n symbolicatedFrames && replaceExceptionFramesInException(event.exception.values[index], symbolicatedFrames);\n }\n } else if (hint.syntheticException && isErrorLike(hint.syntheticException)) {\n // syntheticException is Error object\n const symbolicatedFrames = await symbolicate(\n hint.syntheticException.stack,\n getFramesToPop(hint.syntheticException),\n );\n\n if (event.exception) {\n symbolicatedFrames &&\n event.exception.values &&\n replaceExceptionFramesInException(event.exception.values[0], symbolicatedFrames);\n } else if (event.threads) {\n // RN JS doesn't have threads\n symbolicatedFrames && replaceThreadFramesInEvent(event, symbolicatedFrames);\n }\n }\n\n return event;\n}\n\n/**\n * Symbolicates the stack on the device talking to local dev server.\n * Mutates the passed event.\n */\nasync function symbolicate(rawStack: string, skipFirstFrames: number = 0): Promise<SentryStackFrame[] | null> {\n try {\n const parsedStack = parseErrorStack(rawStack);\n\n const prettyStack = await symbolicateStackTrace(parsedStack);\n if (!prettyStack) {\n logger.error('React Native DevServer could not symbolicate the stack trace.');\n return null;\n }\n\n // This has been changed in an react-native version so stack is contained in here\n const newStack = 'stack' in prettyStack ? prettyStack.stack : prettyStack;\n\n // https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23\n // Match SentryParser which counts lines of stack (-1 for first line with the Error message)\n const skipFirstAdjustedToSentryStackParser = Math.max(skipFirstFrames - 1, 0);\n const stackWithoutPoppedFrames = skipFirstAdjustedToSentryStackParser\n ? newStack.slice(skipFirstAdjustedToSentryStackParser)\n : newStack;\n\n const stackWithoutInternalCallsites = stackWithoutPoppedFrames.filter(\n (frame: { file?: string }) => frame.file && frame.file.match(INTERNAL_CALLSITES_REGEX) === null,\n );\n\n const sentryFrames = await convertReactNativeFramesToSentryFrames(stackWithoutInternalCallsites);\n return await fetchSourceContext(sentryFrames);\n } catch (error) {\n if (error instanceof Error) {\n logger.warn(`Unable to symbolicate stack trace: ${error.message}`);\n }\n return null;\n }\n}\n\n/**\n * Converts ReactNativeFrames to frames in the Sentry format\n * @param frames ReactNativeFrame[]\n */\nasync function convertReactNativeFramesToSentryFrames(frames: ReactNative.StackFrame[]): Promise<SentryStackFrame[]> {\n return Promise.all(\n frames.map(async (frame: ReactNative.StackFrame): Promise<SentryStackFrame> => {\n let inApp = !!frame.column && !!frame.lineNumber;\n inApp =\n inApp &&\n frame.file !== undefined &&\n !frame.file.includes('node_modules') &&\n !frame.file.includes('native code');\n\n const newFrame: SentryStackFrame = {\n lineno: frame.lineNumber,\n colno: frame.column,\n filename: frame.file,\n function: frame.methodName,\n in_app: inApp,\n };\n\n return newFrame;\n }),\n );\n}\n\n/**\n * Replaces the frames in the exception of a error.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceExceptionFramesInException(exception: Exception, frames: SentryStackFrame[]): void {\n if (exception?.stacktrace) {\n exception.stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Replaces the frames in the thread of a message.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceThreadFramesInEvent(event: Event, frames: SentryStackFrame[]): void {\n if (event.threads && event.threads.values && event.threads.values[0] && event.threads.values[0].stacktrace) {\n event.threads.values[0].stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Return a list containing the original exception and also the cause if found.\n *\n * @param originalException The original exception.\n */\nfunction getExceptionGroup(originalException: unknown): (Error & { stack: string })[] {\n const err = originalException as ExtendedError;\n const errorGroup: (Error & { stack: string })[] = [];\n for (let cause: ExtendedError | undefined = err; isErrorLike(cause); cause = cause.cause) {\n errorGroup.push(cause);\n }\n return errorGroup;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { StackFrame as SentryStackFrame } from '@sentry/types';
1
+ import type { StackFrame as SentryStackFrame } from '@sentry/core';
2
2
  import type * as ReactNative from '../vendor/react-native';
3
3
  /**
4
4
  * Fetches source context for the Sentry Middleware (/__sentry/context)
@@ -1 +1 @@
1
- {"version":3,"file":"debugsymbolicatorutils.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicatorutils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKpE,OAAO,KAAK,KAAK,WAAW,MAAM,wBAAwB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAuChG;AAMD;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAKjF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,EACpC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAK7C;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,WAAW,CAAC,aAAa,GAAG,SAAS,CAOpE"}
1
+ {"version":3,"file":"debugsymbolicatorutils.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicatorutils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKnE,OAAO,KAAK,KAAK,WAAW,MAAM,wBAAwB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAuChG;AAMD;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAKjF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,EACpC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAK7C;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,WAAW,CAAC,aAAa,GAAG,SAAS,CAOpE"}
@@ -1,5 +1,5 @@
1
1
  import { __awaiter } from "tslib";
2
- import { logger } from '@sentry/utils';
2
+ import { logger } from '@sentry/core';
3
3
  import { ReactNativeLibraries } from '../utils/rnlibraries';
4
4
  import { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"debugsymbolicatorutils.js","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicatorutils.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGrE;;;;;GAKG;AACH,MAAM,UAAgB,kBAAkB,CAAC,MAA0B;;QACjE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YAC3B,IAAI;gBACF,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;gBAC/B,IAAI,CAAC,GAAG,EAAE;oBACR,OAAO,CAAC,MAAM,CAAC,CAAC;oBAChB,OAAO;iBACR;gBAED,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,8BAA8B,EAAE,EAAE,IAAI,CAAC,CAAC;gBACzD,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;gBACzD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;gBAE5C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BAAoB,CAAC,QAAQ,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;KACzD;IACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC/E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;;IAC1B,IAAI;QACF,OAAO,MAAA,oBAAoB,CAAC,QAAQ,0CAAE,YAAY,EAAE,CAAC;KACtD;IAAC,OAAO,GAAG,EAAE;QACZ,8BAA8B;KAC/B;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { StackFrame as SentryStackFrame } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';\nimport type * as ReactNative from '../vendor/react-native';\n\n/**\n * Fetches source context for the Sentry Middleware (/__sentry/context)\n *\n * @param frame StackFrame\n * @param getDevServer function from RN to get DevServer URL\n */\nexport async function fetchSourceContext(frames: SentryStackFrame[]): Promise<SentryStackFrame[]> {\n return new Promise(resolve => {\n try {\n const xhr = createStealthXhr();\n if (!xhr) {\n resolve(frames);\n return;\n }\n\n xhr.open('POST', getSentryMetroSourceContextUrl(), true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify({ stack: frames }));\n\n xhr.onreadystatechange = (): void => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n if (xhr.status !== 200) {\n resolve(frames);\n }\n\n try {\n const response: { stack?: SentryStackFrame[] } = JSON.parse(xhr.responseText);\n if (Array.isArray(response.stack)) {\n resolve(response.stack);\n } else {\n resolve(frames);\n }\n } catch (error) {\n resolve(frames);\n }\n }\n };\n xhr.onerror = (): void => {\n resolve(frames);\n };\n } catch (error) {\n logger.error('Could not fetch source context.', error);\n resolve(frames);\n }\n });\n}\n\nfunction getSentryMetroSourceContextUrl(): string {\n return `${getDevServer().url}__sentry/context`;\n}\n\n/**\n * Loads and calls RN Core Devtools parseErrorStack function.\n */\nexport function parseErrorStack(errorStack: string): Array<ReactNative.StackFrame> {\n if (!ReactNativeLibraries.Devtools) {\n throw new Error('React Native Devtools not available.');\n }\n return ReactNativeLibraries.Devtools.parseErrorStack(errorStack);\n}\n\n/**\n * Loads and calls RN Core Devtools symbolicateStackTrace function.\n */\nexport function symbolicateStackTrace(\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n): Promise<ReactNative.SymbolicatedStackTrace> {\n if (!ReactNativeLibraries.Devtools) {\n throw new Error('React Native Devtools not available.');\n }\n return ReactNativeLibraries.Devtools.symbolicateStackTrace(stack, extraData);\n}\n\n/**\n * Loads and returns the RN DevServer URL.\n */\nexport function getDevServer(): ReactNative.DevServerInfo | undefined {\n try {\n return ReactNativeLibraries.Devtools?.getDevServer();\n } catch (_oO) {\n // We can't load devserver URL\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"debugsymbolicatorutils.js","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicatorutils.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGrE;;;;;GAKG;AACH,MAAM,UAAgB,kBAAkB,CAAC,MAA0B;;QACjE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YAC3B,IAAI;gBACF,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;gBAC/B,IAAI,CAAC,GAAG,EAAE;oBACR,OAAO,CAAC,MAAM,CAAC,CAAC;oBAChB,OAAO;iBACR;gBAED,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,8BAA8B,EAAE,EAAE,IAAI,CAAC,CAAC;gBACzD,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAA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,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAoC,EACpC,SAAmC;IAEnC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;KACzD;IACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC/E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;;IAC1B,IAAI;QACF,OAAO,MAAA,oBAAoB,CAAC,QAAQ,0CAAE,YAAY,EAAE,CAAC;KACtD;IAAC,OAAO,GAAG,EAAE;QACZ,8BAA8B;KAC/B;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { StackFrame as SentryStackFrame } from '@sentry/core';\nimport { logger } from '@sentry/core';\n\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';\nimport type * as ReactNative from '../vendor/react-native';\n\n/**\n * Fetches source context for the Sentry Middleware (/__sentry/context)\n *\n * @param frame StackFrame\n * @param getDevServer function from RN to get DevServer URL\n */\nexport async function fetchSourceContext(frames: SentryStackFrame[]): Promise<SentryStackFrame[]> {\n return new Promise(resolve => {\n try {\n const xhr = createStealthXhr();\n if (!xhr) {\n resolve(frames);\n return;\n }\n\n xhr.open('POST', getSentryMetroSourceContextUrl(), true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify({ stack: frames }));\n\n xhr.onreadystatechange = (): void => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n if (xhr.status !== 200) {\n resolve(frames);\n }\n\n try {\n const response: { stack?: SentryStackFrame[] } = JSON.parse(xhr.responseText);\n if (Array.isArray(response.stack)) {\n resolve(response.stack);\n } else {\n resolve(frames);\n }\n } catch (error) {\n resolve(frames);\n }\n }\n };\n xhr.onerror = (): void => {\n resolve(frames);\n };\n } catch (error) {\n logger.error('Could not fetch source context.', error);\n resolve(frames);\n }\n });\n}\n\nfunction getSentryMetroSourceContextUrl(): string {\n return `${getDevServer().url}__sentry/context`;\n}\n\n/**\n * Loads and calls RN Core Devtools parseErrorStack function.\n */\nexport function parseErrorStack(errorStack: string): Array<ReactNative.StackFrame> {\n if (!ReactNativeLibraries.Devtools) {\n throw new Error('React Native Devtools not available.');\n }\n return ReactNativeLibraries.Devtools.parseErrorStack(errorStack);\n}\n\n/**\n * Loads and calls RN Core Devtools symbolicateStackTrace function.\n */\nexport function symbolicateStackTrace(\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n): Promise<ReactNative.SymbolicatedStackTrace> {\n if (!ReactNativeLibraries.Devtools) {\n throw new Error('React Native Devtools not available.');\n }\n return ReactNativeLibraries.Devtools.symbolicateStackTrace(stack, extraData);\n}\n\n/**\n * Loads and returns the RN DevServer URL.\n */\nexport function getDevServer(): ReactNative.DevServerInfo | undefined {\n try {\n return ReactNativeLibraries.Devtools?.getDevServer();\n } catch (_oO) {\n // We can't load devserver URL\n }\n return undefined;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { Integration } from '@sentry/types';
1
+ import type { Integration } from '@sentry/core';
2
2
  import type { ReactNativeClientOptions } from '../options';
3
3
  /**
4
4
  * Returns the default ReactNative integrations based on the current environment.
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAmC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAsGvF"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAmC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CA0GvF"}
@@ -1,5 +1,5 @@
1
1
  import { reactNativeTracingIntegration } from '../tracing';
2
- import { isExpoGo, isWeb, notWeb } from '../utils/environment';
2
+ import { isExpoGo, notWeb } from '../utils/environment';
3
3
  import { appStartIntegration, breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, createNativeFramesIntegrations, createReactNativeRewriteFrames, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, mobileReplayIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, stallTrackingIntegration, userInteractionIntegration, viewHierarchyIntegration, } from './exports';
4
4
  /**
5
5
  * Returns the default ReactNative integrations based on the current environment.
@@ -78,17 +78,18 @@ export function getDefaultIntegrations(options) {
78
78
  const sidecarUrl = typeof options.spotlight === 'string' ? options.spotlight : undefined;
79
79
  integrations.push(spotlightIntegration({ sidecarUrl }));
80
80
  }
81
- if ((options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||
82
- (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')) {
83
- if (isWeb()) {
84
- // We can't create and add browserReplayIntegration as it overrides the users supplied one
85
- // The browser replay integration works differently than the rest of default integrations
86
- options.replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;
87
- options.replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;
88
- }
89
- else {
90
- integrations.push(mobileReplayIntegration());
91
- }
81
+ const hasReplayOptions = typeof options.replaysOnErrorSampleRate === 'number' || typeof options.replaysSessionSampleRate === 'number';
82
+ const hasExperimentsReplayOptions = (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||
83
+ (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number');
84
+ if (!hasReplayOptions && hasExperimentsReplayOptions) {
85
+ // Remove in the next major version (v7)
86
+ options.replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;
87
+ options.replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;
88
+ }
89
+ if ((hasReplayOptions || hasExperimentsReplayOptions) && notWeb()) {
90
+ // We can't create and add browserReplayIntegration as it overrides the users supplied one
91
+ // The browser replay integration works differently than the rest of default integrations
92
+ integrations.push(mobileReplayIntegration());
92
93
  }
93
94
  if (__DEV__ && notWeb()) {
94
95
  integrations.push(debugSymbolicatorIntegration());