@scalebun/react-native 1.1.0 → 1.2.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 (380) hide show
  1. package/dist/scalebun.full.js +33218 -0
  2. package/dist/scalebun.full.js.map +1 -0
  3. package/dist/scalebun.slim.js +30016 -0
  4. package/dist/scalebun.slim.js.map +1 -0
  5. package/lib/commonjs/bootstrap/FeatureRegistry.js +4 -4
  6. package/lib/commonjs/bootstrap/FeatureRegistry.js.map +1 -1
  7. package/lib/commonjs/bootstrap/SDKBootstrapper.js +8 -8
  8. package/lib/commonjs/bootstrap/SDKBootstrapper.js.map +1 -1
  9. package/lib/commonjs/core/config/schema.js +412 -232
  10. package/lib/commonjs/core/config/schema.js.map +1 -1
  11. package/lib/commonjs/core/constants/protocol.js +31 -0
  12. package/lib/commonjs/core/constants/protocol.js.map +1 -0
  13. package/lib/commonjs/core/constants/timings.js +4 -1
  14. package/lib/commonjs/core/constants/timings.js.map +1 -1
  15. package/lib/commonjs/core/lifecycle/appLifecycle.js +1 -1
  16. package/lib/commonjs/core/lifecycle/appLifecycle.js.map +1 -1
  17. package/lib/commonjs/debug/bootstrap.js +30 -10
  18. package/lib/commonjs/debug/bootstrap.js.map +1 -1
  19. package/lib/commonjs/debug/exportBridge.js +5 -3
  20. package/lib/commonjs/debug/exportBridge.js.map +1 -1
  21. package/lib/commonjs/debug/hostResolver.js +2 -2
  22. package/lib/commonjs/debug/hostResolver.js.map +1 -1
  23. package/lib/commonjs/debug/perfWiring.js +4 -4
  24. package/lib/commonjs/debug/perfWiring.js.map +1 -1
  25. package/lib/commonjs/debug/replayWiring.js +5 -5
  26. package/lib/commonjs/debug/replayWiring.js.map +1 -1
  27. package/lib/commonjs/debug/screenTracking.js +2 -2
  28. package/lib/commonjs/debug/screenTracking.js.map +1 -1
  29. package/lib/commonjs/debug/sessionWiring.js +2 -2
  30. package/lib/commonjs/debug/sessionWiring.js.map +1 -1
  31. package/lib/commonjs/features/crash/NativeCrashFeature.js +1 -1
  32. package/lib/commonjs/features/crash/NativeCrashFeature.js.map +1 -1
  33. package/lib/commonjs/features/crash/globalHandler.js +3 -3
  34. package/lib/commonjs/features/crash/globalHandler.js.map +1 -1
  35. package/lib/commonjs/features/crash/nativeCrashBridge.js +7 -7
  36. package/lib/commonjs/features/crash/nativeCrashBridge.js.map +1 -1
  37. package/lib/commonjs/features/crash/rejectionHandler.js +2 -2
  38. package/lib/commonjs/features/crash/rejectionHandler.js.map +1 -1
  39. package/lib/commonjs/features/engage/EngageArchetypeRenderers.js +0 -9
  40. package/lib/commonjs/features/engage/EngageArchetypeRenderers.js.map +1 -1
  41. package/lib/commonjs/features/engage/EngageInAppView.js +1 -1
  42. package/lib/commonjs/features/engage/EngageInAppView.js.map +1 -1
  43. package/lib/commonjs/features/engage/EngagePromptProvider.js +17 -17
  44. package/lib/commonjs/features/engage/EngagePromptProvider.js.map +1 -1
  45. package/lib/commonjs/features/engage/EngageTransport.js +5 -5
  46. package/lib/commonjs/features/engage/EngageTransport.js.map +1 -1
  47. package/lib/commonjs/features/engage/engagePushTokenBridge.js +4 -4
  48. package/lib/commonjs/features/engage/engagePushTokenBridge.js.map +1 -1
  49. package/lib/commonjs/features/engage/engageShakeBridge.js +2 -2
  50. package/lib/commonjs/features/engage/engageShakeBridge.js.map +1 -1
  51. package/lib/commonjs/features/engage/engageSignals.js +1 -1
  52. package/lib/commonjs/features/engage/engageSignals.js.map +1 -1
  53. package/lib/commonjs/features/engage/engageStoreReviewBridge.js +2 -2
  54. package/lib/commonjs/features/engage/engageStoreReviewBridge.js.map +1 -1
  55. package/lib/commonjs/features/engage/engageTestSeenStore.js +1 -1
  56. package/lib/commonjs/features/engage/engageTestSeenStore.js.map +1 -1
  57. package/lib/commonjs/features/engage/engageThrottle.js +4 -4
  58. package/lib/commonjs/features/engage/engageThrottle.js.map +1 -1
  59. package/lib/commonjs/features/engage/engageTriggerEngine.js +4 -4
  60. package/lib/commonjs/features/engage/engageTriggerEngine.js.map +1 -1
  61. package/lib/commonjs/features/engage/engageWindowInsets.js +1 -1
  62. package/lib/commonjs/features/engage/engageWindowInsets.js.map +1 -1
  63. package/lib/commonjs/features/install-referrer/installReferrer.js +3 -3
  64. package/lib/commonjs/features/install-referrer/installReferrer.js.map +1 -1
  65. package/lib/commonjs/features/journey/calibrationContext.js +0 -9
  66. package/lib/commonjs/features/journey/calibrationContext.js.map +1 -1
  67. package/lib/commonjs/features/journey/journeyManager.js +4 -1
  68. package/lib/commonjs/features/journey/journeyManager.js.map +1 -1
  69. package/lib/commonjs/features/navigation/AutoScreenDetector.js +4 -4
  70. package/lib/commonjs/features/navigation/AutoScreenDetector.js.map +1 -1
  71. package/lib/commonjs/features/ota/OtaOrchestrator.js +18 -18
  72. package/lib/commonjs/features/ota/OtaOrchestrator.js.map +1 -1
  73. package/lib/commonjs/features/ota/geoCountry.js +2 -2
  74. package/lib/commonjs/features/ota/geoCountry.js.map +1 -1
  75. package/lib/commonjs/features/ota/retry.js +2 -2
  76. package/lib/commonjs/features/ota/retry.js.map +1 -1
  77. package/lib/commonjs/features/performance/PerformanceFeature.js +121 -23
  78. package/lib/commonjs/features/performance/PerformanceFeature.js.map +1 -1
  79. package/lib/commonjs/features/replay/core/logger/logger.js +0 -4
  80. package/lib/commonjs/features/replay/core/logger/logger.js.map +1 -1
  81. package/lib/commonjs/features/replay/integrations/network/networkAdapter.js +1 -54
  82. package/lib/commonjs/features/replay/integrations/network/networkAdapter.js.map +1 -1
  83. package/lib/commonjs/features/replay/integrations/react-navigation/navigationIntegration.js +1 -1
  84. package/lib/commonjs/features/replay/integrations/react-navigation/navigationIntegration.js.map +1 -1
  85. package/lib/commonjs/features/replay/integrations/touch/ReplayRoot.js +1 -1
  86. package/lib/commonjs/features/replay/integrations/touch/ReplayRoot.js.map +1 -1
  87. package/lib/commonjs/features/replay/pipeline/batching/batchManager.js +1 -1
  88. package/lib/commonjs/features/replay/pipeline/batching/batchManager.js.map +1 -1
  89. package/lib/commonjs/features/replay/pipeline/retry/retryPolicy.js +1 -1
  90. package/lib/commonjs/features/replay/pipeline/retry/retryPolicy.js.map +1 -1
  91. package/lib/commonjs/features/replay/public/api.js +7 -7
  92. package/lib/commonjs/features/replay/public/api.js.map +1 -1
  93. package/lib/commonjs/features/replay/replay/session/sessionOrchestrator.js +9 -9
  94. package/lib/commonjs/features/replay/replay/session/sessionOrchestrator.js.map +1 -1
  95. package/lib/commonjs/features/session/BackendSessionAdapter.js +41 -41
  96. package/lib/commonjs/features/session/BackendSessionAdapter.js.map +1 -1
  97. package/lib/commonjs/features/session/DesktopSessionTransport.js +5 -2
  98. package/lib/commonjs/features/session/DesktopSessionTransport.js.map +1 -1
  99. package/lib/commonjs/features/session/JourneyEventPipeline.js +1 -1
  100. package/lib/commonjs/features/session/JourneyEventPipeline.js.map +1 -1
  101. package/lib/commonjs/features/session/ReplayCaptureManager.js +14 -14
  102. package/lib/commonjs/features/session/ReplayCaptureManager.js.map +1 -1
  103. package/lib/commonjs/features/session/SessionManager.js +9 -9
  104. package/lib/commonjs/features/session/SessionManager.js.map +1 -1
  105. package/lib/commonjs/features/session/SyncDecisionEngine.js +1 -1
  106. package/lib/commonjs/features/session/SyncDecisionEngine.js.map +1 -1
  107. package/lib/commonjs/features/skan/skanBridge.js +6 -15
  108. package/lib/commonjs/features/skan/skanBridge.js.map +1 -1
  109. package/lib/commonjs/features/skan/skanConversionManager.js +5 -5
  110. package/lib/commonjs/features/skan/skanConversionManager.js.map +1 -1
  111. package/lib/commonjs/integrations/fetch/fetchInterceptor.js +1 -1
  112. package/lib/commonjs/integrations/fetch/fetchInterceptor.js.map +1 -1
  113. package/lib/commonjs/integrations/xhr/xhrInterceptor.js +1 -1
  114. package/lib/commonjs/integrations/xhr/xhrInterceptor.js.map +1 -1
  115. package/lib/commonjs/metro/composeSourceMap.js +105 -0
  116. package/lib/commonjs/metro/composeSourceMap.js.map +1 -0
  117. package/lib/commonjs/metro/featureModules.js +131 -0
  118. package/lib/commonjs/metro/featureModules.js.map +1 -0
  119. package/lib/commonjs/metro/index.js +123 -2
  120. package/lib/commonjs/metro/index.js.map +1 -1
  121. package/lib/commonjs/metro/serializerCompose.js +129 -0
  122. package/lib/commonjs/metro/serializerCompose.js.map +1 -0
  123. package/lib/commonjs/pipeline/dispatcher/dispatcher.js +1 -1
  124. package/lib/commonjs/pipeline/dispatcher/dispatcher.js.map +1 -1
  125. package/lib/commonjs/pipeline/queue/flushQueue.js +2 -2
  126. package/lib/commonjs/pipeline/queue/flushQueue.js.map +1 -1
  127. package/lib/commonjs/pipeline/queue/persistentQueue.js +6 -37
  128. package/lib/commonjs/pipeline/queue/persistentQueue.js.map +1 -1
  129. package/lib/commonjs/pipeline/scheduler/flushScheduler.js +1 -1
  130. package/lib/commonjs/pipeline/scheduler/flushScheduler.js.map +1 -1
  131. package/lib/commonjs/public/ScaleBunFacade.js +15 -15
  132. package/lib/commonjs/public/ScaleBunFacade.js.map +1 -1
  133. package/lib/commonjs/push/PushManager.js +3 -3
  134. package/lib/commonjs/push/PushManager.js.map +1 -1
  135. package/lib/commonjs/push/adapters/NativeBridgeAdapter.js +1 -1
  136. package/lib/commonjs/push/adapters/NativeBridgeAdapter.js.map +1 -1
  137. package/lib/commonjs/push/native/nativeNotifications.js +7 -18
  138. package/lib/commonjs/push/native/nativeNotifications.js.map +1 -1
  139. package/lib/commonjs/storage/StorageBackend.js +1 -1
  140. package/lib/commonjs/storage/StorageBackend.js.map +1 -1
  141. package/lib/module/bootstrap/FeatureRegistry.js +4 -4
  142. package/lib/module/bootstrap/FeatureRegistry.js.map +1 -1
  143. package/lib/module/bootstrap/SDKBootstrapper.js +8 -8
  144. package/lib/module/bootstrap/SDKBootstrapper.js.map +1 -1
  145. package/lib/module/core/config/schema.js +411 -231
  146. package/lib/module/core/config/schema.js.map +1 -1
  147. package/lib/module/core/constants/protocol.js +25 -0
  148. package/lib/module/core/constants/protocol.js.map +1 -0
  149. package/lib/module/core/constants/timings.js +3 -1
  150. package/lib/module/core/constants/timings.js.map +1 -1
  151. package/lib/module/core/lifecycle/appLifecycle.js +1 -1
  152. package/lib/module/core/lifecycle/appLifecycle.js.map +1 -1
  153. package/lib/module/debug/bootstrap.js +30 -9
  154. package/lib/module/debug/bootstrap.js.map +1 -1
  155. package/lib/module/debug/exportBridge.js +5 -3
  156. package/lib/module/debug/exportBridge.js.map +1 -1
  157. package/lib/module/debug/hostResolver.js +2 -2
  158. package/lib/module/debug/hostResolver.js.map +1 -1
  159. package/lib/module/debug/perfWiring.js +4 -4
  160. package/lib/module/debug/perfWiring.js.map +1 -1
  161. package/lib/module/debug/replayWiring.js +5 -5
  162. package/lib/module/debug/replayWiring.js.map +1 -1
  163. package/lib/module/debug/screenTracking.js +2 -2
  164. package/lib/module/debug/screenTracking.js.map +1 -1
  165. package/lib/module/debug/sessionWiring.js +2 -2
  166. package/lib/module/debug/sessionWiring.js.map +1 -1
  167. package/lib/module/features/crash/NativeCrashFeature.js +1 -1
  168. package/lib/module/features/crash/NativeCrashFeature.js.map +1 -1
  169. package/lib/module/features/crash/globalHandler.js +3 -3
  170. package/lib/module/features/crash/globalHandler.js.map +1 -1
  171. package/lib/module/features/crash/nativeCrashBridge.js +7 -7
  172. package/lib/module/features/crash/nativeCrashBridge.js.map +1 -1
  173. package/lib/module/features/crash/rejectionHandler.js +2 -2
  174. package/lib/module/features/crash/rejectionHandler.js.map +1 -1
  175. package/lib/module/features/engage/EngageArchetypeRenderers.js +0 -8
  176. package/lib/module/features/engage/EngageArchetypeRenderers.js.map +1 -1
  177. package/lib/module/features/engage/EngageInAppView.js +1 -1
  178. package/lib/module/features/engage/EngageInAppView.js.map +1 -1
  179. package/lib/module/features/engage/EngagePromptProvider.js +17 -17
  180. package/lib/module/features/engage/EngagePromptProvider.js.map +1 -1
  181. package/lib/module/features/engage/EngageTransport.js +5 -5
  182. package/lib/module/features/engage/EngageTransport.js.map +1 -1
  183. package/lib/module/features/engage/engagePushTokenBridge.js +4 -4
  184. package/lib/module/features/engage/engagePushTokenBridge.js.map +1 -1
  185. package/lib/module/features/engage/engageShakeBridge.js +2 -2
  186. package/lib/module/features/engage/engageShakeBridge.js.map +1 -1
  187. package/lib/module/features/engage/engageSignals.js +1 -1
  188. package/lib/module/features/engage/engageSignals.js.map +1 -1
  189. package/lib/module/features/engage/engageStoreReviewBridge.js +2 -2
  190. package/lib/module/features/engage/engageStoreReviewBridge.js.map +1 -1
  191. package/lib/module/features/engage/engageTestSeenStore.js +1 -1
  192. package/lib/module/features/engage/engageTestSeenStore.js.map +1 -1
  193. package/lib/module/features/engage/engageThrottle.js +4 -4
  194. package/lib/module/features/engage/engageThrottle.js.map +1 -1
  195. package/lib/module/features/engage/engageTriggerEngine.js +4 -4
  196. package/lib/module/features/engage/engageTriggerEngine.js.map +1 -1
  197. package/lib/module/features/engage/engageWindowInsets.js +1 -1
  198. package/lib/module/features/engage/engageWindowInsets.js.map +1 -1
  199. package/lib/module/features/install-referrer/installReferrer.js +3 -3
  200. package/lib/module/features/install-referrer/installReferrer.js.map +1 -1
  201. package/lib/module/features/journey/calibrationContext.js +0 -8
  202. package/lib/module/features/journey/calibrationContext.js.map +1 -1
  203. package/lib/module/features/journey/journeyManager.js +3 -1
  204. package/lib/module/features/journey/journeyManager.js.map +1 -1
  205. package/lib/module/features/navigation/AutoScreenDetector.js +4 -4
  206. package/lib/module/features/navigation/AutoScreenDetector.js.map +1 -1
  207. package/lib/module/features/ota/OtaOrchestrator.js +18 -18
  208. package/lib/module/features/ota/OtaOrchestrator.js.map +1 -1
  209. package/lib/module/features/ota/geoCountry.js +2 -2
  210. package/lib/module/features/ota/geoCountry.js.map +1 -1
  211. package/lib/module/features/ota/retry.js +2 -2
  212. package/lib/module/features/ota/retry.js.map +1 -1
  213. package/lib/module/features/performance/PerformanceFeature.js +122 -23
  214. package/lib/module/features/performance/PerformanceFeature.js.map +1 -1
  215. package/lib/module/features/replay/core/logger/logger.js +0 -3
  216. package/lib/module/features/replay/core/logger/logger.js.map +1 -1
  217. package/lib/module/features/replay/integrations/network/networkAdapter.js +1 -52
  218. package/lib/module/features/replay/integrations/network/networkAdapter.js.map +1 -1
  219. package/lib/module/features/replay/integrations/react-navigation/navigationIntegration.js +1 -1
  220. package/lib/module/features/replay/integrations/react-navigation/navigationIntegration.js.map +1 -1
  221. package/lib/module/features/replay/integrations/touch/ReplayRoot.js +1 -1
  222. package/lib/module/features/replay/integrations/touch/ReplayRoot.js.map +1 -1
  223. package/lib/module/features/replay/pipeline/batching/batchManager.js +1 -1
  224. package/lib/module/features/replay/pipeline/batching/batchManager.js.map +1 -1
  225. package/lib/module/features/replay/pipeline/retry/retryPolicy.js +1 -1
  226. package/lib/module/features/replay/pipeline/retry/retryPolicy.js.map +1 -1
  227. package/lib/module/features/replay/public/api.js +7 -7
  228. package/lib/module/features/replay/public/api.js.map +1 -1
  229. package/lib/module/features/replay/replay/session/sessionOrchestrator.js +9 -9
  230. package/lib/module/features/replay/replay/session/sessionOrchestrator.js.map +1 -1
  231. package/lib/module/features/session/BackendSessionAdapter.js +41 -41
  232. package/lib/module/features/session/BackendSessionAdapter.js.map +1 -1
  233. package/lib/module/features/session/DesktopSessionTransport.js +4 -2
  234. package/lib/module/features/session/DesktopSessionTransport.js.map +1 -1
  235. package/lib/module/features/session/JourneyEventPipeline.js +1 -1
  236. package/lib/module/features/session/JourneyEventPipeline.js.map +1 -1
  237. package/lib/module/features/session/ReplayCaptureManager.js +14 -14
  238. package/lib/module/features/session/ReplayCaptureManager.js.map +1 -1
  239. package/lib/module/features/session/SessionManager.js +9 -9
  240. package/lib/module/features/session/SessionManager.js.map +1 -1
  241. package/lib/module/features/session/SyncDecisionEngine.js +1 -1
  242. package/lib/module/features/session/SyncDecisionEngine.js.map +1 -1
  243. package/lib/module/features/skan/skanBridge.js +6 -14
  244. package/lib/module/features/skan/skanBridge.js.map +1 -1
  245. package/lib/module/features/skan/skanConversionManager.js +5 -5
  246. package/lib/module/features/skan/skanConversionManager.js.map +1 -1
  247. package/lib/module/integrations/fetch/fetchInterceptor.js +1 -1
  248. package/lib/module/integrations/fetch/fetchInterceptor.js.map +1 -1
  249. package/lib/module/integrations/xhr/xhrInterceptor.js +1 -1
  250. package/lib/module/integrations/xhr/xhrInterceptor.js.map +1 -1
  251. package/lib/module/metro/composeSourceMap.js +97 -0
  252. package/lib/module/metro/composeSourceMap.js.map +1 -0
  253. package/lib/module/metro/featureModules.js +123 -0
  254. package/lib/module/metro/featureModules.js.map +1 -0
  255. package/lib/module/metro/index.js +122 -2
  256. package/lib/module/metro/index.js.map +1 -1
  257. package/lib/module/metro/serializerCompose.js +120 -0
  258. package/lib/module/metro/serializerCompose.js.map +1 -0
  259. package/lib/module/pipeline/dispatcher/dispatcher.js +1 -1
  260. package/lib/module/pipeline/dispatcher/dispatcher.js.map +1 -1
  261. package/lib/module/pipeline/queue/flushQueue.js +2 -2
  262. package/lib/module/pipeline/queue/flushQueue.js.map +1 -1
  263. package/lib/module/pipeline/queue/persistentQueue.js +6 -36
  264. package/lib/module/pipeline/queue/persistentQueue.js.map +1 -1
  265. package/lib/module/pipeline/scheduler/flushScheduler.js +1 -1
  266. package/lib/module/pipeline/scheduler/flushScheduler.js.map +1 -1
  267. package/lib/module/public/ScaleBunFacade.js +15 -15
  268. package/lib/module/public/ScaleBunFacade.js.map +1 -1
  269. package/lib/module/push/PushManager.js +3 -3
  270. package/lib/module/push/PushManager.js.map +1 -1
  271. package/lib/module/push/adapters/NativeBridgeAdapter.js +1 -1
  272. package/lib/module/push/adapters/NativeBridgeAdapter.js.map +1 -1
  273. package/lib/module/push/native/nativeNotifications.js +7 -17
  274. package/lib/module/push/native/nativeNotifications.js.map +1 -1
  275. package/lib/module/storage/StorageBackend.js +1 -1
  276. package/lib/module/storage/StorageBackend.js.map +1 -1
  277. package/lib/typescript/core/config/schema.d.ts +61 -40
  278. package/lib/typescript/core/config/schema.d.ts.map +1 -1
  279. package/lib/typescript/core/constants/protocol.d.ts +23 -0
  280. package/lib/typescript/core/constants/protocol.d.ts.map +1 -0
  281. package/lib/typescript/core/constants/timings.d.ts +1 -1
  282. package/lib/typescript/core/constants/timings.d.ts.map +1 -1
  283. package/lib/typescript/debug/bootstrap.d.ts +0 -1
  284. package/lib/typescript/debug/bootstrap.d.ts.map +1 -1
  285. package/lib/typescript/debug/exportBridge.d.ts.map +1 -1
  286. package/lib/typescript/features/engage/EngageArchetypeRenderers.d.ts +0 -2
  287. package/lib/typescript/features/engage/EngageArchetypeRenderers.d.ts.map +1 -1
  288. package/lib/typescript/features/journey/calibrationContext.d.ts +0 -1
  289. package/lib/typescript/features/journey/calibrationContext.d.ts.map +1 -1
  290. package/lib/typescript/features/journey/journeyManager.d.ts.map +1 -1
  291. package/lib/typescript/features/performance/PerformanceFeature.d.ts +31 -0
  292. package/lib/typescript/features/performance/PerformanceFeature.d.ts.map +1 -1
  293. package/lib/typescript/features/replay/core/logger/logger.d.ts +0 -1
  294. package/lib/typescript/features/replay/core/logger/logger.d.ts.map +1 -1
  295. package/lib/typescript/features/replay/integrations/network/networkAdapter.d.ts +0 -10
  296. package/lib/typescript/features/replay/integrations/network/networkAdapter.d.ts.map +1 -1
  297. package/lib/typescript/features/session/DesktopSessionTransport.d.ts.map +1 -1
  298. package/lib/typescript/features/skan/skanBridge.d.ts +0 -2
  299. package/lib/typescript/features/skan/skanBridge.d.ts.map +1 -1
  300. package/lib/typescript/metro/composeSourceMap.d.ts +26 -0
  301. package/lib/typescript/metro/composeSourceMap.d.ts.map +1 -0
  302. package/lib/typescript/metro/featureModules.d.ts +49 -0
  303. package/lib/typescript/metro/featureModules.d.ts.map +1 -0
  304. package/lib/typescript/metro/index.d.ts +22 -0
  305. package/lib/typescript/metro/index.d.ts.map +1 -1
  306. package/lib/typescript/metro/serializerCompose.d.ts +46 -0
  307. package/lib/typescript/metro/serializerCompose.d.ts.map +1 -0
  308. package/lib/typescript/pipeline/queue/persistentQueue.d.ts +0 -10
  309. package/lib/typescript/pipeline/queue/persistentQueue.d.ts.map +1 -1
  310. package/lib/typescript/push/native/nativeNotifications.d.ts +0 -6
  311. package/lib/typescript/push/native/nativeNotifications.d.ts.map +1 -1
  312. package/package.json +15 -11
  313. package/src/bootstrap/FeatureRegistry.ts +4 -4
  314. package/src/bootstrap/SDKBootstrapper.ts +8 -8
  315. package/src/core/config/schema.ts +353 -235
  316. package/src/core/constants/protocol.ts +24 -0
  317. package/src/core/constants/timings.ts +3 -1
  318. package/src/core/lifecycle/appLifecycle.ts +1 -1
  319. package/src/debug/bootstrap.ts +40 -7
  320. package/src/debug/exportBridge.ts +5 -3
  321. package/src/debug/hostResolver.ts +2 -2
  322. package/src/debug/perfWiring.ts +4 -4
  323. package/src/debug/replayWiring.ts +5 -5
  324. package/src/debug/screenTracking.ts +2 -2
  325. package/src/debug/sessionWiring.ts +2 -2
  326. package/src/features/crash/NativeCrashFeature.ts +1 -1
  327. package/src/features/crash/globalHandler.ts +3 -3
  328. package/src/features/crash/nativeCrashBridge.ts +7 -7
  329. package/src/features/crash/rejectionHandler.ts +2 -2
  330. package/src/features/engage/EngageArchetypeRenderers.tsx +0 -11
  331. package/src/features/engage/EngageInAppView.tsx +1 -1
  332. package/src/features/engage/EngagePromptProvider.tsx +17 -17
  333. package/src/features/engage/EngageTransport.ts +5 -5
  334. package/src/features/engage/engagePushTokenBridge.ts +4 -4
  335. package/src/features/engage/engageShakeBridge.ts +2 -2
  336. package/src/features/engage/engageSignals.ts +1 -1
  337. package/src/features/engage/engageStoreReviewBridge.ts +2 -2
  338. package/src/features/engage/engageTestSeenStore.ts +1 -1
  339. package/src/features/engage/engageThrottle.ts +4 -4
  340. package/src/features/engage/engageTriggerEngine.ts +4 -4
  341. package/src/features/engage/engageWindowInsets.ts +1 -1
  342. package/src/features/install-referrer/installReferrer.ts +3 -3
  343. package/src/features/journey/calibrationContext.ts +0 -9
  344. package/src/features/journey/journeyManager.ts +3 -1
  345. package/src/features/navigation/AutoScreenDetector.ts +4 -4
  346. package/src/features/ota/OtaOrchestrator.ts +18 -18
  347. package/src/features/ota/geoCountry.ts +2 -2
  348. package/src/features/ota/retry.ts +2 -2
  349. package/src/features/performance/PerformanceFeature.ts +130 -20
  350. package/src/features/replay/core/logger/logger.ts +0 -4
  351. package/src/features/replay/integrations/network/networkAdapter.ts +1 -56
  352. package/src/features/replay/integrations/react-navigation/navigationIntegration.ts +1 -1
  353. package/src/features/replay/integrations/touch/ReplayRoot.tsx +1 -1
  354. package/src/features/replay/pipeline/batching/batchManager.ts +1 -1
  355. package/src/features/replay/pipeline/retry/retryPolicy.ts +1 -1
  356. package/src/features/replay/public/api.ts +7 -7
  357. package/src/features/replay/replay/session/sessionOrchestrator.ts +9 -9
  358. package/src/features/session/BackendSessionAdapter.ts +41 -41
  359. package/src/features/session/DesktopSessionTransport.ts +4 -2
  360. package/src/features/session/JourneyEventPipeline.ts +1 -1
  361. package/src/features/session/ReplayCaptureManager.ts +14 -14
  362. package/src/features/session/SessionManager.ts +9 -9
  363. package/src/features/session/SyncDecisionEngine.ts +1 -1
  364. package/src/features/skan/skanBridge.ts +6 -14
  365. package/src/features/skan/skanConversionManager.ts +5 -5
  366. package/src/integrations/fetch/fetchInterceptor.ts +1 -1
  367. package/src/integrations/xhr/xhrInterceptor.ts +1 -1
  368. package/src/metro/composeSourceMap.ts +104 -0
  369. package/src/metro/featureModules.ts +143 -0
  370. package/src/metro/index.ts +173 -1
  371. package/src/metro/serializerCompose.ts +157 -0
  372. package/src/pipeline/dispatcher/dispatcher.ts +1 -1
  373. package/src/pipeline/queue/flushQueue.ts +2 -2
  374. package/src/pipeline/queue/persistentQueue.ts +6 -35
  375. package/src/pipeline/scheduler/flushScheduler.ts +1 -1
  376. package/src/public/ScaleBunFacade.ts +15 -15
  377. package/src/push/PushManager.ts +3 -3
  378. package/src/push/adapters/NativeBridgeAdapter.ts +1 -1
  379. package/src/push/native/nativeNotifications.ts +7 -16
  380. package/src/storage/StorageBackend.ts +1 -1
@@ -47,70 +47,15 @@ export function reportNetworkRequest(request: NetworkRequestSummary): void {
47
47
 
48
48
  breadcrumbCollector.addNetworkBreadcrumb(sanitized).catch(() => { });
49
49
  } catch (err: any) {
50
- logger.debug(`Network breadcrumb failed: ${err?.message}`);
50
+ __DEV__ && logger.debug(`Network breadcrumb failed: ${err?.message}`);
51
51
  }
52
52
  }
53
53
 
54
- /**
55
- * Set a filter function to control which URLs are recorded.
56
- * Return true to include, false to exclude.
57
- */
58
- export function setNetworkUrlFilter(filter: ((url: string) => boolean) | null): void {
59
- _urlFilter = filter;
60
- }
61
-
62
54
  /** Enable/disable network breadcrumb collection */
63
55
  export function setNetworkEnabled(enabled: boolean): void {
64
56
  _enabled = enabled;
65
57
  }
66
58
 
67
- /**
68
- * Optional: create a fetch wrapper that auto-reports requests.
69
- * This does NOT replace global fetch — it wraps it for convenience.
70
- */
71
- export function createTrackedFetch(originalFetch: typeof fetch): typeof fetch {
72
- return async function trackedFetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {
73
- const startTime = Date.now();
74
- const method = init?.method ?? 'GET';
75
- const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;
76
- const requestSize = init?.body ? new Blob([init.body as any]).size : 0;
77
-
78
- try {
79
- const response = await originalFetch(input, init);
80
- const duration = Date.now() - startTime;
81
-
82
- reportNetworkRequest({
83
- method,
84
- url,
85
- statusCode: response.status,
86
- durationMs: duration,
87
- requestSizeBytes: requestSize,
88
- responseSizeBytes: 0, // Can't reliably get without reading body
89
- error: !response.ok,
90
- startTimestamp: startTime,
91
- });
92
-
93
- return response;
94
- } catch (err: any) {
95
- const duration = Date.now() - startTime;
96
-
97
- reportNetworkRequest({
98
- method,
99
- url,
100
- statusCode: 0,
101
- durationMs: duration,
102
- requestSizeBytes: requestSize,
103
- responseSizeBytes: 0,
104
- error: true,
105
- errorMessage: err?.message,
106
- startTimestamp: startTime,
107
- });
108
-
109
- throw err;
110
- }
111
- };
112
- }
113
-
114
59
  /** Basic URL sanitization: mask tokens/keys in query params */
115
60
  function sanitizeUrl(url: string): string {
116
61
  try {
@@ -65,7 +65,7 @@ export function useReplayNavigation(navigationRef: any): void {
65
65
  }
66
66
  });
67
67
 
68
- logger.debug(`Screen: ${previousRouteName ?? '(none)'} → ${currentRouteName}`);
68
+ __DEV__ && logger.debug(`Screen: ${previousRouteName ?? '(none)'} → ${currentRouteName}`);
69
69
  }
70
70
  });
71
71
 
@@ -95,7 +95,7 @@ export function ReplayRoot({ children, disableInteractionTracking = false }: Rep
95
95
  // Also trigger a frame capture for interaction modes
96
96
  bridgeAdapter.captureFrame('interaction').catch(() => { });
97
97
 
98
- logger.debug(`Interaction: ${interactionType} at (${Math.round(touch.pageX)}, ${Math.round(touch.pageY)})`);
98
+ __DEV__ && logger.debug(`Interaction: ${interactionType} at (${Math.round(touch.pageX)}, ${Math.round(touch.pageY)})`);
99
99
  }, [disableInteractionTracking]);
100
100
 
101
101
  return (
@@ -116,7 +116,7 @@ class BatchManager {
116
116
  logger.warn('Batch queue full — dropping oldest batch');
117
117
  }
118
118
 
119
- logger.debug(`Batch created: ${batch.batchId} (${batch.frames.length} frames, ${batch.events.length} events)`);
119
+ __DEV__ && logger.debug(`Batch created: ${batch.batchId} (${batch.frames.length} frames, ${batch.events.length} events)`);
120
120
  return batch;
121
121
  }
122
122
 
@@ -49,7 +49,7 @@ export async function withRetry<T>(
49
49
  }
50
50
 
51
51
  const delay = calculateDelay(attempt, config);
52
- logger.debug(`${label}: retry ${attempt + 1}/${config.maxAttempts} in ${delay}ms`);
52
+ __DEV__ && logger.debug(`${label}: retry ${attempt + 1}/${config.maxAttempts} in ${delay}ms`);
53
53
  await sleep(delay);
54
54
  }
55
55
  }
@@ -81,7 +81,7 @@ export const ReplaySdk = {
81
81
  }
82
82
 
83
83
  if (!config.enabled) {
84
- logger.info('SDK disabled via config');
84
+ __DEV__ && logger.info('SDK disabled via config');
85
85
  return;
86
86
  }
87
87
 
@@ -91,7 +91,7 @@ export const ReplaySdk = {
91
91
  // Desktop transport (always, if debugTransport provided)
92
92
  if (opts?.debugTransport) {
93
93
  transports.push(new DesktopReplayTransport(opts.debugTransport));
94
- logger.info('Desktop replay transport enabled');
94
+ __DEV__ && logger.info('Desktop replay transport enabled');
95
95
  }
96
96
 
97
97
  // Backend transport (flag-controlled + env check)
@@ -103,9 +103,9 @@ export const ReplaySdk = {
103
103
  apiKey: config.apiKey,
104
104
  batchSize: config.uploadBatchSize,
105
105
  }));
106
- logger.info('Backend replay transport enabled');
106
+ __DEV__ && logger.info('Backend replay transport enabled');
107
107
  } else {
108
- logger.info('Backend replay transport skipped (dev/emulator mode)');
108
+ __DEV__ && logger.info('Backend replay transport skipped (dev/emulator mode)');
109
109
  }
110
110
  }
111
111
 
@@ -129,7 +129,7 @@ export const ReplaySdk = {
129
129
  try {
130
130
  const success = await sessionOrchestrator.initialize(config);
131
131
  if (success) {
132
- logger.info('SDK initialized with native module');
132
+ __DEV__ && logger.info('SDK initialized with native module');
133
133
  } else {
134
134
  logger.warn('Native module not available — transport-only mode');
135
135
  }
@@ -138,7 +138,7 @@ export const ReplaySdk = {
138
138
  }
139
139
 
140
140
  _initialized = true;
141
- logger.info('SDK initialized successfully');
141
+ __DEV__ && logger.info('SDK initialized successfully');
142
142
  }, undefined);
143
143
  },
144
144
 
@@ -358,7 +358,7 @@ export const ReplaySdk = {
358
358
 
359
359
  _initialized = false;
360
360
  _config = null;
361
- logger.info('SDK destroyed');
361
+ __DEV__ && logger.info('SDK destroyed');
362
362
  }, undefined);
363
363
  },
364
364
  };
@@ -53,10 +53,10 @@ class SessionOrchestrator {
53
53
  try {
54
54
  const success = await bridgeAdapter.initialize(config);
55
55
  if (!success) {
56
- logger.info('Native replay module not available — running in transport-only mode');
56
+ __DEV__ && logger.info('Native replay module not available — running in transport-only mode');
57
57
  }
58
58
  } catch (nativeErr: any) {
59
- logger.info('Native replay module not available:', nativeErr?.message);
59
+ __DEV__ && logger.info('Native replay module not available:', nativeErr?.message);
60
60
  }
61
61
 
62
62
  // Listen to native events (no-ops if native not available)
@@ -66,7 +66,7 @@ class SessionOrchestrator {
66
66
  this._appStateSubscription = AppState.addEventListener('change', this._onAppStateChange);
67
67
 
68
68
  this._initialized = true;
69
- logger.info('SessionOrchestrator initialized');
69
+ __DEV__ && logger.info('SessionOrchestrator initialized');
70
70
 
71
71
  // Auto-start if configured
72
72
  if (config.autoStart && config.enabled) {
@@ -93,7 +93,7 @@ class SessionOrchestrator {
93
93
  this._startDurationTimer();
94
94
  this._startFrequencyTimerIfNeeded();
95
95
 
96
- logger.info(`Session started: ${this._sessionId}`);
96
+ __DEV__ && logger.info(`Session started: ${this._sessionId}`);
97
97
  }
98
98
 
99
99
  async stop(): Promise<void> {
@@ -107,7 +107,7 @@ class SessionOrchestrator {
107
107
  this._state = SessionState.Idle;
108
108
  clock.resetClock();
109
109
 
110
- logger.info(`Session stopped: ${this._sessionId}`);
110
+ __DEV__ && logger.info(`Session stopped: ${this._sessionId}`);
111
111
  this._sessionId = null;
112
112
  this._startedAt = 0;
113
113
  }
@@ -117,7 +117,7 @@ class SessionOrchestrator {
117
117
  this._state = SessionState.Paused;
118
118
  this._stopTimers();
119
119
  await bridgeAdapter.pauseSession();
120
- logger.debug('Session paused');
120
+ __DEV__ && logger.debug('Session paused');
121
121
  }
122
122
 
123
123
  async resume(): Promise<void> {
@@ -126,7 +126,7 @@ class SessionOrchestrator {
126
126
  this._startDurationTimer();
127
127
  this._startFrequencyTimerIfNeeded();
128
128
  await bridgeAdapter.resumeSession();
129
- logger.debug('Session resumed');
129
+ __DEV__ && logger.debug('Session resumed');
130
130
  }
131
131
 
132
132
  // ─── Capture ────────────────────────────────────────────────────────
@@ -231,7 +231,7 @@ class SessionOrchestrator {
231
231
 
232
232
  private _setupNativeEventListeners(): void {
233
233
  replayEventEmitter.onSessionStateChanged((event: SessionStateChangedEvent) => {
234
- logger.debug(`Native state: ${event.previousState} → ${event.newState}`);
234
+ __DEV__ && logger.debug(`Native state: ${event.previousState} → ${event.newState}`);
235
235
  });
236
236
 
237
237
  replayEventEmitter.onSessionLimitReached((event: SessionLimitReachedEvent) => {
@@ -278,7 +278,7 @@ class SessionOrchestrator {
278
278
  this._state = SessionState.Idle;
279
279
  this._sessionId = null;
280
280
  this._config = null;
281
- logger.info('SessionOrchestrator destroyed');
281
+ __DEV__ && logger.info('SessionOrchestrator destroyed');
282
282
  }
283
283
  }
284
284
 
@@ -214,9 +214,9 @@ export class BackendSessionAdapter implements SessionTransport {
214
214
  this.objectStorageActive = this.config.useObjectStorage;
215
215
  this.nativeOutboxEnabled =
216
216
  this.config.enableNativeFileOutbox && this.config.nativeOutboxUploadEnabled;
217
- logger.info(`[ScaleBun Replay] backendUpload enabled`);
218
- logger.info(`[ScaleBun Replay] backendBaseUrl: ${this.config.endpoint}`);
219
- logger.info(`[ScaleBun Replay] transport fan-out active: desktop yes, backend yes`);
217
+ __DEV__ && logger.info(`[ScaleBun Replay] backendUpload enabled`);
218
+ __DEV__ && logger.info(`[ScaleBun Replay] backendBaseUrl: ${this.config.endpoint}`);
219
+ __DEV__ && logger.info(`[ScaleBun Replay] transport fan-out active: desktop yes, backend yes`);
220
220
  }
221
221
 
222
222
  // ─── SessionTransport Interface ─────────────────────────────────────
@@ -234,10 +234,10 @@ export class BackendSessionAdapter implements SessionTransport {
234
234
  this.currentSessionId = session.sessionId;
235
235
  this._startFlushTimer();
236
236
 
237
- logger.info(`[ScaleBun Replay] session start requested`);
238
- logger.info(`[ScaleBun Replay] sessionId: ${session.sessionId}`);
239
- logger.info(`[ScaleBun Replay] deviceId: ${session.deviceId}`);
240
- logger.info(`[ScaleBun Replay] recordingSessionId: ${session.sessionId}`);
237
+ __DEV__ && logger.info(`[ScaleBun Replay] session start requested`);
238
+ __DEV__ && logger.info(`[ScaleBun Replay] sessionId: ${session.sessionId}`);
239
+ __DEV__ && logger.info(`[ScaleBun Replay] deviceId: ${session.deviceId}`);
240
+ __DEV__ && logger.info(`[ScaleBun Replay] recordingSessionId: ${session.sessionId}`);
241
241
 
242
242
  // One-row merge: when recording adopted the always-on analytics id
243
243
  // (SessionManager.startSession), the INGESTION_START row already exists.
@@ -245,11 +245,11 @@ export class BackendSessionAdapter implements SessionTransport {
245
245
  // journey/network/errors/perf flush to INGESTION_*(analyticsId). Legacy
246
246
  // mode (no clientKey, distinct minted id) still posts /replay/sessions.
247
247
  if (this.config.clientKey && session.sessionId === this._analyticsSessionId) {
248
- logger.info(`[ScaleBun Replay] recording attached to analytics session ${session.sessionId} (no new row)`);
248
+ __DEV__ && logger.info(`[ScaleBun Replay] recording attached to analytics session ${session.sessionId} (no new row)`);
249
249
  return;
250
250
  }
251
251
 
252
- logger.info(`[ScaleBun Replay] backend session upload started`);
252
+ __DEV__ && logger.info(`[ScaleBun Replay] backend session upload started`);
253
253
 
254
254
  const startEndpoint = this.config.clientKey ? ENDPOINTS.INGESTION_START : '/replay/sessions';
255
255
 
@@ -290,19 +290,19 @@ export class BackendSessionAdapter implements SessionTransport {
290
290
  environment: m?.buildType,
291
291
  },
292
292
  };
293
- logger.debug(`[BackendSessionAdapter] POST session start: ${session.sessionId}`);
293
+ __DEV__ && logger.debug(`[BackendSessionAdapter] POST session start: ${session.sessionId}`);
294
294
  return this._post(startEndpoint, payload);
295
295
  })
296
296
  .then(() => {
297
297
  // §11: row now exists — release the child-lane flush gate for this id.
298
298
  this._startedSessionIds.add(session.sessionId);
299
- logger.info(`[ScaleBun Replay] backend session upload success`);
299
+ __DEV__ && logger.info(`[ScaleBun Replay] backend session upload success`);
300
300
  })
301
301
  .catch(() => logger.info(`[ScaleBun Replay] backend session upload failure`));
302
302
  }
303
303
 
304
304
  sendSessionEnd(session: Session): void {
305
- logger.info(`[ScaleBun Replay] finalize started`);
305
+ __DEV__ && logger.info(`[ScaleBun Replay] finalize started`);
306
306
  // Flush all pending data first, then finalize
307
307
  Promise.all([
308
308
  this._flushFrames(),
@@ -317,7 +317,7 @@ export class BackendSessionAdapter implements SessionTransport {
317
317
  // shared row mid-foreground and orphan later track() events — so flush
318
318
  // (above) but skip finalize. Legacy/distinct-id sessions finalize normally.
319
319
  if (this.config.clientKey && session.sessionId === this._analyticsSessionId) {
320
- logger.info(`[ScaleBun Replay] recording ended; analytics session ${session.sessionId} stays open`);
320
+ __DEV__ && logger.info(`[ScaleBun Replay] recording ended; analytics session ${session.sessionId} stays open`);
321
321
  return;
322
322
  }
323
323
  const finalizeEndpoint = this.config.clientKey
@@ -336,9 +336,9 @@ export class BackendSessionAdapter implements SessionTransport {
336
336
  },
337
337
  );
338
338
  }).then(() => {
339
- logger.info(`[ScaleBun Replay] finalize success`);
339
+ __DEV__ && logger.info(`[ScaleBun Replay] finalize success`);
340
340
  }).catch(() => {
341
- logger.info(`[ScaleBun Replay] finalize failure`);
341
+ __DEV__ && logger.info(`[ScaleBun Replay] finalize failure`);
342
342
  }).finally(() => {
343
343
  this._stopFlushTimer();
344
344
  // Keep the row-ready gate OPEN for a merged analytics session. The analytics
@@ -352,7 +352,7 @@ export class BackendSessionAdapter implements SessionTransport {
352
352
  }
353
353
  // Session end: drain any durably-stored telemetry from the native outbox.
354
354
  this._triggerNativeFlush();
355
- logger.debug(`[BackendSessionAdapter] Session finalized: ${session.sessionId}`);
355
+ __DEV__ && logger.debug(`[BackendSessionAdapter] Session finalized: ${session.sessionId}`);
356
356
  });
357
357
  }
358
358
 
@@ -423,9 +423,9 @@ export class BackendSessionAdapter implements SessionTransport {
423
423
  // The pre-ack flush at the top of this method is gated off until now, so
424
424
  // this is what actually drains the pre-ready buffer (no premature 404).
425
425
  this._flushAnalyticsEvents().catch(() => { });
426
- logger.info(`[ScaleBun Analytics] session start upload success: ${session.sessionId}`);
426
+ __DEV__ && logger.info(`[ScaleBun Analytics] session start upload success: ${session.sessionId}`);
427
427
  } catch {
428
- logger.info(`[ScaleBun Analytics] session start upload failure`);
428
+ __DEV__ && logger.info(`[ScaleBun Analytics] session start upload failure`);
429
429
  }
430
430
  }
431
431
 
@@ -504,7 +504,7 @@ export class BackendSessionAdapter implements SessionTransport {
504
504
  ? ENDPOINTS.INGESTION_EVENTS(sessionId)
505
505
  : `/replay/sessions/${sessionId}/events`;
506
506
  await this._post(eventsEndpoint, { events });
507
- logger.debug(`[BackendSessionAdapter] Flushed ${batch.length} analytics event(s)`);
507
+ __DEV__ && logger.debug(`[BackendSessionAdapter] Flushed ${batch.length} analytics event(s)`);
508
508
  } catch (err) {
509
509
  if (!BackendSessionAdapter._isPermanentHttpError(err)) this.pendingAnalyticsEvents.unshift(...batch);
510
510
  }
@@ -542,10 +542,10 @@ export class BackendSessionAdapter implements SessionTransport {
542
542
  // Confirmed delivered → drop the marker so the foreground reconciler does
543
543
  // NOT re-finalize this id (first half of the no-double-finalize guard).
544
544
  if (this._pendingFinalizeId === sessionId) this._pendingFinalizeId = null;
545
- logger.debug(`[BackendSessionAdapter] Analytics session finalized: ${sessionId}`);
545
+ __DEV__ && logger.debug(`[BackendSessionAdapter] Analytics session finalized: ${sessionId}`);
546
546
  } catch {
547
547
  // Leave the marker set — foreground reconciliation will retry the close.
548
- logger.info(`[ScaleBun Analytics] finalize failure (will reconcile on foreground): ${sessionId}`);
548
+ __DEV__ && logger.info(`[ScaleBun Analytics] finalize failure (will reconcile on foreground): ${sessionId}`);
549
549
  }
550
550
  }
551
551
 
@@ -567,9 +567,9 @@ export class BackendSessionAdapter implements SessionTransport {
567
567
  ? ENDPOINTS.INGESTION_FINALIZE(sessionId)
568
568
  : `/replay/sessions/${sessionId}/finalize`;
569
569
  await this._post(finalizeEndpoint, { endedAt: Date.now() });
570
- logger.info(`[ScaleBun Analytics] reconciled finalize on foreground: ${sessionId}`);
570
+ __DEV__ && logger.info(`[ScaleBun Analytics] reconciled finalize on foreground: ${sessionId}`);
571
571
  } catch {
572
- logger.info(`[ScaleBun Analytics] foreground reconcile finalize failed: ${sessionId}`);
572
+ __DEV__ && logger.info(`[ScaleBun Analytics] foreground reconcile finalize failed: ${sessionId}`);
573
573
  } finally {
574
574
  // Clear after a foreground attempt regardless of outcome: JS is live here
575
575
  // so a transient network error is rare, and the server-side idle-close
@@ -596,11 +596,11 @@ export class BackendSessionAdapter implements SessionTransport {
596
596
  sendEvent(event: JourneyEvent): void {
597
597
  if (this.destroyed) return;
598
598
 
599
- logger.info(`[ScaleBun Replay] event recorded`);
600
- logger.info(` eventId: ${event.eventId}`);
601
- logger.info(` type: ${event.type}`);
602
- logger.info(` timestamp: ${event.ts}`);
603
- logger.info(` sessionId: ${event.sessionId}`);
599
+ __DEV__ && logger.info(`[ScaleBun Replay] event recorded`);
600
+ __DEV__ && logger.info(` eventId: ${event.eventId}`);
601
+ __DEV__ && logger.info(` type: ${event.type}`);
602
+ __DEV__ && logger.info(` timestamp: ${event.ts}`);
603
+ __DEV__ && logger.info(` sessionId: ${event.sessionId}`);
604
604
 
605
605
  this.pendingEvents.push(event);
606
606
 
@@ -612,11 +612,11 @@ export class BackendSessionAdapter implements SessionTransport {
612
612
  sendFrame(frame: ReplayFrame, imageData: string): void {
613
613
  if (this.destroyed) return;
614
614
 
615
- logger.info(`[ScaleBun Replay] frame captured`);
616
- logger.info(` frameId: ${frame.frameId}`);
617
- logger.info(` timestamp: ${frame.ts}`);
618
- logger.info(` sessionId: ${frame.sessionId}`);
619
- logger.info(` width/height: ${frame.width}x${frame.height}`);
615
+ __DEV__ && logger.info(`[ScaleBun Replay] frame captured`);
616
+ __DEV__ && logger.info(` frameId: ${frame.frameId}`);
617
+ __DEV__ && logger.info(` timestamp: ${frame.ts}`);
618
+ __DEV__ && logger.info(` sessionId: ${frame.sessionId}`);
619
+ __DEV__ && logger.info(` width/height: ${frame.width}x${frame.height}`);
620
620
 
621
621
  this.pendingFrames.push({ frame, imageData });
622
622
 
@@ -953,7 +953,7 @@ export class BackendSessionAdapter implements SessionTransport {
953
953
  this.pendingFrames.unshift(...remaining);
954
954
  return;
955
955
  }
956
- logger.debug(`[BackendSessionAdapter] Flushed ${batch.length} frame(s)`);
956
+ __DEV__ && logger.debug(`[BackendSessionAdapter] Flushed ${batch.length} frame(s)`);
957
957
  // Delivered — the durable snapshot (if any) is now redundant. Clear it once
958
958
  // the in-memory buffer is fully drained so a later kill can't replay
959
959
  // already-uploaded frames.
@@ -1054,13 +1054,13 @@ export class BackendSessionAdapter implements SessionTransport {
1054
1054
  batch: Array<{ frame: ReplayFrame; imageData: string }>,
1055
1055
  ): Promise<void> {
1056
1056
  if (batch.length === 0) return;
1057
- logger.info(`[replay.sdk.frame] backend frame upload started`, { count: batch.length });
1057
+ __DEV__ && logger.info(`[replay.sdk.frame] backend frame upload started`, { count: batch.length });
1058
1058
 
1059
1059
  // Object-storage path: presign → PUT bytes → post key-only metadata.
1060
1060
  if (this.objectStorageActive && this.config.clientKey) {
1061
1061
  const result = await this._uploadFramesViaStorage(sessionId, batch);
1062
1062
  if (result === 'sent') {
1063
- logger.info(`[replay.sdk.frame] backend frame upload success (object storage)`);
1063
+ __DEV__ && logger.info(`[replay.sdk.frame] backend frame upload success (object storage)`);
1064
1064
  return;
1065
1065
  }
1066
1066
  // 'disabled' → storage not configured server-side; fall through to inline.
@@ -1072,7 +1072,7 @@ export class BackendSessionAdapter implements SessionTransport {
1072
1072
  ? ENDPOINTS.INGESTION_FRAMES(sessionId)
1073
1073
  : `/replay/sessions/${sessionId}/frames`;
1074
1074
  await this._post(framesEndpoint, { frames });
1075
- logger.info(`[replay.sdk.frame] backend frame upload success`);
1075
+ __DEV__ && logger.info(`[replay.sdk.frame] backend frame upload success`);
1076
1076
  }
1077
1077
 
1078
1078
  // ─── Cross-kill frame recovery ──────────────────────────────────────
@@ -1212,7 +1212,7 @@ export class BackendSessionAdapter implements SessionTransport {
1212
1212
  return;
1213
1213
  }
1214
1214
 
1215
- logger.info(`[replay.sdk.frame] recovering ${items.length} frame(s) for prior session ${sessionId}`);
1215
+ __DEV__ && logger.info(`[replay.sdk.frame] recovering ${items.length} frame(s) for prior session ${sessionId}`);
1216
1216
  /**
1217
1217
  * DELETE ONLY WHAT WAS ACCEPTED.
1218
1218
  *
@@ -1291,7 +1291,7 @@ export class BackendSessionAdapter implements SessionTransport {
1291
1291
  const events = batch.map(e => this._leanEvent(e, e.sessionId));
1292
1292
 
1293
1293
  try {
1294
- logger.info(`[replay.sdk.event] backend event upload started`, { count: batch.length });
1294
+ __DEV__ && logger.info(`[replay.sdk.event] backend event upload started`, { count: batch.length });
1295
1295
  // Durable native outbox owns delivery when active (no duplicate JS POST).
1296
1296
  // The native enqueue is NOT gated on row-readiness: it writes to disk and its
1297
1297
  // uploader handles ordering/retry, so it must accept data even while offline.
@@ -1305,8 +1305,8 @@ export class BackendSessionAdapter implements SessionTransport {
1305
1305
  eventsEndpoint,
1306
1306
  { events },
1307
1307
  );
1308
- logger.info(`[replay.sdk.event] backend event upload success`);
1309
- logger.debug(`[BackendSessionAdapter] Flushed ${batch.length} event(s)`);
1308
+ __DEV__ && logger.info(`[replay.sdk.event] backend event upload success`);
1309
+ __DEV__ && logger.debug(`[BackendSessionAdapter] Flushed ${batch.length} event(s)`);
1310
1310
  } catch (err) {
1311
1311
  if (BackendSessionAdapter._isPermanentHttpError(err)) return;
1312
1312
  logger.warn(`[replay.sdk.error] backend event upload failure`, { count: batch.length });
@@ -11,7 +11,9 @@
11
11
  */
12
12
 
13
13
  import type { DebugTransport } from '../../debug/transport';
14
- import { PROTOCOL_VERSION } from '../../debug/protocol';
14
+ // The SDK-owned constant, not the debug/protocol shim — the shim re-exports from the vendored
15
+ // schema module, which would pull every desktop wire-message schema into production bundles.
16
+ import { PROTOCOL_VERSION } from '../../core/constants/protocol';
15
17
  import { logger } from '../../core/logger/internalLogger';
16
18
  import type {
17
19
  SessionTransport,
@@ -96,7 +98,7 @@ export class DesktopSessionTransport implements SessionTransport {
96
98
  private _send(name: string, data: Record<string, unknown>): void {
97
99
  try {
98
100
  if (this.transport.getState() !== 'connected') {
99
- logger.debug(`[DesktopSessionTransport] Not connected, buffering: ${name}`);
101
+ __DEV__ && logger.debug(`[DesktopSessionTransport] Not connected, buffering: ${name}`);
100
102
  }
101
103
 
102
104
  const msg = {
@@ -206,7 +206,7 @@ export class JourneyEventPipeline {
206
206
  if (evKey === key && (now - ev.ts) < this.config.dedupeWindowMs) {
207
207
  ev.payload = opts?.payload;
208
208
  this.lastEventConfidence = (opts?.payload as any)?.confidence ?? null;
209
- logger.debug('[JourneyEventPipeline] replaced low-confidence event with native-high');
209
+ __DEV__ && logger.debug('[JourneyEventPipeline] replaced low-confidence event with native-high');
210
210
  // Re-emit so transport receives the corrected coordinates.
211
211
  // Backend uses upsert on eventId, so this overwrites the stale record.
212
212
  try { this.onEmit?.(ev); } catch { /* transport must not crash pipeline */ }
@@ -350,10 +350,10 @@ export class ReplayCaptureManager {
350
350
  this.frequencyTimer = setInterval(() => {
351
351
  this.triggerCapture('frequency').catch(() => { });
352
352
  }, intervalMs);
353
- logger.debug(`[ReplayCaptureManager] Frequency mode: every ${intervalMs}ms`);
353
+ __DEV__ && logger.debug(`[ReplayCaptureManager] Frequency mode: every ${intervalMs}ms`);
354
354
  }
355
355
 
356
- logger.debug(`[ReplayCaptureManager] Started (mode=${this.config.captureMode})`);
356
+ __DEV__ && logger.debug(`[ReplayCaptureManager] Started (mode=${this.config.captureMode})`);
357
357
  }
358
358
 
359
359
  /** Stop capture — cancels ALL pending timers and increments generation */
@@ -408,7 +408,7 @@ export class ReplayCaptureManager {
408
408
  // Clear dedup state
409
409
  this.lastCaptureIntent = null;
410
410
 
411
- logger.debug('[ReplayCaptureManager] Stopped (all timers cancelled, generation incremented)');
411
+ __DEV__ && logger.debug('[ReplayCaptureManager] Stopped (all timers cancelled, generation incremented)');
412
412
  }
413
413
 
414
414
  /** Notify of a screen change — triggers cancellable delayed capture */
@@ -450,7 +450,7 @@ export class ReplayCaptureManager {
450
450
  this.pendingInteractionTimeout = null;
451
451
  this.pendingInteractionPoint = undefined;
452
452
  this.pendingInteractionScreen = undefined;
453
- logger.debug(
453
+ __DEV__ && logger.debug(
454
454
  `[ReplayCaptureManager] Pending interaction absorbed by navigation to ${screenName}`,
455
455
  );
456
456
  }
@@ -470,7 +470,7 @@ export class ReplayCaptureManager {
470
470
  absorbedInteractionPoint = stale.interactionPoint;
471
471
  // Evict the stale frame from the frames list
472
472
  this.frames = this.frames.filter(f => f.frameId !== stale.frameId);
473
- logger.debug(
473
+ __DEV__ && logger.debug(
474
474
  `[ReplayCaptureManager] Late absorption: evicted stale interaction frame ` +
475
475
  `${stale.frameId} on ${stale.screen}, navigation to ${screenName}`,
476
476
  );
@@ -490,7 +490,7 @@ export class ReplayCaptureManager {
490
490
  if (this._inFlightInteractionPoint) {
491
491
  absorbedInteractionPoint = this._inFlightInteractionPoint;
492
492
  }
493
- logger.debug(
493
+ __DEV__ && logger.debug(
494
494
  `[ReplayCaptureManager] In-flight interaction suppressed by navigation to ${screenName}`,
495
495
  );
496
496
  }
@@ -531,7 +531,7 @@ export class ReplayCaptureManager {
531
531
  // Semantic dedup: if a navigation capture is pending for the SAME screen,
532
532
  // the navigation frame will represent the post-interaction state.
533
533
  if (this.pendingNavTimeout && this.pendingNavScreen === screen) {
534
- logger.debug('[ReplayCaptureManager] Interaction suppressed — navigation pending for same screen');
534
+ __DEV__ && logger.debug('[ReplayCaptureManager] Interaction suppressed — navigation pending for same screen');
535
535
  return;
536
536
  }
537
537
 
@@ -591,7 +591,7 @@ export class ReplayCaptureManager {
591
591
  clearTimeout(this.pendingNavTimeout);
592
592
  this.pendingNavTimeout = null;
593
593
  this.pendingNavScreen = null;
594
- logger.debug('[ReplayCaptureManager] Navigation capture cancelled — loading-end supersedes for same screen');
594
+ __DEV__ && logger.debug('[ReplayCaptureManager] Navigation capture cancelled — loading-end supersedes for same screen');
595
595
  }
596
596
 
597
597
  // Track which screen this loading capture is for
@@ -674,7 +674,7 @@ export class ReplayCaptureManager {
674
674
 
675
675
  // Same reason + same screen within cooldown → semantic duplicate
676
676
  if (sameReason && sameScreen && withinCooldown) {
677
- logger.debug(
677
+ __DEV__ && logger.debug(
678
678
  `[ReplayCaptureManager] Semantic dedup: ${reason}@${screenName} suppressed ` +
679
679
  `(same intent within ${SAME_INTENT_COOLDOWN_MS}ms)`,
680
680
  );
@@ -739,7 +739,7 @@ export class ReplayCaptureManager {
739
739
  if (this._suppressInFlightInteraction) {
740
740
  this._suppressInFlightInteraction = false;
741
741
  discardStaged();
742
- logger.debug('[ReplayCaptureManager] In-flight interaction suppressed — navigation arrived during capture');
742
+ __DEV__ && logger.debug('[ReplayCaptureManager] In-flight interaction suppressed — navigation arrived during capture');
743
743
  return null;
744
744
  }
745
745
  }
@@ -748,7 +748,7 @@ export class ReplayCaptureManager {
748
748
  // discard the result to prevent stale frames
749
749
  if (gen !== this.captureGeneration) {
750
750
  discardStaged();
751
- logger.debug('[ReplayCaptureManager] Stale capture discarded (generation mismatch)');
751
+ __DEV__ && logger.debug('[ReplayCaptureManager] Stale capture discarded (generation mismatch)');
752
752
  return null;
753
753
  }
754
754
 
@@ -760,7 +760,7 @@ export class ReplayCaptureManager {
760
760
  if (!result) {
761
761
  // Native capture unavailable — log warning, return null
762
762
  // NO JS fallback — this is by design
763
- logger.debug('[ReplayCaptureManager] Native capture returned null — frame not captured');
763
+ __DEV__ && logger.debug('[ReplayCaptureManager] Native capture returned null — frame not captured');
764
764
  return null;
765
765
  }
766
766
 
@@ -784,7 +784,7 @@ export class ReplayCaptureManager {
784
784
  const changeDetection = this.config.changeDetection !== false;
785
785
  if (changeDetection && reason === 'frequency' && !changed && !heartbeatDue) {
786
786
  discardStaged();
787
- logger.debug('[ReplayCaptureManager] Change-trigger suppressed identical frequency frame');
787
+ __DEV__ && logger.debug('[ReplayCaptureManager] Change-trigger suppressed identical frequency frame');
788
788
  return null;
789
789
  }
790
790
 
@@ -891,7 +891,7 @@ export class ReplayCaptureManager {
891
891
  try {
892
892
  const committed = await this.outboxCapture?.commit(meta);
893
893
  if (!committed) {
894
- logger.debug('[ReplayCaptureManager] Outbox commit failed — frame staged but not uploadable');
894
+ __DEV__ && logger.debug('[ReplayCaptureManager] Outbox commit failed — frame staged but not uploadable');
895
895
  }
896
896
  } catch {
897
897
  // Commit failure must not crash capture; orphan is swept later.