@datadog/mobile-react-native 2.14.1 → 3.0.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 (670) hide show
  1. package/DatadogSDKReactNative.podspec +6 -6
  2. package/README.md +23 -13
  3. package/android/build.gradle +10 -11
  4. package/android/gradle.properties +1 -1
  5. package/android/src/main/kotlin/com/datadog/reactnative/DatadogSDKWrapper.kt +36 -93
  6. package/android/src/main/kotlin/com/datadog/reactnative/DatadogWrapper.kt +46 -59
  7. package/android/src/main/kotlin/com/datadog/reactnative/DdLogsImplementation.kt +2 -1
  8. package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +98 -0
  9. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +125 -75
  10. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +199 -90
  11. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +151 -24
  12. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +57 -33
  13. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +2 -1
  14. package/android/src/main/kotlin/com/datadog/reactnative/DdTelemetry.kt +96 -0
  15. package/android/src/main/kotlin/com/datadog/reactnative/DdTraceImplementation.kt +20 -19
  16. package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
  17. package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +100 -1
  18. package/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +68 -14
  19. package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +94 -0
  20. package/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +70 -11
  21. package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +58 -0
  22. package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +63 -43
  23. package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +2024 -1199
  24. package/android/src/test/kotlin/com/datadog/reactnative/DdTraceTest.kt +44 -40
  25. package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +60 -91
  26. package/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +34 -14
  27. package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +47 -43
  28. package/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt +0 -1
  29. package/android/src/test/resources/input/complete-configuration.json +32 -28
  30. package/android/src/test/resources/input/malformed-configuration.json +1 -1
  31. package/android/src/test/resources/input/minimal-configuration.json +4 -2
  32. package/datadog-configuration.schema.json +187 -139
  33. package/ios/Sources/AnyEncodable.swift +14 -7
  34. package/ios/Sources/Attributes.swift +0 -7
  35. package/ios/Sources/DatadogSDKWrapper.swift +12 -128
  36. package/ios/Sources/DdLogsImplementation.swift +9 -39
  37. package/ios/Sources/DdRum.mm +89 -1
  38. package/ios/Sources/DdRumImplementation.swift +79 -0
  39. package/ios/Sources/DdSdk.mm +76 -11
  40. package/ios/Sources/DdSdkConfiguration.swift +159 -117
  41. package/ios/Sources/DdSdkImplementation.swift +235 -82
  42. package/ios/Sources/DdSdkNativeInitialization.swift +116 -80
  43. package/ios/Sources/DdTelemetry.swift +49 -0
  44. package/ios/Sources/GlobalState.swift +1 -1
  45. package/ios/Sources/RNDdSdkConfiguration.swift +334 -172
  46. package/ios/Sources/SdkVersion.swift +1 -1
  47. package/jest/mock.js +43 -4
  48. package/lib/commonjs/DdAttributes.js.map +1 -0
  49. package/lib/commonjs/DdSdkReactNative.js +159 -56
  50. package/lib/commonjs/DdSdkReactNative.js.map +1 -1
  51. package/lib/commonjs/InternalLog.js +1 -1
  52. package/lib/commonjs/config/DatadogProviderConfiguration.js +25 -0
  53. package/lib/commonjs/config/DatadogProviderConfiguration.js.map +1 -0
  54. package/lib/commonjs/config/FileBasedConfiguration.js +349 -0
  55. package/lib/commonjs/config/FileBasedConfiguration.js.map +1 -0
  56. package/lib/commonjs/config/FileBasedConfiguration.type.js +6 -0
  57. package/lib/commonjs/config/FileBasedConfiguration.type.js.map +1 -0
  58. package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js +51 -0
  59. package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js.map +1 -0
  60. package/lib/commonjs/config/async/PartialInitializationConfiguration.js +6 -0
  61. package/lib/commonjs/config/async/PartialInitializationConfiguration.js.map +1 -0
  62. package/lib/commonjs/config/async/asyncInitializationHelper.js +44 -0
  63. package/lib/commonjs/config/async/asyncInitializationHelper.js.map +1 -0
  64. package/lib/commonjs/config/features/CoreConfiguration.js +104 -0
  65. package/lib/commonjs/config/features/CoreConfiguration.js.map +1 -0
  66. package/lib/commonjs/config/features/CoreConfiguration.type.js +6 -0
  67. package/lib/commonjs/config/features/CoreConfiguration.type.js.map +1 -0
  68. package/lib/commonjs/config/features/CoreConfigurationNative.js +38 -0
  69. package/lib/commonjs/config/features/CoreConfigurationNative.js.map +1 -0
  70. package/lib/commonjs/config/features/LogsConfiguration.js +36 -0
  71. package/lib/commonjs/config/features/LogsConfiguration.js.map +1 -0
  72. package/lib/commonjs/config/features/LogsConfiguration.type.js +6 -0
  73. package/lib/commonjs/config/features/LogsConfiguration.type.js.map +1 -0
  74. package/lib/commonjs/config/features/LogsConfigurationNative.js +2 -0
  75. package/lib/commonjs/config/features/LogsConfigurationNative.js.map +1 -0
  76. package/lib/commonjs/config/features/RumConfiguration.js +120 -0
  77. package/lib/commonjs/config/features/RumConfiguration.js.map +1 -0
  78. package/lib/commonjs/config/features/RumConfiguration.type.js +6 -0
  79. package/lib/commonjs/config/features/RumConfiguration.type.js.map +1 -0
  80. package/lib/commonjs/config/features/RumConfigurationNative.js +2 -0
  81. package/lib/commonjs/config/features/RumConfigurationNative.js.map +1 -0
  82. package/lib/commonjs/config/features/TraceConfiguration.js +24 -0
  83. package/lib/commonjs/config/features/TraceConfiguration.js.map +1 -0
  84. package/lib/commonjs/config/features/TraceConfiguration.type.js +2 -0
  85. package/lib/commonjs/config/features/TraceConfiguration.type.js.map +1 -0
  86. package/lib/commonjs/config/features/TraceConfigurationNative.js +2 -0
  87. package/lib/commonjs/config/features/TraceConfigurationNative.js.map +1 -0
  88. package/lib/commonjs/config/types/BatchProcessingLevel.js +30 -0
  89. package/lib/commonjs/config/types/BatchProcessingLevel.js.map +1 -0
  90. package/lib/commonjs/config/types/BatchSize.js +31 -0
  91. package/lib/commonjs/config/types/BatchSize.js.map +1 -0
  92. package/lib/commonjs/config/types/InitializationMode.js +17 -0
  93. package/lib/commonjs/config/types/InitializationMode.js.map +1 -0
  94. package/lib/commonjs/config/types/InitializationModeForTelemetry.js +2 -0
  95. package/lib/commonjs/config/types/InitializationModeForTelemetry.js.map +1 -0
  96. package/lib/commonjs/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
  97. package/lib/commonjs/config/types/ProxyConfiguration.js.map +1 -0
  98. package/lib/commonjs/config/types/SdkVerbosity.js.map +1 -0
  99. package/lib/commonjs/config/types/TrackingConsent.js.map +1 -0
  100. package/lib/commonjs/config/types/UploadFrequency.js +30 -0
  101. package/lib/commonjs/config/types/UploadFrequency.js.map +1 -0
  102. package/lib/commonjs/config/types/VitalsUpdateFrequency.js +19 -0
  103. package/lib/commonjs/config/types/VitalsUpdateFrequency.js.map +1 -0
  104. package/lib/commonjs/config/types/index.js +68 -0
  105. package/lib/commonjs/config/types/index.js.map +1 -0
  106. package/lib/commonjs/index.js +51 -21
  107. package/lib/commonjs/index.js.map +1 -1
  108. package/lib/commonjs/logs/DdLogs.js +13 -9
  109. package/lib/commonjs/logs/DdLogs.js.map +1 -1
  110. package/lib/commonjs/logs/eventMapper.js +4 -1
  111. package/lib/commonjs/logs/eventMapper.js.map +1 -1
  112. package/lib/commonjs/nativeModulesTypes.js +0 -45
  113. package/lib/commonjs/nativeModulesTypes.js.map +1 -1
  114. package/lib/commonjs/rum/DdRum.js +56 -28
  115. package/lib/commonjs/rum/DdRum.js.map +1 -1
  116. package/lib/commonjs/rum/helper.js +63 -0
  117. package/lib/commonjs/rum/helper.js.map +1 -0
  118. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +14 -18
  119. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  120. package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -25
  121. package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
  122. package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
  123. package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
  124. package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
  125. package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +34 -22
  126. package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
  127. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +21 -1
  128. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
  129. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +16 -3
  130. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
  131. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -12
  132. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
  133. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +6 -0
  134. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
  135. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +41 -47
  136. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
  137. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +62 -0
  138. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
  139. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
  140. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js +36 -0
  141. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
  142. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
  143. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +19 -8
  144. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
  145. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
  146. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
  147. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
  148. package/lib/commonjs/rum/types.js +1 -9
  149. package/lib/commonjs/rum/types.js.map +1 -1
  150. package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js +46 -0
  151. package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
  152. package/lib/commonjs/sdk/AccountInfoSingleton/types.js +2 -0
  153. package/lib/commonjs/sdk/AccountInfoSingleton/types.js.map +1 -0
  154. package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js +51 -0
  155. package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
  156. package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js +140 -0
  157. package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
  158. package/lib/commonjs/{utils → sdk/AttributesEncoding}/errorUtils.js +39 -22
  159. package/lib/commonjs/sdk/AttributesEncoding/errorUtils.js.map +1 -0
  160. package/lib/commonjs/sdk/AttributesEncoding/helpers.js +123 -0
  161. package/lib/commonjs/sdk/AttributesEncoding/helpers.js.map +1 -0
  162. package/lib/commonjs/sdk/AttributesEncoding/types.js +2 -0
  163. package/lib/commonjs/sdk/AttributesEncoding/types.js.map +1 -0
  164. package/lib/commonjs/sdk/AttributesEncoding/utils.js +36 -0
  165. package/lib/commonjs/sdk/AttributesEncoding/utils.js.map +1 -0
  166. package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
  167. package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
  168. package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +3 -3
  169. package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
  170. package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
  171. package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
  172. package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
  173. package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js +10 -9
  174. package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
  175. package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js +28 -0
  176. package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
  177. package/lib/commonjs/sdk/DdSdk.js +4 -2
  178. package/lib/commonjs/sdk/DdSdk.js.map +1 -1
  179. package/lib/commonjs/sdk/DdSdkInternal.js +86 -0
  180. package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -0
  181. package/lib/commonjs/sdk/EventMappers/EventMapper.js +6 -3
  182. package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
  183. package/lib/commonjs/sdk/GlobalState/GlobalState.js +5 -11
  184. package/lib/commonjs/sdk/GlobalState/GlobalState.js.map +1 -1
  185. package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
  186. package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
  187. package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
  188. package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
  189. package/lib/commonjs/trace/DdTrace.js +7 -5
  190. package/lib/commonjs/trace/DdTrace.js.map +1 -1
  191. package/lib/commonjs/types.js +19 -46
  192. package/lib/commonjs/types.js.map +1 -1
  193. package/lib/commonjs/utils/longTasksUtils.js.map +1 -1
  194. package/lib/commonjs/utils/singletonUtils.js +21 -0
  195. package/lib/commonjs/utils/singletonUtils.js.map +1 -0
  196. package/lib/commonjs/version.js +1 -1
  197. package/lib/commonjs/version.js.map +1 -1
  198. package/lib/module/DdAttributes.js.map +1 -0
  199. package/lib/module/DdSdkReactNative.js +155 -52
  200. package/lib/module/DdSdkReactNative.js.map +1 -1
  201. package/lib/module/InternalLog.js +1 -1
  202. package/lib/module/InternalLog.js.map +1 -1
  203. package/lib/module/config/DatadogProviderConfiguration.js +18 -0
  204. package/lib/module/config/DatadogProviderConfiguration.js.map +1 -0
  205. package/lib/module/config/FileBasedConfiguration.js +341 -0
  206. package/lib/module/config/FileBasedConfiguration.js.map +1 -0
  207. package/lib/module/config/FileBasedConfiguration.type.js +2 -0
  208. package/lib/module/config/FileBasedConfiguration.type.js.map +1 -0
  209. package/lib/module/config/async/AutoInstrumentationConfiguration.js +45 -0
  210. package/lib/module/config/async/AutoInstrumentationConfiguration.js.map +1 -0
  211. package/lib/module/config/async/PartialInitializationConfiguration.js +2 -0
  212. package/lib/module/config/async/PartialInitializationConfiguration.js.map +1 -0
  213. package/lib/module/config/async/asyncInitializationHelper.js +36 -0
  214. package/lib/module/config/async/asyncInitializationHelper.js.map +1 -0
  215. package/lib/module/config/features/CoreConfiguration.js +98 -0
  216. package/lib/module/config/features/CoreConfiguration.js.map +1 -0
  217. package/lib/module/config/features/CoreConfiguration.type.js +2 -0
  218. package/lib/module/config/features/CoreConfiguration.type.js.map +1 -0
  219. package/lib/module/config/features/CoreConfigurationNative.js +31 -0
  220. package/lib/module/config/features/CoreConfigurationNative.js.map +1 -0
  221. package/lib/module/config/features/LogsConfiguration.js +30 -0
  222. package/lib/module/config/features/LogsConfiguration.js.map +1 -0
  223. package/lib/module/config/features/LogsConfiguration.type.js +2 -0
  224. package/lib/module/config/features/LogsConfiguration.type.js.map +1 -0
  225. package/lib/module/config/features/LogsConfigurationNative.js +2 -0
  226. package/lib/module/config/features/LogsConfigurationNative.js.map +1 -0
  227. package/lib/module/config/features/RumConfiguration.js +114 -0
  228. package/lib/module/config/features/RumConfiguration.js.map +1 -0
  229. package/lib/module/config/features/RumConfiguration.type.js +2 -0
  230. package/lib/module/config/features/RumConfiguration.type.js.map +1 -0
  231. package/lib/module/config/features/RumConfigurationNative.js +2 -0
  232. package/lib/module/config/features/RumConfigurationNative.js.map +1 -0
  233. package/lib/module/config/features/TraceConfiguration.js +18 -0
  234. package/lib/module/config/features/TraceConfiguration.js.map +1 -0
  235. package/lib/module/config/features/TraceConfiguration.type.js +2 -0
  236. package/lib/module/config/features/TraceConfiguration.type.js.map +1 -0
  237. package/lib/module/config/features/TraceConfigurationNative.js +2 -0
  238. package/lib/module/config/features/TraceConfigurationNative.js.map +1 -0
  239. package/lib/module/config/types/BatchProcessingLevel.js +25 -0
  240. package/lib/module/config/types/BatchProcessingLevel.js.map +1 -0
  241. package/lib/module/config/types/BatchSize.js +26 -0
  242. package/lib/module/config/types/BatchSize.js.map +1 -0
  243. package/lib/module/config/types/InitializationMode.js +11 -0
  244. package/lib/module/config/types/InitializationMode.js.map +1 -0
  245. package/lib/module/config/types/InitializationModeForTelemetry.js +2 -0
  246. package/lib/module/config/types/InitializationModeForTelemetry.js.map +1 -0
  247. package/lib/module/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
  248. package/lib/module/config/types/ProxyConfiguration.js.map +1 -0
  249. package/lib/module/config/types/SdkVerbosity.js.map +1 -0
  250. package/lib/module/config/types/TrackingConsent.js.map +1 -0
  251. package/lib/module/config/types/UploadFrequency.js +25 -0
  252. package/lib/module/config/types/UploadFrequency.js.map +1 -0
  253. package/lib/module/config/types/VitalsUpdateFrequency.js +13 -0
  254. package/lib/module/config/types/VitalsUpdateFrequency.js.map +1 -0
  255. package/lib/module/config/types/index.js +15 -0
  256. package/lib/module/config/types/index.js.map +1 -0
  257. package/lib/module/index.js +13 -7
  258. package/lib/module/index.js.map +1 -1
  259. package/lib/module/logs/DdLogs.js +13 -9
  260. package/lib/module/logs/DdLogs.js.map +1 -1
  261. package/lib/module/logs/eventMapper.js +4 -1
  262. package/lib/module/logs/eventMapper.js.map +1 -1
  263. package/lib/module/nativeModulesTypes.js +1 -43
  264. package/lib/module/nativeModulesTypes.js.map +1 -1
  265. package/lib/module/rum/DdRum.js +54 -26
  266. package/lib/module/rum/DdRum.js.map +1 -1
  267. package/lib/module/rum/helper.js +49 -0
  268. package/lib/module/rum/helper.js.map +1 -0
  269. package/lib/module/rum/instrumentation/DdRumErrorTracking.js +14 -18
  270. package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  271. package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -24
  272. package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
  273. package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
  274. package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
  275. package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
  276. package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
  277. package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +33 -21
  278. package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
  279. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +22 -1
  280. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
  281. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +13 -2
  282. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
  283. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -11
  284. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
  285. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +2 -0
  286. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
  287. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +27 -33
  288. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
  289. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +54 -0
  290. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
  291. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
  292. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
  293. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js +30 -0
  294. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
  295. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
  296. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
  297. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +14 -3
  298. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
  299. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
  300. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
  301. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
  302. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
  303. package/lib/module/rum/types.js +0 -9
  304. package/lib/module/rum/types.js.map +1 -1
  305. package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js +39 -0
  306. package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
  307. package/lib/module/sdk/AccountInfoSingleton/types.js +2 -0
  308. package/lib/module/sdk/AccountInfoSingleton/types.js.map +1 -0
  309. package/lib/module/sdk/AttributesEncoding/attributesEncoding.js +46 -0
  310. package/lib/module/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
  311. package/lib/module/sdk/AttributesEncoding/defaultEncoders.js +134 -0
  312. package/lib/module/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
  313. package/lib/module/{utils → sdk/AttributesEncoding}/errorUtils.js +37 -20
  314. package/lib/module/sdk/AttributesEncoding/errorUtils.js.map +1 -0
  315. package/lib/module/sdk/AttributesEncoding/helpers.js +115 -0
  316. package/lib/module/sdk/AttributesEncoding/helpers.js.map +1 -0
  317. package/lib/module/sdk/AttributesEncoding/types.js +2 -0
  318. package/lib/module/sdk/AttributesEncoding/types.js.map +1 -0
  319. package/lib/module/sdk/AttributesEncoding/utils.js +28 -0
  320. package/lib/module/sdk/AttributesEncoding/utils.js.map +1 -0
  321. package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
  322. package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
  323. package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +2 -2
  324. package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
  325. package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
  326. package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js.map +1 -1
  327. package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
  328. package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
  329. package/lib/module/sdk/DatadogProvider/DatadogProvider.js +9 -8
  330. package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
  331. package/lib/module/sdk/DatadogProvider/DatadogProviderState.js +21 -0
  332. package/lib/module/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
  333. package/lib/module/sdk/DdSdk.js +4 -4
  334. package/lib/module/sdk/DdSdk.js.map +1 -1
  335. package/lib/module/sdk/DdSdkInternal.js +80 -0
  336. package/lib/module/sdk/DdSdkInternal.js.map +1 -0
  337. package/lib/module/sdk/EventMappers/EventMapper.js +6 -3
  338. package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
  339. package/lib/module/sdk/GlobalState/GlobalState.js +5 -10
  340. package/lib/module/sdk/GlobalState/GlobalState.js.map +1 -1
  341. package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
  342. package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
  343. package/lib/module/specs/NativeDdRum.js.map +1 -1
  344. package/lib/module/specs/NativeDdSdk.js.map +1 -1
  345. package/lib/module/trace/DdTrace.js +7 -6
  346. package/lib/module/trace/DdTrace.js.map +1 -1
  347. package/lib/module/types.js +22 -42
  348. package/lib/module/types.js.map +1 -1
  349. package/lib/module/utils/longTasksUtils.js.map +1 -1
  350. package/lib/module/utils/singletonUtils.js +14 -0
  351. package/lib/module/utils/singletonUtils.js.map +1 -0
  352. package/lib/module/version.js +1 -1
  353. package/lib/module/version.js.map +1 -1
  354. package/lib/typescript/DdAttributes.d.ts.map +1 -0
  355. package/lib/typescript/DdSdkReactNative.d.ts +49 -12
  356. package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
  357. package/lib/typescript/InternalLog.d.ts +1 -1
  358. package/lib/typescript/InternalLog.d.ts.map +1 -1
  359. package/lib/typescript/config/DatadogProviderConfiguration.d.ts +12 -0
  360. package/lib/typescript/config/DatadogProviderConfiguration.d.ts.map +1 -0
  361. package/lib/typescript/config/FileBasedConfiguration.d.ts +17 -0
  362. package/lib/typescript/config/FileBasedConfiguration.d.ts.map +1 -0
  363. package/lib/typescript/config/FileBasedConfiguration.type.d.ts +52 -0
  364. package/lib/typescript/config/FileBasedConfiguration.type.d.ts.map +1 -0
  365. package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts +60 -0
  366. package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -0
  367. package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts +47 -0
  368. package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts.map +1 -0
  369. package/lib/typescript/config/async/asyncInitializationHelper.d.ts +5 -0
  370. package/lib/typescript/config/async/asyncInitializationHelper.d.ts.map +1 -0
  371. package/lib/typescript/config/features/CoreConfiguration.d.ts +52 -0
  372. package/lib/typescript/config/features/CoreConfiguration.d.ts.map +1 -0
  373. package/lib/typescript/config/features/CoreConfiguration.type.d.ts +90 -0
  374. package/lib/typescript/config/features/CoreConfiguration.type.d.ts.map +1 -0
  375. package/lib/typescript/config/features/CoreConfigurationNative.d.ts +54 -0
  376. package/lib/typescript/config/features/CoreConfigurationNative.d.ts.map +1 -0
  377. package/lib/typescript/config/features/LogsConfiguration.d.ts +17 -0
  378. package/lib/typescript/config/features/LogsConfiguration.d.ts.map +1 -0
  379. package/lib/typescript/config/features/LogsConfiguration.type.d.ts +24 -0
  380. package/lib/typescript/config/features/LogsConfiguration.type.d.ts.map +1 -0
  381. package/lib/typescript/config/features/LogsConfigurationNative.d.ts +6 -0
  382. package/lib/typescript/config/features/LogsConfigurationNative.d.ts.map +1 -0
  383. package/lib/typescript/config/features/RumConfiguration.d.ts +66 -0
  384. package/lib/typescript/config/features/RumConfiguration.d.ts.map +1 -0
  385. package/lib/typescript/config/features/RumConfiguration.type.d.ts +131 -0
  386. package/lib/typescript/config/features/RumConfiguration.type.d.ts.map +1 -0
  387. package/lib/typescript/config/features/RumConfigurationNative.d.ts +25 -0
  388. package/lib/typescript/config/features/RumConfigurationNative.d.ts.map +1 -0
  389. package/lib/typescript/config/features/TraceConfiguration.d.ts +10 -0
  390. package/lib/typescript/config/features/TraceConfiguration.d.ts.map +1 -0
  391. package/lib/typescript/config/features/TraceConfiguration.type.d.ts +11 -0
  392. package/lib/typescript/config/features/TraceConfiguration.type.d.ts.map +1 -0
  393. package/lib/typescript/config/features/TraceConfigurationNative.d.ts +4 -0
  394. package/lib/typescript/config/features/TraceConfigurationNative.d.ts.map +1 -0
  395. package/lib/typescript/config/types/BatchProcessingLevel.d.ts +18 -0
  396. package/lib/typescript/config/types/BatchProcessingLevel.d.ts.map +1 -0
  397. package/lib/typescript/config/types/BatchSize.d.ts +19 -0
  398. package/lib/typescript/config/types/BatchSize.d.ts.map +1 -0
  399. package/lib/typescript/config/types/InitializationMode.d.ts +5 -0
  400. package/lib/typescript/config/types/InitializationMode.d.ts.map +1 -0
  401. package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts +2 -0
  402. package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts.map +1 -0
  403. package/lib/typescript/config/types/ProxyConfiguration.d.ts.map +1 -0
  404. package/lib/typescript/config/types/SdkVerbosity.d.ts.map +1 -0
  405. package/lib/typescript/config/types/TrackingConsent.d.ts.map +1 -0
  406. package/lib/typescript/config/types/UploadFrequency.d.ts +18 -0
  407. package/lib/typescript/config/types/UploadFrequency.d.ts.map +1 -0
  408. package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts +7 -0
  409. package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts.map +1 -0
  410. package/lib/typescript/config/types/index.d.ts +10 -0
  411. package/lib/typescript/config/types/index.d.ts.map +1 -0
  412. package/lib/typescript/index.d.ts +20 -9
  413. package/lib/typescript/index.d.ts.map +1 -1
  414. package/lib/typescript/logs/DdLogs.d.ts +2 -1
  415. package/lib/typescript/logs/DdLogs.d.ts.map +1 -1
  416. package/lib/typescript/logs/eventMapper.d.ts +3 -2
  417. package/lib/typescript/logs/eventMapper.d.ts.map +1 -1
  418. package/lib/typescript/logs/types.d.ts +1 -16
  419. package/lib/typescript/logs/types.d.ts.map +1 -1
  420. package/lib/typescript/nativeModulesTypes.d.ts +2 -15
  421. package/lib/typescript/nativeModulesTypes.d.ts.map +1 -1
  422. package/lib/typescript/rum/DdRum.d.ts +10 -1
  423. package/lib/typescript/rum/DdRum.d.ts.map +1 -1
  424. package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +1 -1
  425. package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts.map +1 -1
  426. package/lib/typescript/rum/helper.d.ts +10 -0
  427. package/lib/typescript/rum/helper.d.ts.map +1 -0
  428. package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -1
  429. package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts +6 -6
  430. package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
  431. package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +7 -0
  432. package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -1
  433. package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +12 -6
  434. package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
  435. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +1 -0
  436. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -1
  437. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +8 -0
  438. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -1
  439. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +5 -17
  440. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
  441. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts +20 -0
  442. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts.map +1 -0
  443. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +3 -24
  444. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
  445. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts +12 -0
  446. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts.map +1 -0
  447. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts +24 -0
  448. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts.map +1 -0
  449. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +2 -1
  450. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
  451. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
  452. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -1
  453. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
  454. package/lib/typescript/rum/types.d.ts +47 -7
  455. package/lib/typescript/rum/types.d.ts.map +1 -1
  456. package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts +15 -0
  457. package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -0
  458. package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts +6 -0
  459. package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts.map +1 -0
  460. package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts +13 -0
  461. package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts.map +1 -0
  462. package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts +33 -0
  463. package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -0
  464. package/lib/typescript/{utils → sdk/AttributesEncoding}/errorUtils.d.ts +4 -4
  465. package/lib/typescript/sdk/AttributesEncoding/errorUtils.d.ts.map +1 -0
  466. package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts +17 -0
  467. package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts.map +1 -0
  468. package/lib/typescript/sdk/AttributesEncoding/types.d.ts +21 -0
  469. package/lib/typescript/sdk/AttributesEncoding/types.d.ts.map +1 -0
  470. package/lib/typescript/sdk/AttributesEncoding/utils.d.ts +7 -0
  471. package/lib/typescript/sdk/AttributesEncoding/utils.d.ts.map +1 -0
  472. package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +5 -1
  473. package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -1
  474. package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +4 -3
  475. package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -1
  476. package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts +9 -0
  477. package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts.map +1 -0
  478. package/lib/typescript/sdk/DdSdk.d.ts +2 -3
  479. package/lib/typescript/sdk/DdSdk.d.ts.map +1 -1
  480. package/lib/typescript/sdk/DdSdkInternal.d.ts +39 -0
  481. package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -0
  482. package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +3 -1
  483. package/lib/typescript/sdk/EventMappers/EventMapper.d.ts.map +1 -1
  484. package/lib/typescript/sdk/GlobalState/GlobalState.d.ts +3 -3
  485. package/lib/typescript/sdk/GlobalState/GlobalState.d.ts.map +1 -1
  486. package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +2 -1
  487. package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
  488. package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -2
  489. package/lib/typescript/sdk/UserInfoSingleton/types.d.ts.map +1 -1
  490. package/lib/typescript/specs/NativeDdRum.d.ts +45 -0
  491. package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -1
  492. package/lib/typescript/specs/NativeDdSdk.d.ts +34 -6
  493. package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -1
  494. package/lib/typescript/trace/DdTrace.d.ts +1 -2
  495. package/lib/typescript/trace/DdTrace.d.ts.map +1 -1
  496. package/lib/typescript/types.d.ts +74 -92
  497. package/lib/typescript/types.d.ts.map +1 -1
  498. package/lib/typescript/utils/longTasksUtils.d.ts +1 -1
  499. package/lib/typescript/utils/longTasksUtils.d.ts.map +1 -1
  500. package/lib/typescript/utils/singletonUtils.d.ts +2 -0
  501. package/lib/typescript/utils/singletonUtils.d.ts.map +1 -0
  502. package/lib/typescript/version.d.ts +1 -1
  503. package/lib/typescript/version.d.ts.map +1 -1
  504. package/package.json +2 -2
  505. package/src/DdSdkReactNative.tsx +246 -104
  506. package/src/InternalLog.tsx +1 -1
  507. package/src/__tests__/DdSdkReactNative.test.tsx +415 -207
  508. package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +237 -153
  509. package/src/__tests__/InternalLog.test.tsx +1 -1
  510. package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +2 -2
  511. package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +139 -216
  512. package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +10 -7
  513. package/src/config/DatadogProviderConfiguration.ts +17 -0
  514. package/src/config/FileBasedConfiguration.ts +464 -0
  515. package/src/config/FileBasedConfiguration.type.ts +66 -0
  516. package/src/config/__tests__/FileBasedConfiguration.test.ts +334 -0
  517. package/src/config/__tests__/__fixtures__/configuration-all-fields.json +57 -0
  518. package/src/config/__tests__/__fixtures__/malformed-configuration.json +4 -0
  519. package/src/config/async/AutoInstrumentationConfiguration.ts +126 -0
  520. package/src/config/async/PartialInitializationConfiguration.ts +58 -0
  521. package/src/config/async/asyncInitializationHelper.tsx +51 -0
  522. package/src/config/features/CoreConfiguration.ts +130 -0
  523. package/src/config/features/CoreConfiguration.type.ts +119 -0
  524. package/src/config/features/CoreConfigurationNative.ts +50 -0
  525. package/src/config/features/LogsConfiguration.ts +38 -0
  526. package/src/config/features/LogsConfiguration.type.ts +33 -0
  527. package/src/config/features/LogsConfigurationNative.ts +10 -0
  528. package/src/config/features/RumConfiguration.ts +137 -0
  529. package/src/config/features/RumConfiguration.type.ts +164 -0
  530. package/src/config/features/RumConfigurationNative.ts +26 -0
  531. package/src/config/features/TraceConfiguration.ts +24 -0
  532. package/src/config/features/TraceConfiguration.type.ts +17 -0
  533. package/src/config/features/TraceConfigurationNative.ts +8 -0
  534. package/src/config/types/BatchProcessingLevel.ts +23 -0
  535. package/src/config/types/BatchSize.ts +24 -0
  536. package/src/config/types/InitializationMode.ts +9 -0
  537. package/src/config/types/InitializationModeForTelemetry.ts +11 -0
  538. package/src/{ProxyConfiguration.tsx → config/types/ProxyConfiguration.ts} +6 -0
  539. package/src/config/types/UploadFrequency.tsx +23 -0
  540. package/src/config/types/VitalsUpdateFrequency.ts +11 -0
  541. package/src/config/types/index.ts +15 -0
  542. package/src/index.tsx +33 -16
  543. package/src/logs/DdLogs.ts +14 -13
  544. package/src/logs/__tests__/DdLogs.test.ts +60 -107
  545. package/src/logs/__tests__/eventMapper.test.ts +1 -1
  546. package/src/logs/eventMapper.ts +5 -4
  547. package/src/logs/types.ts +1 -20
  548. package/src/nativeModulesTypes.ts +2 -17
  549. package/src/rum/DdRum.ts +139 -42
  550. package/src/rum/__tests__/DdRum.test.ts +217 -47
  551. package/src/rum/eventMappers/errorEventMapper.ts +1 -1
  552. package/src/rum/helper.ts +62 -0
  553. package/src/rum/instrumentation/DdRumErrorTracking.tsx +20 -38
  554. package/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts +20 -32
  555. package/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.tsx +1 -1
  556. package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +18 -5
  557. package/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx +44 -23
  558. package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +2 -2
  559. package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +44 -23
  560. package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts +24 -1
  561. package/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.tsx +17 -2
  562. package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/distributedTracing.test.ts +327 -1
  563. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.tsx +22 -31
  564. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.ts +29 -0
  565. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.ts +54 -35
  566. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.ts +80 -0
  567. package/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.ts +1 -1
  568. package/src/rum/instrumentation/resourceTracking/distributedTracing/headers.ts +29 -0
  569. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.ts +1 -1
  570. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +19 -7
  571. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +177 -119
  572. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/baggageHeaderUtils.test.ts +85 -13
  573. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.ts +110 -52
  574. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.ts +1 -1
  575. package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +1 -1
  576. package/src/rum/types.ts +68 -8
  577. package/src/sdk/AccountInfoSingleton/AccountInfoSingleton.ts +49 -0
  578. package/src/sdk/AccountInfoSingleton/__tests__/AccountInfoSingleton.test.ts +90 -0
  579. package/src/sdk/AccountInfoSingleton/types.ts +11 -0
  580. package/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts +518 -0
  581. package/src/sdk/AttributesEncoding/__tests__/defaultEncoders.test.ts +198 -0
  582. package/src/sdk/AttributesEncoding/attributesEncoding.ts +56 -0
  583. package/src/sdk/AttributesEncoding/defaultEncoders.ts +175 -0
  584. package/src/{utils → sdk/AttributesEncoding}/errorUtils.ts +50 -22
  585. package/src/sdk/AttributesEncoding/helpers.ts +176 -0
  586. package/src/sdk/AttributesEncoding/types.ts +33 -0
  587. package/src/sdk/AttributesEncoding/utils.ts +31 -0
  588. package/src/sdk/AttributesSingleton/AttributesSingleton.ts +25 -1
  589. package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +52 -8
  590. package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.tsx +2 -2
  591. package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.tsx +1 -1
  592. package/src/sdk/DatadogInternalBridge/__tests__/DdSdkNativeBridge.test.tsx +1 -1
  593. package/src/sdk/DatadogProvider/Buffer/BoundedBuffer.ts +4 -4
  594. package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
  595. package/src/sdk/DatadogProvider/DatadogProvider.tsx +12 -16
  596. package/src/sdk/DatadogProvider/DatadogProviderState.ts +30 -0
  597. package/src/sdk/DatadogProvider/__tests__/__utils__/renderWithProvider.tsx +18 -7
  598. package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +59 -33
  599. package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +26 -10
  600. package/src/sdk/DdSdk.ts +8 -5
  601. package/src/sdk/DdSdkInternal.ts +121 -0
  602. package/src/sdk/EventMappers/EventMapper.ts +9 -4
  603. package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +3 -3
  604. package/src/sdk/GlobalState/GlobalState.tsx +10 -11
  605. package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +9 -2
  606. package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +46 -9
  607. package/src/sdk/UserInfoSingleton/types.ts +1 -4
  608. package/src/specs/NativeDdRum.ts +65 -0
  609. package/src/specs/NativeDdSdk.ts +40 -6
  610. package/src/trace/DdTrace.ts +11 -7
  611. package/src/trace/__tests__/DdTrace.test.ts +7 -8
  612. package/src/types.tsx +97 -76
  613. package/src/utils/__tests__/errorUtils.test.ts +1 -1
  614. package/src/utils/__tests__/singletonUtils.test.ts +75 -0
  615. package/src/utils/longTasksUtils.ts +1 -3
  616. package/src/utils/singletonUtils.ts +17 -0
  617. package/src/version.ts +1 -1
  618. package/lib/commonjs/DdSdkReactNativeConfiguration.js +0 -412
  619. package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +0 -1
  620. package/lib/commonjs/ProxyConfiguration.js.map +0 -1
  621. package/lib/commonjs/SdkVerbosity.js.map +0 -1
  622. package/lib/commonjs/TrackingConsent.js.map +0 -1
  623. package/lib/commonjs/rum/DdAttributes.js.map +0 -1
  624. package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -185
  625. package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
  626. package/lib/commonjs/utils/argsUtils.js +0 -41
  627. package/lib/commonjs/utils/argsUtils.js.map +0 -1
  628. package/lib/commonjs/utils/errorUtils.js.map +0 -1
  629. package/lib/module/DdSdkReactNativeConfiguration.js +0 -403
  630. package/lib/module/DdSdkReactNativeConfiguration.js.map +0 -1
  631. package/lib/module/ProxyConfiguration.js.map +0 -1
  632. package/lib/module/SdkVerbosity.js.map +0 -1
  633. package/lib/module/TrackingConsent.js.map +0 -1
  634. package/lib/module/rum/DdAttributes.js.map +0 -1
  635. package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -176
  636. package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
  637. package/lib/module/utils/argsUtils.js +0 -35
  638. package/lib/module/utils/argsUtils.js.map +0 -1
  639. package/lib/module/utils/errorUtils.js.map +0 -1
  640. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +0 -376
  641. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +0 -1
  642. package/lib/typescript/ProxyConfiguration.d.ts.map +0 -1
  643. package/lib/typescript/SdkVerbosity.d.ts.map +0 -1
  644. package/lib/typescript/TrackingConsent.d.ts.map +0 -1
  645. package/lib/typescript/rum/DdAttributes.d.ts.map +0 -1
  646. package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +0 -34
  647. package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +0 -1
  648. package/lib/typescript/utils/argsUtils.d.ts +0 -8
  649. package/lib/typescript/utils/argsUtils.d.ts.map +0 -1
  650. package/lib/typescript/utils/errorUtils.d.ts.map +0 -1
  651. package/src/DdSdkReactNativeConfiguration.tsx +0 -582
  652. package/src/sdk/FileBasedConfiguration/FileBasedConfiguration.ts +0 -241
  653. package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +0 -255
  654. package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/configuration-all-fields.json +0 -27
  655. package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/malformed-configuration.json +0 -5
  656. package/src/utils/__tests__/argsUtils.test.ts +0 -66
  657. package/src/utils/argsUtils.ts +0 -41
  658. /package/lib/commonjs/{rum/DdAttributes.js → DdAttributes.js} +0 -0
  659. /package/lib/commonjs/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
  660. /package/lib/commonjs/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
  661. /package/lib/module/{rum/DdAttributes.js → DdAttributes.js} +0 -0
  662. /package/lib/module/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
  663. /package/lib/module/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
  664. /package/lib/typescript/{rum/DdAttributes.d.ts → DdAttributes.d.ts} +0 -0
  665. /package/lib/typescript/{ProxyConfiguration.d.ts → config/types/ProxyConfiguration.d.ts} +0 -0
  666. /package/lib/typescript/{SdkVerbosity.d.ts → config/types/SdkVerbosity.d.ts} +0 -0
  667. /package/lib/typescript/{TrackingConsent.d.ts → config/types/TrackingConsent.d.ts} +0 -0
  668. /package/src/{rum/DdAttributes.ts → DdAttributes.ts} +0 -0
  669. /package/src/{SdkVerbosity.tsx → config/types/SdkVerbosity.ts} +0 -0
  670. /package/src/{TrackingConsent.tsx → config/types/TrackingConsent.ts} +0 -0
@@ -19,14 +19,14 @@ Pod::Spec.new do |s|
19
19
  s.dependency "React-Core"
20
20
 
21
21
  # /!\ Remember to keep the versions in sync with DatadogSDKReactNativeSessionReplay.podspec
22
- s.dependency 'DatadogCore', '2.30.2'
23
- s.dependency 'DatadogLogs', '2.30.2'
24
- s.dependency 'DatadogTrace', '2.30.2'
25
- s.dependency 'DatadogRUM', '2.30.2'
26
- s.dependency 'DatadogCrashReporting', '2.30.2'
22
+ s.dependency 'DatadogCore', '3.4.0'
23
+ s.dependency 'DatadogLogs', '3.4.0'
24
+ s.dependency 'DatadogTrace', '3.4.0'
25
+ s.dependency 'DatadogRUM', '3.4.0'
26
+ s.dependency 'DatadogCrashReporting', '3.4.0'
27
27
 
28
28
  # DatadogWebViewTracking is not available for tvOS
29
- s.ios.dependency 'DatadogWebViewTracking', '2.30.2'
29
+ s.ios.dependency 'DatadogWebViewTracking', '3.4.0'
30
30
 
31
31
  s.test_spec 'Tests' do |test_spec|
32
32
  test_spec.source_files = 'ios/Tests/**/*.{swift,json}'
package/README.md CHANGED
@@ -41,23 +41,33 @@ import {
41
41
  const datadogConfiguration = new DatadogProviderConfiguration(
42
42
  '<CLIENT_TOKEN>',
43
43
  '<ENVIRONMENT_NAME>',
44
- '<RUM_APPLICATION_ID>',
45
- true, // track User interactions (e.g.: Tap on buttons. You can use 'accessibilityLabel' element property to give tap action the name, otherwise element type will be reported)
46
- true, // track XHR Resources
47
- true // track Errors
44
+ TrackingConsent.GRANTED,
45
+ {
46
+ rumConfiguration: {
47
+ applicationId: '<RUM_APPLICATION_ID>',
48
+ trackInteractions: true, // track User interactions (e.g.: Tap on buttons. You can use 'accessibilityLabel' element property to give tap action the name, otherwise element type will be reported)
49
+ trackResources: true, // track XHR Resources
50
+ trackFrustrations: true, // track Frustrations
51
+ trackErrors: true, // track errors
52
+ nativeCrashReportEnabled: true, // Optional: enable or disable native crash reports
53
+ sessionSampleRate: 80, // Optional: sample RUM sessions (here, 80% of session will be sent to Datadog. Default = 100%)
54
+ resourceTracingSamplingRate: 80, // Optional: sample tracing integrations for network calls between your app and your backend (here, 80% of calls to your instrumented backend will be linked from the RUM view to the APM view. Default = 20%)
55
+ // You need to specify the hosts of your backends to enable tracing with these backends
56
+ firstPartyHosts: ['example.com'], // matches 'example.com' and subdomains like 'api.example.com'
57
+ },
58
+ logsConfiguration: {
59
+ logEventMapper: (logEvent) => {
60
+ logEvent.message = `[CUSTOM] ${logEvent.message}`;
61
+ return logEvent;
62
+ }
63
+ },
64
+ traceConfiguration: {}
65
+ }
48
66
  );
49
67
  // Optional: Select your Datadog website (one of "US1", "US3", "US5", "EU1", "AP1", "AP2", or "US1_FED"). Default is "US1".
50
68
  datadogConfiguration.site = 'US1';
51
- // Optional: enable or disable native crash reports
52
- datadogConfiguration.nativeCrashReportEnabled = true;
53
- // Optional: sample RUM sessions (here, 80% of session will be sent to Datadog. Default = 100%)
54
- datadogConfiguration.sessionSamplingRate = 80;
55
- // Optional: sample tracing integrations for network calls between your app and your backend (here, 80% of calls to your instrumented backend will be linked from the RUM view to the APM view. Default = 20%)
56
- // You need to specify the hosts of your backends to enable tracing with these backends
57
- datadogConfiguration.resourceTracingSamplingRate = 80;
58
- datadogConfiguration.firstPartyHosts = ['example.com']; // matches 'example.com' and subdomains like 'api.example.com'
59
69
  // Optional: set the reported service name (by default, it'll use the package name / bundleIdentifier of your Android / iOS app respectively)
60
- datadogConfiguration.serviceName = 'com.example.reactnative';
70
+ datadogConfiguration.service = 'com.example.reactnative';
61
71
  // Optional: let the SDK print internal logs (above or equal to the provided level. Default = undefined (meaning no logs))
62
72
  datadogConfiguration.verbosity = SdkVerbosity.WARN;
63
73
 
@@ -195,22 +195,21 @@ dependencies {
195
195
  }
196
196
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
197
197
  compileOnly "com.squareup.okhttp3:okhttp:3.12.13"
198
-
199
- // dd-sdk-android-rum requires androidx.metrics:metrics-performance.
200
- // From 2.21.0, it uses 1.0.0-beta02, which requires Gradle 8.6.0.
201
- // This breaks builds if the React Native target is below 0.76.0. as it relies on Gradle 8.5.0.
202
- // To avoid this, we enforce 1.0.0-beta01 on RN < 0.76.0
203
- if (reactNativeMinorVersion < 76) {
204
- implementation("com.datadoghq:dd-sdk-android-rum:2.26.2") {
198
+ // dd-sdk-android-rum requires androidx.metrics:metrics-performance.
199
+ // From 2.21.0, it uses 1.0.0-beta02, which requires Gradle 8.6.0.
200
+ // This breaks builds if the React Native target is below 0.76.0. as it relies on Gradle 8.5.0.
201
+ // To avoid this, we enforce 1.0.0-beta01 on RN < 0.76.0
202
+ if (reactNativeMinorVersion < 76) {
203
+ implementation("com.datadoghq:dd-sdk-android-rum:3.4.0") {
205
204
  exclude group: "androidx.metrics", module: "metrics-performance"
206
205
  }
207
206
  implementation "androidx.metrics:metrics-performance:1.0.0-beta01"
208
207
  } else {
209
- implementation "com.datadoghq:dd-sdk-android-rum:2.26.2"
208
+ implementation "com.datadoghq:dd-sdk-android-rum:3.4.0"
210
209
  }
211
- implementation "com.datadoghq:dd-sdk-android-logs:2.26.2"
212
- implementation "com.datadoghq:dd-sdk-android-trace:2.26.2"
213
- implementation "com.datadoghq:dd-sdk-android-webview:2.26.2"
210
+ implementation "com.datadoghq:dd-sdk-android-logs:3.4.0"
211
+ implementation "com.datadoghq:dd-sdk-android-trace:3.4.0"
212
+ implementation "com.datadoghq:dd-sdk-android-webview:3.4.0"
214
213
  implementation "com.google.code.gson:gson:2.10.0"
215
214
  testImplementation "org.junit.platform:junit-platform-launcher:1.6.2"
216
215
  testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.2"
@@ -1,5 +1,5 @@
1
1
  DdSdkReactNative_kotlinVersion=1.8.21
2
- DdSdkReactNative_minSdkVersion=21
2
+ DdSdkReactNative_minSdkVersion=23
3
3
  DdSdkReactNative_compileSdkVersion=33
4
4
  DdSdkReactNative_buildToolsVersion=33.0.0
5
5
  DdSdkReactNative_targetSdkVersion=33
@@ -8,23 +8,14 @@
8
8
  package com.datadog.reactnative
9
9
 
10
10
  import android.content.Context
11
- import android.util.Log
12
11
  import com.datadog.android.Datadog
13
- import com.datadog.android._InternalProxy
14
12
  import com.datadog.android.api.InternalLogger
15
- import com.datadog.android.api.SdkCore
16
13
  import com.datadog.android.api.feature.FeatureSdkCore
17
14
  import com.datadog.android.core.InternalSdkCore
18
15
  import com.datadog.android.core.configuration.Configuration
19
- import com.datadog.android.log.Logs
20
- import com.datadog.android.log.LogsConfiguration
21
16
  import com.datadog.android.privacy.TrackingConsent
22
17
  import com.datadog.android.rum.GlobalRumMonitor
23
- import com.datadog.android.rum.Rum
24
- import com.datadog.android.rum.RumConfiguration
25
18
  import com.datadog.android.rum.RumMonitor
26
- import com.datadog.android.trace.Trace
27
- import com.datadog.android.trace.TraceConfiguration
28
19
  import com.datadog.android.webview.WebViewTracking
29
20
  import com.facebook.react.bridge.ReadableMap
30
21
 
@@ -50,50 +41,18 @@ object DatadogSDKWrapperStorage {
50
41
  listener(ddCore)
51
42
  }
52
43
  }
53
-
54
- /**
55
- * Sets instance of core SDK to be used to initialize features.
56
- */
57
- fun setSdkCore(core: InternalSdkCore?) {
58
- this.core = core
59
- }
60
-
61
- /**
62
- * Returns the core set by setSdkCore or the default core instance by default.
63
- */
64
- fun getSdkCore(): SdkCore {
65
- core?.let {
66
- return it
67
- }
68
- Log.d(
69
- DatadogSDKWrapperStorage::class.java.canonicalName,
70
- "SdkCore was not set in DatadogSDKWrapperStorage, using default instance."
71
- )
72
- return Datadog.getInstance()
73
- }
74
44
  }
75
45
 
76
46
  internal class DatadogSDKWrapper : DatadogWrapper {
77
47
  override var bundleLogsWithRum = DefaultConfiguration.bundleLogsWithRum
78
48
  override var bundleLogsWithTraces = DefaultConfiguration.bundleLogsWithTraces
79
49
 
80
- // We use Kotlin backing field here to initialize once the telemetry proxy
81
- // and make sure it is only after SDK is initialized.
82
- private var telemetryProxy: _InternalProxy._TelemetryProxy? = null
83
- get() {
84
- if (field == null && isInitialized()) {
85
- field = Datadog._internalProxy()._telemetry
86
- }
87
-
88
- return field
89
- }
90
-
91
50
  // We use Kotlin backing field here to initialize once the telemetry proxy
92
51
  // and make sure it is only after SDK is initialized.
93
52
  private var webViewProxy: WebViewTracking._InternalWebViewProxy? = null
94
53
  get() {
95
54
  if (field == null && isInitialized()) {
96
- field = WebViewTracking._InternalWebViewProxy(DatadogSDKWrapperStorage.getSdkCore())
55
+ field = WebViewTracking._InternalWebViewProxy(Datadog.getInstance())
97
56
  }
98
57
 
99
58
  return field
@@ -109,30 +68,7 @@ internal class DatadogSDKWrapper : DatadogWrapper {
109
68
  consent: TrackingConsent
110
69
  ) {
111
70
  val core = Datadog.initialize(context, configuration, consent)
112
- DatadogSDKWrapperStorage.setSdkCore(core as InternalSdkCore)
113
- DatadogSDKWrapperStorage.notifyOnInitializedListeners(core)
114
- }
115
-
116
- override fun enableRum(configuration: RumConfiguration) {
117
- Rum.enable(configuration, DatadogSDKWrapperStorage.getSdkCore())
118
- }
119
-
120
- override fun enableLogs(configuration: LogsConfiguration) {
121
- Logs.enable(configuration, DatadogSDKWrapperStorage.getSdkCore())
122
- }
123
-
124
- override fun enableTrace(configuration: TraceConfiguration) {
125
- Trace.enable(configuration, DatadogSDKWrapperStorage.getSdkCore())
126
- }
127
-
128
- @Deprecated("Use setUserInfo instead; the user ID is now required.")
129
- override fun setUser(
130
- id: String?,
131
- name: String?,
132
- email: String?,
133
- extraInfo: Map<String, Any?>
134
- ) {
135
- Datadog.setUserInfo(id, name, email, extraInfo)
71
+ DatadogSDKWrapperStorage.notifyOnInitializedListeners(core as InternalSdkCore)
136
72
  }
137
73
 
138
74
  override fun setUserInfo(
@@ -150,43 +86,50 @@ internal class DatadogSDKWrapper : DatadogWrapper {
150
86
  Datadog.addUserProperties(extraInfo)
151
87
  }
152
88
 
153
- override fun addRumGlobalAttributes(attributes: Map<String, Any?>) {
154
- val rumMonitor = this.getRumMonitor()
155
- for (attribute in attributes) {
156
- rumMonitor.addAttribute(attribute.key, attribute.value)
157
- }
89
+ override fun clearUserInfo() {
90
+ Datadog.clearUserInfo()
158
91
  }
159
92
 
160
- override fun setTrackingConsent(trackingConsent: TrackingConsent) {
161
- Datadog.setTrackingConsent(trackingConsent)
93
+ override fun setAccountInfo(
94
+ id: String,
95
+ name: String?,
96
+ extraInfo: Map<String, Any?>
97
+ ) {
98
+ Datadog.setAccountInfo(id, name, extraInfo)
162
99
  }
163
100
 
164
- override fun sendTelemetryLog(message: String, attributes: ReadableMap, config: ReadableMap) {
165
- val core = DatadogSDKWrapperStorage.getSdkCore() as FeatureSdkCore?
166
- val logger = core?.internalLogger;
101
+ override fun addAccountExtraInfo(
102
+ extraInfo: Map<String, Any?>
103
+ ) {
104
+ Datadog.addAccountExtraInfo(extraInfo)
105
+ }
167
106
 
168
- val additionalProperties = attributes.toMap()
169
- val telemetryConfig = config.toMap()
107
+ override fun clearAccountInfo() {
108
+ Datadog.clearAccountInfo()
109
+ }
170
110
 
171
- logger?.log(
172
- level = InternalLogger.Level.INFO,
173
- target = InternalLogger.Target.TELEMETRY,
174
- messageBuilder = { message },
175
- onlyOnce = (telemetryConfig["onlyOnce"] as? Boolean) ?: true,
176
- additionalProperties = additionalProperties
177
- )
111
+ override fun addRumGlobalAttribute(key: String, value: Any?) {
112
+ this.getRumMonitor().addAttribute(key, value)
178
113
  }
179
114
 
180
- override fun telemetryDebug(message: String) {
181
- telemetryProxy?.debug(message)
115
+ override fun removeRumGlobalAttribute(key: String) {
116
+ this.getRumMonitor().removeAttribute(key)
182
117
  }
183
118
 
184
- override fun telemetryError(message: String, stack: String?, kind: String?) {
185
- telemetryProxy?.error(message, stack, kind)
119
+ override fun addRumGlobalAttributes(attributes: Map<String, Any?>) {
120
+ for (attribute in attributes) {
121
+ this.addRumGlobalAttribute(attribute.key, attribute.value)
122
+ }
123
+ }
124
+
125
+ override fun removeRumGlobalAttributes(keys: Array<String>) {
126
+ for (key in keys) {
127
+ this.removeRumGlobalAttribute(key)
128
+ }
186
129
  }
187
130
 
188
- override fun telemetryError(message: String, throwable: Throwable?) {
189
- telemetryProxy?.error(message, throwable)
131
+ override fun setTrackingConsent(trackingConsent: TrackingConsent) {
132
+ Datadog.setTrackingConsent(trackingConsent)
190
133
  }
191
134
 
192
135
  override fun consumeWebviewEvent(message: String) {
@@ -198,11 +141,11 @@ internal class DatadogSDKWrapper : DatadogWrapper {
198
141
  }
199
142
 
200
143
  override fun getRumMonitor(): RumMonitor {
201
- return GlobalRumMonitor.get(DatadogSDKWrapperStorage.getSdkCore())
144
+ return GlobalRumMonitor.get(Datadog.getInstance())
202
145
  }
203
146
 
204
147
  override fun clearAllData() {
205
- return Datadog.clearAllData(DatadogSDKWrapperStorage.getSdkCore())
148
+ return Datadog.clearAllData(Datadog.getInstance())
206
149
  }
207
150
  }
208
151
 
@@ -18,7 +18,7 @@ import com.facebook.react.bridge.ReadableMap
18
18
  import java.lang.IllegalArgumentException
19
19
 
20
20
  /**
21
- * Wrapper around [Datadog].
21
+ * Wrapper around [com.datadog.android.Datadog].
22
22
  */
23
23
  @Suppress("ComplexInterface", "TooManyFunctions")
24
24
  interface DatadogWrapper {
@@ -49,10 +49,8 @@ interface DatadogWrapper {
49
49
  /**
50
50
  * Initializes the Datadog SDK.
51
51
  * @param context your application context
52
- * @param credentials your organization credentials
53
52
  * @param configuration the configuration for the SDK library
54
- * @param trackingConsent as the initial state of the tracking consent flag.
55
- * @see [Credentials]
53
+ * @param consent as the initial state of the tracking consent flag.
56
54
  * @see [Configuration]
57
55
  * @see [TrackingConsent]
58
56
  * @throws IllegalArgumentException if the env name is using illegal characters and your
@@ -64,45 +62,17 @@ interface DatadogWrapper {
64
62
  consent: TrackingConsent
65
63
  )
66
64
 
67
- /**
68
- * Enables the RUM feature of the SDK.
69
- *
70
- * @param configuration the configuration for the RUM feature
71
- */
72
- fun enableRum(
73
- configuration: RumConfiguration
74
- )
75
-
76
- /**
77
- * Enables the Logs feature of the SDK.
78
- *
79
- * @param configuration the configuration for the Logs feature
80
- */
81
- fun enableLogs(
82
- configuration: LogsConfiguration
83
- )
84
-
85
- /**
86
- * Enables the Trace feature of the SDK.
87
- *
88
- * @param configuration the configuration for the Trace feature
89
- */
90
- fun enableTrace(
91
- configuration: TraceConfiguration
92
- )
93
-
94
65
  /**
95
66
  * Sets the user information.
96
67
  *
97
- * @param id (nullable) a unique user identifier (relevant to your business domain)
68
+ * @param id a unique user identifier (relevant to your business domain)
98
69
  * @param name (nullable) the user name or alias
99
70
  * @param email (nullable) the user email
100
71
  * @param extraInfo additional information. An extra information can be
101
72
  * nested up to 8 levels deep. Keys using more than 8 levels will be sanitized by SDK.
102
73
  */
103
- @Deprecated("Use setUserInfo instead; the user ID is now required.")
104
- fun setUser(
105
- id: String?,
74
+ fun setUserInfo(
75
+ id: String,
106
76
  name: String?,
107
77
  email: String?,
108
78
  extraInfo: Map<String, Any?>
@@ -110,60 +80,77 @@ interface DatadogWrapper {
110
80
 
111
81
  /**
112
82
  * Sets the user information.
83
+ * @param extraInfo: The additional information. (To set the id, name or email please user setUserInfo).
84
+ */
85
+ fun addUserExtraInfo(
86
+ extraInfo: Map<String, Any?>
87
+ )
88
+
89
+ /**
90
+ * Clears the user information.
91
+ */
92
+ fun clearUserInfo()
93
+
94
+ /**
95
+ * Sets the account information.
113
96
  *
114
- * @param id a unique user identifier (relevant to your business domain)
115
- * @param name (nullable) the user name or alias
116
- * @param email (nullable) the user email
97
+ * @param id a unique account identifier (relevant to your business domain)
98
+ * @param name (nullable) the account name
117
99
  * @param extraInfo additional information. An extra information can be
118
100
  * nested up to 8 levels deep. Keys using more than 8 levels will be sanitized by SDK.
119
101
  */
120
- fun setUserInfo(
102
+ fun setAccountInfo(
121
103
  id: String,
122
104
  name: String?,
123
- email: String?,
124
105
  extraInfo: Map<String, Any?>
125
106
  )
126
107
 
127
108
  /**
128
- * Sets the user information.
129
- * @param extraUserInfo: The additional information. (To set the id, name or email please user setUserInfo).
109
+ * Sets the account information.
110
+ * @param extraInfo: The additional information. (To set the id or name please use setAccountInfo).
130
111
  */
131
- fun addUserExtraInfo(
112
+ fun addAccountExtraInfo(
132
113
  extraInfo: Map<String, Any?>
133
114
  )
134
115
 
135
116
  /**
136
- * Adds global attributes.
137
- *
138
- * @param attributes Attributes to add
117
+ * Clears the account information.
139
118
  */
140
- fun addRumGlobalAttributes(attributes: Map<String, Any?>)
119
+ fun clearAccountInfo()
141
120
 
142
- /**
143
- * Sets tracking consent.
144
- */
145
- fun setTrackingConsent(trackingConsent: TrackingConsent)
146
121
 
122
+ /** Adds a global attribute.
123
+ *
124
+ * @param key: Key that identifies the attribute.
125
+ * @param value: Value linked to the attribute.
126
+ */
127
+ fun addRumGlobalAttribute(key: String, value: Any?)
147
128
 
148
129
  /**
149
- * Sends telemetry event with attributes.
130
+ * Removes a global attribute.
131
+ *
132
+ * @param key: Key that identifies the attribute.
150
133
  */
151
- fun sendTelemetryLog(message: String, attributes: ReadableMap, config: ReadableMap)
134
+ fun removeRumGlobalAttribute(key: String)
152
135
 
153
136
  /**
154
- * Sends telemetry debug event.
137
+ * Adds global attributes.
138
+ *
139
+ * @param attributes Attributes to add
155
140
  */
156
- fun telemetryDebug(message: String)
141
+ fun addRumGlobalAttributes(attributes: Map<String, Any?>)
157
142
 
158
143
  /**
159
- * Sends telemetry error.
144
+ * Removes global attributes.
145
+ *
146
+ * @param keys Keys linked to the attributes to be removed
160
147
  */
161
- fun telemetryError(message: String, stack: String?, kind: String?)
148
+ fun removeRumGlobalAttributes(keys: Array<String>)
162
149
 
163
150
  /**
164
- * Sends telemetry error.
151
+ * Sets tracking consent.
165
152
  */
166
- fun telemetryError(message: String, throwable: Throwable?)
153
+ fun setTrackingConsent(trackingConsent: TrackingConsent)
167
154
 
168
155
  /**
169
156
  * Sends Webview events.
@@ -7,6 +7,7 @@
7
7
  package com.datadog.reactnative
8
8
 
9
9
  import android.util.Log as AndroidLog
10
+ import com.datadog.android.Datadog
10
11
  import com.datadog.android.log.Logger
11
12
  import com.facebook.react.bridge.Promise
12
13
  import com.facebook.react.bridge.ReadableMap
@@ -22,7 +23,7 @@ class DdLogsImplementation(
22
23
  val bundleLogsWithRum = datadog.bundleLogsWithRum
23
24
  val bundleLogsWithTraces = datadog.bundleLogsWithTraces
24
25
 
25
- logger ?: Logger.Builder(DatadogSDKWrapperStorage.getSdkCore())
26
+ logger ?: Logger.Builder(Datadog.getInstance())
26
27
  .setLogcatLogsEnabled(true)
27
28
  .setBundleWithRumEnabled(bundleLogsWithRum)
28
29
  .setBundleWithTraceEnabled(bundleLogsWithTraces)
@@ -12,7 +12,9 @@ import com.datadog.android.rum.RumAttributes
12
12
  import com.datadog.android.rum.RumErrorSource
13
13
  import com.datadog.android.rum.RumResourceKind
14
14
  import com.datadog.android.rum.RumResourceMethod
15
+ import com.datadog.android.rum.featureoperations.FailureReason
15
16
  import com.facebook.react.bridge.Promise
17
+ import com.facebook.react.bridge.ReadableArray
16
18
  import com.facebook.react.bridge.ReadableMap
17
19
  import java.util.Locale
18
20
 
@@ -248,6 +250,49 @@ class DdRumImplementation(private val datadog: DatadogWrapper = DatadogSDKWrappe
248
250
  promise.resolve(null)
249
251
  }
250
252
 
253
+ /**
254
+ * Adds a custom attribute to the active RUM View. It will be propagated to all future RUM events associated with the active View.
255
+ * @param key: key for this view attribute.
256
+ * @param value: value for this attribute.
257
+ */
258
+ fun addViewAttribute(key: String, value: ReadableMap, promise: Promise) {
259
+ val attributeValue = value.toMap()["value"]
260
+ val attributes = mutableMapOf<String, Any?>()
261
+ attributes[key] = attributeValue
262
+ datadog.getRumMonitor().addViewAttributes(attributes)
263
+ promise.resolve(null)
264
+ }
265
+
266
+ /**
267
+ * Removes an attribute from the active RUM View.
268
+ * @param key: key for the attribute to be removed from the view.
269
+ */
270
+ fun removeViewAttribute(key: String, promise: Promise) {
271
+ val keysToDelete: Collection<String> = listOf(key)
272
+ datadog.getRumMonitor().removeViewAttributes(keysToDelete)
273
+ promise.resolve(null)
274
+ }
275
+
276
+ /**
277
+ * Adds multiple attributes to the active RUM View. They will be propagated to all future RUM events associated with the active View.
278
+ * @param attributes: key/value object containing all attributes to be added to the view.
279
+ */
280
+ fun addViewAttributes(attributes: ReadableMap, promise: Promise) {
281
+ datadog.getRumMonitor().addViewAttributes(attributes.toMap())
282
+ promise.resolve(null)
283
+ }
284
+
285
+ /**
286
+ * Removes multiple attributes from the active RUM View.
287
+ * @param keys: keys for the attributes to be removed from the view.
288
+ */
289
+ fun removeViewAttributes(keys: ReadableArray, promise: Promise) {
290
+ val keysToDelete = (0 until keys.size())
291
+ .mapNotNull { keys.getString(it) }
292
+ datadog.getRumMonitor().removeViewAttributes(keysToDelete)
293
+ promise.resolve(null)
294
+ }
295
+
251
296
  /**
252
297
  * Adds the loading time of the view to the active view.
253
298
  * It is calculated as the difference between the current time and the start time of the view.
@@ -289,6 +334,59 @@ class DdRumImplementation(private val datadog: DatadogWrapper = DatadogSDKWrappe
289
334
  }
290
335
  }
291
336
 
337
+ /**
338
+ * Starts a Feature Operation.
339
+ *
340
+ * @param name Human-readable operation name (e.g., "login_flow").
341
+ * @param operationKey Optional key that uniquely identifies this operation instance.
342
+ * @param attributes Additional attributes to attach to the operation.
343
+ * @param promise Resolved with `null` when the call completes.
344
+ */
345
+ fun startFeatureOperation(name: String, operationKey: String? = null, attributes: ReadableMap, promise: Promise) {
346
+ val attributesMap = attributes.toHashMap().toMutableMap()
347
+ datadog.getRumMonitor().startFeatureOperation(name, operationKey, attributesMap);
348
+ promise.resolve(null)
349
+ }
350
+
351
+ /**
352
+ * Marks a Feature Operation as successfully completed.
353
+ *
354
+ * @param name The name of the feature operation (for example, `"login_flow"`).
355
+ * @param operationKey The key of the operation instance to complete, if one was provided when starting it.
356
+ * @param attributes A map of custom attributes to attach to this completion event.
357
+ */
358
+ fun succeedFeatureOperation(name: String, operationKey: String? = null, attributes: ReadableMap, promise: Promise) {
359
+ val attributesMap = attributes.toHashMap().toMutableMap()
360
+ datadog.getRumMonitor().succeedFeatureOperation(name, operationKey, attributesMap)
361
+ promise.resolve(null)
362
+ }
363
+
364
+
365
+ /**
366
+ * Marks a Feature Operation as failed.
367
+ *
368
+ * @param name The name of the feature operation (for example, `"login_flow"`).
369
+ * @param operationKey The key of the operation instance to fail, if one was provided when starting it.
370
+ * @param failureReason The reason for the failure. Possible values are defined in [FailureReason]
371
+ * (e.g., `FailureReason.ERROR`, `FailureReason.ABANDONED`, `FailureReason.OTHER`).
372
+ * @param attributes A map of custom attributes to attach to this failure event.
373
+ */
374
+ fun failFeatureOperation(
375
+ name: String,
376
+ operationKey: String? = null,
377
+ failureReason: String,
378
+ attributes: ReadableMap,
379
+ promise: Promise
380
+ ) {
381
+ val attributesMap = attributes.toHashMap().toMutableMap()
382
+ val reason = runCatching {
383
+ enumValueOf<FailureReason>(failureReason.uppercase())
384
+ }.getOrDefault(FailureReason.OTHER)
385
+
386
+ datadog.getRumMonitor().failFeatureOperation(name, operationKey, reason, attributesMap)
387
+ promise.resolve(null)
388
+ }
389
+
292
390
  // region Internal
293
391
 
294
392
  private fun String.asRumActionType(): RumActionType {