@sentry/react-native 5.0.0-alpha.8 → 5.0.0-beta.1

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 (161) hide show
  1. package/CHANGELOG.md +155 -3
  2. package/README.md +1 -1
  3. package/RNSentry.podspec +5 -5
  4. package/android/build.gradle +1 -1
  5. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +124 -20
  6. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +10 -0
  7. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +10 -0
  8. package/dist/js/NativeRNSentry.d.ts +37 -3
  9. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  10. package/dist/js/NativeRNSentry.js.map +1 -1
  11. package/dist/js/breadcrumb.d.ts +11 -0
  12. package/dist/js/breadcrumb.d.ts.map +1 -0
  13. package/dist/js/breadcrumb.js +34 -0
  14. package/dist/js/breadcrumb.js.map +1 -0
  15. package/dist/js/client.d.ts +4 -5
  16. package/dist/js/client.d.ts.map +1 -1
  17. package/dist/js/client.js +22 -35
  18. package/dist/js/client.js.map +1 -1
  19. package/dist/js/index.d.ts +1 -0
  20. package/dist/js/index.d.ts.map +1 -1
  21. package/dist/js/index.js +1 -0
  22. package/dist/js/index.js.map +1 -1
  23. package/dist/js/integrations/debugsymbolicator.d.ts +1 -1
  24. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  25. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  26. package/dist/js/integrations/devicecontext.d.ts +2 -2
  27. package/dist/js/integrations/devicecontext.d.ts.map +1 -1
  28. package/dist/js/integrations/devicecontext.js +45 -11
  29. package/dist/js/integrations/devicecontext.js.map +1 -1
  30. package/dist/js/integrations/eventorigin.d.ts +1 -1
  31. package/dist/js/integrations/eventorigin.d.ts.map +1 -1
  32. package/dist/js/integrations/eventorigin.js.map +1 -1
  33. package/dist/js/integrations/index.d.ts +1 -0
  34. package/dist/js/integrations/index.d.ts.map +1 -1
  35. package/dist/js/integrations/index.js +1 -0
  36. package/dist/js/integrations/index.js.map +1 -1
  37. package/dist/js/integrations/modulesloader.d.ts +17 -0
  38. package/dist/js/integrations/modulesloader.d.ts.map +1 -0
  39. package/dist/js/integrations/modulesloader.js +39 -0
  40. package/dist/js/integrations/modulesloader.js.map +1 -0
  41. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +1 -1
  42. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  43. package/dist/js/integrations/reactnativeerrorhandlers.js +4 -3
  44. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  45. package/dist/js/integrations/reactnativeinfo.d.ts +1 -1
  46. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
  47. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  48. package/dist/js/integrations/release.d.ts +1 -1
  49. package/dist/js/integrations/release.d.ts.map +1 -1
  50. package/dist/js/integrations/release.js.map +1 -1
  51. package/dist/js/integrations/screenshot.d.ts +23 -0
  52. package/dist/js/integrations/screenshot.d.ts.map +1 -0
  53. package/dist/js/integrations/screenshot.js +39 -0
  54. package/dist/js/integrations/screenshot.js.map +1 -0
  55. package/dist/js/integrations/sdkinfo.d.ts +1 -1
  56. package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
  57. package/dist/js/integrations/sdkinfo.js.map +1 -1
  58. package/dist/js/measurements.d.ts +4 -0
  59. package/dist/js/measurements.d.ts.map +1 -1
  60. package/dist/js/measurements.js +11 -0
  61. package/dist/js/measurements.js.map +1 -1
  62. package/dist/js/misc.d.ts +1 -1
  63. package/dist/js/misc.d.ts.map +1 -1
  64. package/dist/js/misc.js.map +1 -1
  65. package/dist/js/options.d.ts +18 -11
  66. package/dist/js/options.d.ts.map +1 -1
  67. package/dist/js/options.js.map +1 -1
  68. package/dist/js/scope.d.ts +1 -1
  69. package/dist/js/scope.d.ts.map +1 -1
  70. package/dist/js/scope.js +4 -2
  71. package/dist/js/scope.js.map +1 -1
  72. package/dist/js/sdk.d.ts +4 -3
  73. package/dist/js/sdk.d.ts.map +1 -1
  74. package/dist/js/sdk.js +13 -7
  75. package/dist/js/sdk.js.map +1 -1
  76. package/dist/js/tools/ModulesCollector.d.ts +17 -0
  77. package/dist/js/tools/ModulesCollector.d.ts.map +1 -0
  78. package/dist/js/tools/ModulesCollector.js +110 -0
  79. package/dist/js/tools/ModulesCollector.js.map +1 -0
  80. package/dist/js/tools/collectModules.d.ts +2 -0
  81. package/dist/js/tools/collectModules.d.ts.map +1 -0
  82. package/dist/js/tools/collectModules.js +11 -0
  83. package/dist/js/tools/collectModules.js.map +1 -0
  84. package/dist/js/touchevents.d.ts +4 -0
  85. package/dist/js/touchevents.d.ts.map +1 -1
  86. package/dist/js/touchevents.js +10 -5
  87. package/dist/js/touchevents.js.map +1 -1
  88. package/dist/js/tracing/nativeframes.d.ts +2 -2
  89. package/dist/js/tracing/nativeframes.d.ts.map +1 -1
  90. package/dist/js/tracing/nativeframes.js.map +1 -1
  91. package/dist/js/tracing/reactnativenavigation.d.ts +4 -3
  92. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  93. package/dist/js/tracing/reactnativenavigation.js +1 -1
  94. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  95. package/dist/js/tracing/reactnativetracing.d.ts +5 -5
  96. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  97. package/dist/js/tracing/reactnativetracing.js +1 -1
  98. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  99. package/dist/js/tracing/reactnavigation.d.ts +3 -2
  100. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  101. package/dist/js/tracing/reactnavigation.js +1 -1
  102. package/dist/js/tracing/reactnavigation.js.map +1 -1
  103. package/dist/js/tracing/reactnavigationv4.d.ts +4 -3
  104. package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
  105. package/dist/js/tracing/reactnavigationv4.js +1 -1
  106. package/dist/js/tracing/reactnavigationv4.js.map +1 -1
  107. package/dist/js/tracing/routingInstrumentation.d.ts +3 -3
  108. package/dist/js/tracing/routingInstrumentation.d.ts.map +1 -1
  109. package/dist/js/tracing/routingInstrumentation.js.map +1 -1
  110. package/dist/js/tracing/stalltracking.d.ts +2 -2
  111. package/dist/js/tracing/stalltracking.d.ts.map +1 -1
  112. package/dist/js/tracing/stalltracking.js.map +1 -1
  113. package/dist/js/tracing/types.d.ts +1 -1
  114. package/dist/js/tracing/types.d.ts.map +1 -1
  115. package/dist/js/tracing/types.js.map +1 -1
  116. package/dist/js/tracing/utils.d.ts +2 -2
  117. package/dist/js/tracing/utils.d.ts.map +1 -1
  118. package/dist/js/tracing/utils.js.map +1 -1
  119. package/dist/js/transports/TextEncoder.d.ts +1 -1
  120. package/dist/js/transports/TextEncoder.d.ts.map +1 -1
  121. package/dist/js/transports/TextEncoder.js.map +1 -1
  122. package/dist/js/transports/native.d.ts +7 -3
  123. package/dist/js/transports/native.d.ts.map +1 -1
  124. package/dist/js/transports/native.js +10 -1
  125. package/dist/js/transports/native.js.map +1 -1
  126. package/dist/js/user.d.ts +1 -1
  127. package/dist/js/user.d.ts.map +1 -1
  128. package/dist/js/user.js.map +1 -1
  129. package/dist/js/utils/envelope.d.ts +1 -1
  130. package/dist/js/utils/envelope.d.ts.map +1 -1
  131. package/dist/js/utils/envelope.js.map +1 -1
  132. package/dist/js/utils/ignorerequirecyclelogs.d.ts +6 -0
  133. package/dist/js/utils/ignorerequirecyclelogs.d.ts.map +1 -0
  134. package/dist/js/utils/ignorerequirecyclelogs.js +15 -0
  135. package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -0
  136. package/dist/js/utils/outcome.d.ts +1 -1
  137. package/dist/js/utils/outcome.d.ts.map +1 -1
  138. package/dist/js/utils/outcome.js.map +1 -1
  139. package/dist/js/utils/safe.d.ts +1 -1
  140. package/dist/js/utils/safe.d.ts.map +1 -1
  141. package/dist/js/utils/safe.js.map +1 -1
  142. package/dist/js/utils/worldwide.d.ts +1 -1
  143. package/dist/js/utils/worldwide.d.ts.map +1 -1
  144. package/dist/js/utils/worldwide.js.map +1 -1
  145. package/dist/js/version.d.ts +1 -1
  146. package/dist/js/version.d.ts.map +1 -1
  147. package/dist/js/version.js +1 -1
  148. package/dist/js/version.js.map +1 -1
  149. package/dist/js/wrapper.d.ts +10 -3
  150. package/dist/js/wrapper.d.ts.map +1 -1
  151. package/dist/js/wrapper.js +42 -6
  152. package/dist/js/wrapper.js.map +1 -1
  153. package/ios/RNSentry.h +5 -0
  154. package/ios/RNSentry.mm +90 -49
  155. package/package.json +28 -25
  156. package/scripts/collect-modules.sh +43 -0
  157. package/sentry.gradle +84 -6
  158. package/src/js/NativeRNSentry.ts +94 -0
  159. package/ios/RNSentry.xcodeproj/project.pbxproj +0 -472
  160. package/ios/RNSentry.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  161. package/ios/RNSentry.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,157 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.0.0-beta.1
4
+
5
+ - Latest changes from 4.14.0
6
+
7
+ ### Breaking changes
8
+
9
+ - Option `enableAutoPerformanceTracking` renamed to `enableAutoPerformanceTracing`
10
+ - Option `enableOutOfMemoryTracking` renamed to `enableWatchdogTerminationTracking`
11
+
12
+ ### Features
13
+
14
+ - Sync `tags`, `extra`, `fingerprint`, `level`, `environment` and `breadcrumbs` from `sentry-cocoa` during event processing. ([#2713](https://github.com/getsentry/sentry-react-native/pull/2713))
15
+ - `breadcrumb.level` value `log` is transformed to `debug` when syncing with native layers.
16
+ - Remove `breadcrumb.level` value `critical` transformation to `fatal`.
17
+ - Default `breadcrumb.level` is `info`
18
+
19
+ ### Dependencies
20
+
21
+ - Bump Cocoa SDK from v7.31.5 to v8.0.0 ([#2756](https://github.com/getsentry/sentry-react-native/pull/2756))
22
+ - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#800)
23
+ - [diff](https://github.com/getsentry/sentry-cocoa/compare/7.31.5...8.0.0)
24
+ - Bump Android SDK from v6.12.1 to v6.13.0 ([#2790](https://github.com/getsentry/sentry-react-native/pull/2790))
25
+ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6130)
26
+ - [diff](https://github.com/getsentry/sentry-java/compare/6.12.1...6.13.0)
27
+
28
+ ## 4.14.0
29
+
30
+ ### Features
31
+
32
+ - Add support for RNGP introduced in React Native 0.71.0 ([#2759](https://github.com/getsentry/sentry-react-native/pull/2759))
33
+
34
+ ### Fixes
35
+
36
+ - Take screenshot runs on UI thread on Android ([#2743](https://github.com/getsentry/sentry-react-native/pull/2743))
37
+
38
+ ### Dependencies
39
+
40
+ - Bump Android SDK from v6.11.0 to v6.12.1 ([#2755](https://github.com/getsentry/sentry-react-native/pull/2755))
41
+ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6121)
42
+ - [diff](https://github.com/getsentry/sentry-java/compare/6.11.0...6.12.1)
43
+ - Bump JavaScript SDK from v7.29.0 to v7.32.1 ([#2738](https://github.com/getsentry/sentry-react-native/pull/2738), [#2777](https://github.com/getsentry/sentry-react-native/pull/2777))
44
+ - [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7321)
45
+ - [diff](https://github.com/getsentry/sentry-javascript/compare/7.29.0...7.32.1)
46
+
47
+ ## 5.0.0-alpha.11
48
+
49
+ - Latest changes from 4.13.0
50
+
51
+ ### Breaking changes
52
+
53
+ - Message event current stack trace moved from exception to threads ([#2694](https://github.com/getsentry/sentry-react-native/pull/2694))
54
+ - `touchEventBoundaryProps.labelName` property instead of default `accessibilityLabel` fallback ([#2712](https://github.com/getsentry/sentry-react-native/pull/2712))
55
+
56
+ ### Fixes
57
+
58
+ - Unreachable fallback to fetch transport if native is not available ([#2695](https://github.com/getsentry/sentry-react-native/pull/2695))
59
+
60
+ ## 4.13.0
61
+
62
+ ### Fixes
63
+
64
+ - Missing `originalException` in `beforeSend` for events from react native error handler ([#2706](https://github.com/getsentry/sentry-react-native/pull/2706))
65
+ - ModulesLoader integration returns original event if native is not available and event modules overwrite native modules ([#2730](https://github.com/getsentry/sentry-react-native/pull/2730))
66
+
67
+ ### Dependencies
68
+
69
+ - Bump Cocoa SDK from v7.31.3 to v7.31.5 ([#2699](https://github.com/getsentry/sentry-react-native/pull/2699), [#2714](https://github.com/getsentry/sentry-react-native/pull/2714))
70
+ - [changelog](https://github.com/getsentry/sentry-cocoa/blob/8.0.0/CHANGELOG.md#7315)
71
+ - [diff](https://github.com/getsentry/sentry-cocoa/compare/7.31.3...7.31.5)
72
+ - Bump JavaScript SDK from v7.26.0 to v7.29.0 ([#2705](https://github.com/getsentry/sentry-react-native/pull/2705), [#2709](https://github.com/getsentry/sentry-react-native/pull/2709), [#2715](https://github.com/getsentry/sentry-react-native/pull/2715), [#2736](https://github.com/getsentry/sentry-react-native/pull/2736))
73
+ - [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7290)
74
+ - [diff](https://github.com/getsentry/sentry-javascript/compare/7.26.0...7.29.0)
75
+ - Bump Android SDK from v6.9.2 to v6.11.0 ([#2704](https://github.com/getsentry/sentry-react-native/pull/2704), [#2724](https://github.com/getsentry/sentry-react-native/pull/2724))
76
+ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6110)
77
+ - [diff](https://github.com/getsentry/sentry-java/compare/6.9.2...6.11.0)
78
+
79
+ ## 4.12.0
80
+
81
+ ### Features
82
+
83
+ - Add `lastEventId` method to the API ([#2675](https://github.com/getsentry/sentry-react-native/pull/2675))
84
+
85
+ ### Fix
86
+
87
+ - `Sentry.startTransaction` doesn't require `op` ([#2691](https://github.com/getsentry/sentry-react-native/pull/2691))
88
+
89
+ ### Dependencies
90
+
91
+ - Bump Cocoa SDK from v7.31.2 to v7.31.3 ([#2647](https://github.com/getsentry/sentry-react-native/pull/2647))
92
+ - [changelog](https://github.com/getsentry/sentry-cocoa/blob/8.0.0/CHANGELOG.md#7313)
93
+ - [diff](https://github.com/getsentry/sentry-cocoa/compare/7.31.2...7.31.3)
94
+ - Bump JavaScript SDK from v7.21.1 to v7.26.0 ([#2672](https://github.com/getsentry/sentry-react-native/pull/2672), [#2648](https://github.com/getsentry/sentry-react-native/pull/2648), [#2692](https://github.com/getsentry/sentry-react-native/pull/2692))
95
+ - [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7260)
96
+ - [diff](https://github.com/getsentry/sentry-javascript/compare/7.21.1...7.26.0)
97
+ - Bump Android SDK from v6.9.1 to v6.9.2 ([#2677](https://github.com/getsentry/sentry-react-native/pull/2677))
98
+ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#692)
99
+ - [diff](https://github.com/getsentry/sentry-java/compare/6.9.1...6.9.2)
100
+
101
+ ## 5.0.0-alpha.10
102
+
103
+ - Latest changes from 4.11.0
104
+
105
+ ### Dependencies
106
+
107
+ - Bump CLI from v1.74.4 to v2.10.0 ([#2669](https://github.com/getsentry/sentry-react-native/pull/2669))
108
+ - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2100)
109
+ - [diff](https://github.com/getsentry/sentry-cli/compare/1.74.4...2.10.0)
110
+
111
+ ## 4.11.0
112
+
113
+ ### Features
114
+
115
+ - Screenshots ([#2610](https://github.com/getsentry/sentry-react-native/pull/2610))
116
+
117
+ ## 4.10.1
118
+
119
+ ### Fixes
120
+
121
+ - Bump Wizard from v1.2.17 to v1.4.0 ([#2645](https://github.com/getsentry/sentry-react-native/pull/2645))
122
+ - [changelog](https://github.com/getsentry/sentry-wizard/blob/master/CHANGELOG.md#140)
123
+ - [diff](https://github.com/getsentry/sentry-wizard/compare/v1.2.17...v1.4.0)
124
+ - Android builds without ext config, auto create assets dir for modules ([#2652](https://github.com/getsentry/sentry-react-native/pull/2652))
125
+ - Exit gracefully if source map file for collecting modules doesn't exist ([#2655](https://github.com/getsentry/sentry-react-native/pull/2655))
126
+ - Create only one clean-up tasks for modules collection ([#2657](https://github.com/getsentry/sentry-react-native/pull/2657))
127
+
128
+ ### Dependencies
129
+
130
+ - Bump Android SDK from v6.8.0 to v6.9.1 ([#2653](https://github.com/getsentry/sentry-react-native/pull/2653))
131
+ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#691)
132
+ - [diff](https://github.com/getsentry/sentry-java/compare/6.8.0...6.9.1)
133
+
134
+ ## 5.0.0-alpha.9
135
+
136
+ - Latest changes from 4.10.0
137
+
138
+ ### Fixes
139
+
140
+ - Add missing source Spec for RNSentry Codegen. ([#2639](https://github.com/getsentry/sentry-react-native/pull/2639))
141
+
142
+ ## 4.10.0
143
+
144
+ ### Features
145
+
146
+ - JS Runtime dependencies are sent in Events ([#2606](https://github.com/getsentry/sentry-react-native/pull/2606))
147
+ - To collect JS dependencies on iOS add `../node_modules/@sentry/react-native/scripts/collect-modules.sh` at the end of the `Bundle React Native code and images` build phase. The collection only works on Release builds. Android builds have a new step in `sentry.gradle` plugin. More in [the migration documentation](https://docs.sentry.io/platforms/react-native/migration#from-48x-to-49x).
148
+
149
+ ### Dependencies
150
+
151
+ - Bump JavaScript SDK from v7.20.1 to v7.21.1 ([#2636](https://github.com/getsentry/sentry-react-native/pull/2636))
152
+ - [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7211)
153
+ - [diff](https://github.com/getsentry/sentry-javascript/compare/7.20.1...7.21.1)
154
+
3
155
  ## 5.0.0-alpha.8
4
156
 
5
157
  - Latest changes from 4.9.0
@@ -986,10 +1138,10 @@ This release is a breaking change an code changes are necessary.
986
1138
  New way to import and init the SDK:
987
1139
 
988
1140
  ```js
989
- import * as Sentry from "@sentry/react-native";
1141
+ import * as Sentry from '@sentry/react-native';
990
1142
 
991
1143
  Sentry.init({
992
- dsn: "DSN",
1144
+ dsn: 'DSN',
993
1145
  });
994
1146
  ```
995
1147
 
@@ -1224,7 +1376,7 @@ We decided to deactivate stack trace merging by default on iOS since it seems to
1224
1376
  To activate it set:
1225
1377
 
1226
1378
  ```js
1227
- Sentry.config("___DSN___", {
1379
+ Sentry.config('___DSN___', {
1228
1380
  deactivateStacktraceMerging: false,
1229
1381
  });
1230
1382
  ```
package/README.md CHANGED
@@ -13,7 +13,7 @@ _Bad software is everywhere, and we're tired of it. Sentry is on a mission to he
13
13
  # Sentry SDK for React Native
14
14
 
15
15
  [![Build & Test](https://github.com/getsentry/sentry-react-native/actions/workflows/buildandtest.yml/badge.svg)](https://github.com/getsentry/sentry-react-native/actions/workflows/buildandtest.yml)
16
- [![E2E Tests](https://img.shields.io/github/workflow/status/getsentry/sentry-react-native/End-to-End%20Tests?label=E2E%20Tests)](https://github.com/getsentry/sentry-react-native/actions?query=workflow%3A"End-to-End%20Tests")
16
+ [![E2E Tests](https://img.shields.io/github/actions/workflow/status/getsentry/sentry-react-native/.github/workflows/e2e.yml?branch=main)](https://github.com/getsentry/sentry-react-native/actions?query=workflow%3A"End-to-End%20Tests")
17
17
  [![npm version](https://img.shields.io/npm/v/@sentry/react-native.svg)](https://www.npmjs.com/package/@sentry/react-native)
18
18
  [![npm dm](https://img.shields.io/npm/dm/@sentry/react-native.svg)](https://www.npmjs.com/package/@sentry/react-native)
19
19
  [![npm dt](https://img.shields.io/npm/dt/@sentry/react-native.svg)](https://www.npmjs.com/package/@sentry/react-native)
package/RNSentry.podspec CHANGED
@@ -12,16 +12,16 @@ Pod::Spec.new do |s|
12
12
  s.homepage = "https://github.com/getsentry/sentry-react-native"
13
13
  s.source = { :git => 'https://github.com/getsentry/sentry-react-native.git', :tag => "#{s.version}"}
14
14
 
15
- s.ios.deployment_target = "12.4"
16
- s.osx.deployment_target = "10.10"
17
- s.tvos.deployment_target = "12.4"
15
+ s.ios.deployment_target = "11.0"
16
+ s.osx.deployment_target = "10.13"
17
+ s.tvos.deployment_target = "11.0"
18
18
 
19
19
  s.preserve_paths = '*.js'
20
20
 
21
21
  s.dependency 'React-Core'
22
- s.dependency 'Sentry/HybridSDK', '7.31.2'
22
+ s.dependency 'Sentry/HybridSDK', '8.0.0'
23
23
 
24
- s.source_files = 'ios/RNSentry.{h,mm}'
24
+ s.source_files = 'ios/**/*.{h,mm}'
25
25
  s.public_header_files = 'ios/RNSentry.h'
26
26
 
27
27
  # This guard prevent to install the dependencies when we run `pod install` in the old architecture.
@@ -42,5 +42,5 @@ android {
42
42
 
43
43
  dependencies {
44
44
  implementation 'com.facebook.react:react-native:+'
45
- api 'io.sentry:sentry-android:6.8.0'
45
+ api 'io.sentry:sentry-android:6.13.0'
46
46
  }
@@ -1,9 +1,12 @@
1
1
  package io.sentry.react;
2
2
 
3
+ import static io.sentry.android.core.internal.util.ScreenshotUtils.takeScreenshot;
4
+
3
5
  import android.app.Activity;
4
6
  import android.content.Context;
5
7
  import android.content.pm.PackageInfo;
6
8
  import android.content.pm.PackageManager;
9
+ import android.content.res.AssetManager;
7
10
  import android.util.SparseIntArray;
8
11
 
9
12
  import androidx.annotation.Nullable;
@@ -15,28 +18,43 @@ import com.facebook.react.bridge.ReactApplicationContext;
15
18
  import com.facebook.react.bridge.ReadableArray;
16
19
  import com.facebook.react.bridge.ReadableMap;
17
20
  import com.facebook.react.bridge.ReadableMapKeySetIterator;
21
+ import com.facebook.react.bridge.UiThreadUtil;
22
+ import com.facebook.react.bridge.WritableArray;
18
23
  import com.facebook.react.bridge.WritableMap;
24
+ import com.facebook.react.bridge.WritableNativeArray;
25
+ import com.facebook.react.bridge.WritableNativeMap;
26
+ import com.facebook.react.module.annotations.ReactModule;
19
27
 
28
+ import java.io.BufferedInputStream;
20
29
  import java.io.File;
30
+ import java.io.FileNotFoundException;
21
31
  import java.io.FileOutputStream;
22
- import java.util.Date;
32
+ import java.io.InputStream;
33
+ import java.nio.charset.Charset;
23
34
  import java.util.HashMap;
24
35
  import java.util.List;
25
36
  import java.util.Map;
26
37
  import java.util.UUID;
27
- import java.util.logging.Level;
28
- import java.util.logging.Logger;
38
+ import java.util.concurrent.CountDownLatch;
39
+ import java.util.concurrent.TimeUnit;
29
40
 
30
41
  import io.sentry.Breadcrumb;
42
+ import io.sentry.DateUtils;
31
43
  import io.sentry.HubAdapter;
44
+ import io.sentry.ILogger;
32
45
  import io.sentry.Integration;
33
46
  import io.sentry.Sentry;
47
+ import io.sentry.SentryDate;
34
48
  import io.sentry.SentryEvent;
35
49
  import io.sentry.SentryLevel;
36
50
  import io.sentry.UncaughtExceptionHandlerIntegration;
51
+ import io.sentry.android.core.AndroidLogger;
37
52
  import io.sentry.android.core.AnrIntegration;
38
53
  import io.sentry.android.core.AppStartState;
54
+ import io.sentry.android.core.BuildInfoProvider;
55
+ import io.sentry.android.core.CurrentActivityHolder;
39
56
  import io.sentry.android.core.NdkIntegration;
57
+ import io.sentry.android.core.ScreenshotEventProcessor;
40
58
  import io.sentry.android.core.SentryAndroid;
41
59
  import io.sentry.protocol.SdkVersion;
42
60
  import io.sentry.protocol.SentryException;
@@ -47,12 +65,16 @@ public class RNSentryModuleImpl {
47
65
 
48
66
  public static final String NAME = "RNSentry";
49
67
 
50
- private static final Logger logger = Logger.getLogger("react-native-sentry");
68
+ private static final ILogger logger = new AndroidLogger(NAME);
69
+ private static final BuildInfoProvider buildInfo = new BuildInfoProvider(logger);
70
+ private static final String modulesPath = "modules.json";
71
+ private static final Charset UTF_8 = Charset.forName("UTF-8");
51
72
 
52
73
  private final ReactApplicationContext reactApplicationContext;
53
74
  private final PackageInfo packageInfo;
54
75
  private FrameMetricsAggregator frameMetricsAggregator = null;
55
76
  private boolean androidXAvailable;
77
+ private ScreenshotEventProcessor screenshotEventProcessor;
56
78
 
57
79
  private static boolean didFetchAppStart;
58
80
 
@@ -61,6 +83,8 @@ public class RNSentryModuleImpl {
61
83
  // 16ms (slower than 60fps) to constitute slow frames.
62
84
  private static final int SLOW_FRAME_THRESHOLD = 16;
63
85
 
86
+ private static final int SCREENSHOT_TIMEOUT_SECONDS = 2;
87
+
64
88
  public RNSentryModuleImpl(ReactApplicationContext reactApplicationContext) {
65
89
  packageInfo = getPackageInfo(reactApplicationContext);
66
90
  this.reactApplicationContext = reactApplicationContext;
@@ -79,11 +103,10 @@ public class RNSentryModuleImpl {
79
103
  SentryAndroid.init(this.getReactApplicationContext(), options -> {
80
104
  if (rnOptions.hasKey("debug") && rnOptions.getBoolean("debug")) {
81
105
  options.setDebug(true);
82
- logger.setLevel(Level.INFO);
83
106
  }
84
107
  if (rnOptions.hasKey("dsn") && rnOptions.getString("dsn") != null) {
85
108
  String dsn = rnOptions.getString("dsn");
86
- logger.info(String.format("Starting with DSN: '%s'", dsn));
109
+ logger.log(SentryLevel.INFO, String.format("Starting with DSN: '%s'", dsn));
87
110
  options.setDsn(dsn);
88
111
  } else {
89
112
  // SentryAndroid needs an empty string fallback for the dsn.
@@ -127,6 +150,9 @@ public class RNSentryModuleImpl {
127
150
  // by default we hide.
128
151
  options.setAttachThreads(rnOptions.getBoolean("attachThreads"));
129
152
  }
153
+ if (rnOptions.hasKey("attachScreenshot")) {
154
+ options.setAttachScreenshot(rnOptions.getBoolean("attachScreenshot"));
155
+ }
130
156
  if (rnOptions.hasKey("sendDefaultPii")) {
131
157
  options.setSendDefaultPii(rnOptions.getBoolean("sendDefaultPii"));
132
158
  }
@@ -162,8 +188,13 @@ public class RNSentryModuleImpl {
162
188
  }
163
189
  }
164
190
  }
191
+ logger.log(SentryLevel.INFO, String.format("Native Integrations '%s'", options.getIntegrations()));
165
192
 
166
- logger.info(String.format("Native Integrations '%s'", options.getIntegrations()));
193
+ final CurrentActivityHolder currentActivityHolder = CurrentActivityHolder.getInstance();
194
+ final Activity currentActivity = getCurrentActivity();
195
+ if (currentActivity != null) {
196
+ currentActivityHolder.setActivity(currentActivity);
197
+ }
167
198
  });
168
199
 
169
200
  promise.resolve(true);
@@ -173,6 +204,24 @@ public class RNSentryModuleImpl {
173
204
  throw new RuntimeException("TEST - Sentry Client Crash (only works in release mode)");
174
205
  }
175
206
 
207
+ public void fetchModules(Promise promise) {
208
+ final AssetManager assets = this.getReactApplicationContext().getResources().getAssets();
209
+ try (final InputStream stream =
210
+ new BufferedInputStream(assets.open(RNSentryModuleImpl.modulesPath))) {
211
+ int size = stream.available();
212
+ byte[] buffer = new byte[size];
213
+ stream.read(buffer);
214
+ stream.close();
215
+ String modulesJson = new String(buffer, RNSentryModuleImpl.UTF_8);
216
+ promise.resolve(modulesJson);
217
+ } catch (FileNotFoundException e) {
218
+ promise.resolve(null);
219
+ } catch (Throwable e) {
220
+ logger.log(SentryLevel.WARNING, "Fetching JS Modules failed.");
221
+ promise.resolve(null);
222
+ }
223
+ }
224
+
176
225
  public void fetchNativeRelease(Promise promise) {
177
226
  WritableMap release = Arguments.createMap();
178
227
  release.putString("id", packageInfo.packageName);
@@ -183,21 +232,21 @@ public class RNSentryModuleImpl {
183
232
 
184
233
  public void fetchNativeAppStart(Promise promise) {
185
234
  final AppStartState appStartInstance = AppStartState.getInstance();
186
- final Date appStartTime = appStartInstance.getAppStartTime();
235
+ final SentryDate appStartTime = appStartInstance.getAppStartTime();
187
236
  final Boolean isColdStart = appStartInstance.isColdStart();
188
237
 
189
238
  if (appStartTime == null) {
190
- logger.warning("App start won't be sent due to missing appStartTime.");
239
+ logger.log(SentryLevel.WARNING, "App start won't be sent due to missing appStartTime.");
191
240
  promise.resolve(null);
192
241
  } else if (isColdStart == null) {
193
- logger.warning("App start won't be sent due to missing isColdStart.");
242
+ logger.log(SentryLevel.WARNING, "App start won't be sent due to missing isColdStart.");
194
243
  promise.resolve(null);
195
244
  } else {
196
- final double appStartTimestamp = (double) appStartTime.getTime();
245
+ final double appStartTimestampMs = DateUtils.nanosToMillis(appStartTime.nanoTimestamp());
197
246
 
198
247
  WritableMap appStart = Arguments.createMap();
199
248
 
200
- appStart.putDouble("appStartTime", appStartTimestamp);
249
+ appStart.putDouble("appStartTime", appStartTimestampMs);
201
250
  appStart.putBoolean("isColdStart", isColdStart);
202
251
  appStart.putBoolean("didFetchAppStart", didFetchAppStart);
203
252
 
@@ -255,7 +304,7 @@ public class RNSentryModuleImpl {
255
304
 
256
305
  promise.resolve(map);
257
306
  } catch (Throwable ignored) {
258
- logger.warning("Error fetching native frames.");
307
+ logger.log(SentryLevel.WARNING, "Error fetching native frames.");
259
308
  promise.resolve(null);
260
309
  }
261
310
  }
@@ -271,7 +320,7 @@ public class RNSentryModuleImpl {
271
320
  final String outboxPath = HubAdapter.getInstance().getOptions().getOutboxPath();
272
321
 
273
322
  if (outboxPath == null) {
274
- logger.severe(
323
+ logger.log(SentryLevel.ERROR,
275
324
  "Error retrieving outboxPath. Envelope will not be sent. Is the Android SDK initialized?");
276
325
  } else {
277
326
  File installation = new File(outboxPath, UUID.randomUUID().toString());
@@ -280,16 +329,71 @@ public class RNSentryModuleImpl {
280
329
  }
281
330
  }
282
331
  } catch (Throwable ignored) {
283
- logger.severe("Error while writing envelope to outbox.");
332
+ logger.log(SentryLevel.ERROR, "Error while writing envelope to outbox.");
284
333
  }
285
334
  promise.resolve(true);
286
335
  }
287
336
 
337
+ public void captureScreenshot(Promise promise) {
338
+
339
+ final Activity activity = getCurrentActivity();
340
+ if (activity == null) {
341
+ logger.log(SentryLevel.WARNING, "CurrentActivity is null, can't capture screenshot.");
342
+ promise.resolve(null);
343
+ return;
344
+ }
345
+
346
+ final byte[] raw = takeScreenshotOnUiThread(activity);
347
+
348
+ if (raw == null) {
349
+ logger.log(SentryLevel.WARNING, "Screenshot is null, screen was not captured.");
350
+ promise.resolve(null);
351
+ return;
352
+ }
353
+
354
+ final WritableNativeArray data = new WritableNativeArray();
355
+ for (final byte b : raw) {
356
+ data.pushInt(b);
357
+ }
358
+ final WritableMap screenshot = new WritableNativeMap();
359
+ screenshot.putString("contentType", "image/png");
360
+ screenshot.putArray("data", data);
361
+ screenshot.putString("filename", "screenshot.png");
362
+
363
+ final WritableArray screenshotsArray = new WritableNativeArray();
364
+ screenshotsArray.pushMap(screenshot);
365
+ promise.resolve(screenshotsArray);
366
+ }
367
+
368
+ private static byte[] takeScreenshotOnUiThread(Activity activity) {
369
+ CountDownLatch doneSignal = new CountDownLatch(1);
370
+ final byte[][] bytesWrapper = {{}}; // wrapper to be able to set the value in the runnable
371
+ final Runnable runTakeScreenshot = () -> {
372
+ bytesWrapper[0] = takeScreenshot(activity, logger, buildInfo);
373
+ doneSignal.countDown();
374
+ };
375
+
376
+ if (UiThreadUtil.isOnUiThread()) {
377
+ runTakeScreenshot.run();
378
+ } else {
379
+ UiThreadUtil.runOnUiThread(runTakeScreenshot);
380
+ }
381
+
382
+ try {
383
+ doneSignal.await(SCREENSHOT_TIMEOUT_SECONDS, TimeUnit.SECONDS);
384
+ } catch (InterruptedException e) {
385
+ logger.log(SentryLevel.ERROR, "Screenshot process was interrupted.");
386
+ return null;
387
+ }
388
+
389
+ return bytesWrapper[0];
390
+ }
391
+
288
392
  private static PackageInfo getPackageInfo(Context ctx) {
289
393
  try {
290
394
  return ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
291
395
  } catch (PackageManager.NameNotFoundException e) {
292
- logger.warning("Error getting package info.");
396
+ logger.log(SentryLevel.WARNING, "Error getting package info.");
293
397
  return null;
294
398
  }
295
399
  }
@@ -444,17 +548,17 @@ public class RNSentryModuleImpl {
444
548
  try {
445
549
  frameMetricsAggregator.add(currentActivity);
446
550
 
447
- logger.info("FrameMetricsAggregator installed.");
551
+ logger.log(SentryLevel.INFO, "FrameMetricsAggregator installed.");
448
552
  } catch (Throwable ignored) {
449
553
  // throws ConcurrentModification when calling addOnFrameMetricsAvailableListener
450
554
  // this is a best effort since we can't reproduce it
451
- logger.severe("Error adding Activity to frameMetricsAggregator.");
555
+ logger.log(SentryLevel.ERROR, "Error adding Activity to frameMetricsAggregator.");
452
556
  }
453
557
  } else {
454
- logger.info("currentActivity isn't available.");
558
+ logger.log(SentryLevel.INFO, "currentActivity isn't available.");
455
559
  }
456
560
  } else {
457
- logger.warning("androidx.core' isn't available as a dependency.");
561
+ logger.log(SentryLevel.WARNING, "androidx.core' isn't available as a dependency.");
458
562
  }
459
563
  }
460
564
 
@@ -32,6 +32,11 @@ public class RNSentryModule extends NativeRNSentrySpec {
32
32
  this.impl.crash();
33
33
  }
34
34
 
35
+ @Override
36
+ public void fetchModules(Promise promise) {
37
+ this.impl.fetchModules(promise);
38
+ }
39
+
35
40
  @Override
36
41
  public void fetchNativeRelease(Promise promise) {
37
42
  this.impl.fetchNativeRelease(promise);
@@ -52,6 +57,11 @@ public class RNSentryModule extends NativeRNSentrySpec {
52
57
  this.impl.captureEnvelope(rawBytes, options, promise);
53
58
  }
54
59
 
60
+ @Override
61
+ public void captureScreenshot(Promise promise) {
62
+ this.impl.captureScreenshot(promise);
63
+ }
64
+
55
65
  @Override
56
66
  public void setUser(final ReadableMap user, final ReadableMap otherUserKeys) {
57
67
  this.impl.setUser(user, otherUserKeys);
@@ -32,6 +32,11 @@ public class RNSentryModule extends ReactContextBaseJavaModule {
32
32
  this.impl.crash();
33
33
  }
34
34
 
35
+ @ReactMethod
36
+ public void fetchModules(Promise promise) {
37
+ this.impl.fetchModules(promise);
38
+ }
39
+
35
40
  @ReactMethod
36
41
  public void fetchNativeRelease(Promise promise) {
37
42
  this.impl.fetchNativeRelease(promise);
@@ -52,6 +57,11 @@ public class RNSentryModule extends ReactContextBaseJavaModule {
52
57
  this.impl.captureEnvelope(rawBytes, options, promise);
53
58
  }
54
59
 
60
+ @ReactMethod
61
+ public void captureScreenshot(Promise promise) {
62
+ this.impl.captureScreenshot(promise);
63
+ }
64
+
55
65
  @ReactMethod
56
66
  public void setUser(final ReadableMap user, final ReadableMap otherUserKeys) {
57
67
  this.impl.setUser(user, otherUserKeys);
@@ -1,11 +1,12 @@
1
- import { Package } from '@sentry/types';
2
- import { TurboModule } from 'react-native';
1
+ import type { Package } from '@sentry/types';
2
+ import type { TurboModule } from 'react-native';
3
3
  import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
4
4
  export interface Spec extends TurboModule {
5
5
  addBreadcrumb(breadcrumb: UnsafeObject): void;
6
6
  captureEnvelope(bytes: number[], options: {
7
7
  store: boolean;
8
8
  }): Promise<boolean>;
9
+ captureScreenshot(): Promise<NativeScreenshot[]>;
9
10
  clearBreadcrumbs(): void;
10
11
  crash(): void;
11
12
  closeNativeSdk(): Promise<void>;
@@ -21,6 +22,7 @@ export interface Spec extends TurboModule {
21
22
  setExtra(key: string, value: string): void;
22
23
  setTag(key: string, value: string): void;
23
24
  enableNativeFramesTracking(): void;
25
+ fetchModules(): Promise<string | undefined | null>;
24
26
  }
25
27
  export declare type NativeAppStartResponse = {
26
28
  isColdStart: boolean;
@@ -37,8 +39,40 @@ export declare type NativeReleaseResponse = {
37
39
  id: string;
38
40
  version: string;
39
41
  };
42
+ /**
43
+ * This type describes serialized scope from sentry-cocoa. (This is not used for Android)
44
+ * https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryScope.m
45
+ */
40
46
  export declare type NativeDeviceContextsResponse = {
41
- [key: string]: Record<string, unknown>;
47
+ [key: string]: unknown;
48
+ tags?: Record<string, string>;
49
+ extra?: Record<string, unknown>;
50
+ context?: Record<string, Record<string, unknown>>;
51
+ user?: {
52
+ userId?: string;
53
+ email?: string;
54
+ username?: string;
55
+ ipAddress?: string;
56
+ segment?: string;
57
+ data?: Record<string, unknown>;
58
+ };
59
+ dist?: string;
60
+ environment?: string;
61
+ fingerprint?: string[];
62
+ level?: string;
63
+ breadcrumbs?: {
64
+ level?: string;
65
+ timestamp?: string;
66
+ category?: string;
67
+ type?: string;
68
+ message?: string;
69
+ data?: Record<string, unknown>;
70
+ }[];
71
+ };
72
+ export declare type NativeScreenshot = {
73
+ data: number[];
74
+ contentType: string;
75
+ filename: string;
42
76
  };
43
77
  declare const _default: Spec;
44
78
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRNSentry.d.ts","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC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AAO,EAAe,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAuDhE,2DAA2D;AAC3D,eAAe,mBAAmB,CAAC,YAAY,CAAO,UAAU,CAAC,CAAC","sourcesContent":["import { Package } from '@sentry/types';\nimport { TurboModule, TurboModuleRegistry } from 'react-native';\nimport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';\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 addBreadcrumb(breadcrumb: UnsafeObject): void;\n captureEnvelope(\n bytes: number[],\n options: {\n store: boolean,\n },\n ): Promise<boolean>;\n clearBreadcrumbs(): void;\n crash(): void;\n closeNativeSdk(): Promise<void>;\n disableNativeFramesTracking(): void;\n fetchNativeRelease(): Promise<NativeReleaseResponse>;\n fetchNativeSdkInfo(): Promise<Package>;\n fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse>;\n fetchNativeAppStart(): Promise<NativeAppStartResponse | null>;\n fetchNativeFrames(): Promise<NativeFramesResponse | null>;\n initNativeSdk(options: UnsafeObject): Promise<boolean>;\n setUser(\n defaultUserKeys: UnsafeObject | null,\n otherUserKeys: UnsafeObject | null\n ): 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}\n\nexport type NativeAppStartResponse = {\n isColdStart: boolean;\n appStartTime: number;\n didFetchAppStart: boolean;\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\nexport type NativeDeviceContextsResponse = {\n [key: string]: Record<string, unknown>;\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;AA0FnD,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';\nimport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';\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 addBreadcrumb(breadcrumb: UnsafeObject): void;\n captureEnvelope(\n bytes: number[],\n options: {\n store: boolean,\n },\n ): Promise<boolean>;\n captureScreenshot(): Promise<NativeScreenshot[]>;\n clearBreadcrumbs(): void;\n crash(): void;\n closeNativeSdk(): Promise<void>;\n disableNativeFramesTracking(): void;\n fetchNativeRelease(): Promise<NativeReleaseResponse>;\n fetchNativeSdkInfo(): Promise<Package>;\n fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse>;\n fetchNativeAppStart(): Promise<NativeAppStartResponse | null>;\n fetchNativeFrames(): Promise<NativeFramesResponse | null>;\n initNativeSdk(options: UnsafeObject): Promise<boolean>;\n setUser(\n defaultUserKeys: UnsafeObject | null,\n otherUserKeys: UnsafeObject | null\n ): 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}\n\nexport type NativeAppStartResponse = {\n isColdStart: boolean;\n appStartTime: number;\n didFetchAppStart: boolean;\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. (This is not used for Android)\n * https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryScope.m\n */\nexport type NativeDeviceContextsResponse = {\n [key: string]: unknown;\n tags?: Record<string, string>;\n extra?: Record<string, unknown>;\n context?: 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"]}
@@ -0,0 +1,11 @@
1
+ import type { Breadcrumb, SeverityLevel } from '@sentry/types';
2
+ export declare const DEFAULT_BREADCRUMB_LEVEL: SeverityLevel;
3
+ declare type BreadcrumbCandidate = {
4
+ [K in keyof Partial<Breadcrumb>]: unknown;
5
+ };
6
+ /**
7
+ * Convert plain object to a valid Breadcrumb
8
+ */
9
+ export declare function breadcrumbFromObject(candidate: BreadcrumbCandidate): Breadcrumb;
10
+ export {};
11
+ //# sourceMappingURL=breadcrumb.d.ts.map