@userflow-tech/react-native 0.2.0 → 0.3.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 (966) hide show
  1. package/README.md +435 -134
  2. package/app.plugin.js +11 -3
  3. package/babel-plugin/index.d.ts.map +1 -1
  4. package/babel-plugin/index.js +53 -6
  5. package/babel-plugin/index.js.map +1 -1
  6. package/babel-plugin.js +11 -3
  7. package/docs/anchoring.md +58 -42
  8. package/docs/deep-linking.md +70 -33
  9. package/docs/isolation.md +75 -0
  10. package/docs/troubleshooting.md +103 -44
  11. package/docs/webview-custom-banner-poc.md +64 -0
  12. package/expo-plugin/hostDependencyWarnings.d.ts +18 -0
  13. package/expo-plugin/hostDependencyWarnings.d.ts.map +1 -0
  14. package/expo-plugin/hostDependencyWarnings.js +91 -0
  15. package/expo-plugin/hostDependencyWarnings.js.map +1 -0
  16. package/expo-plugin/withUserflow.d.ts +3 -2
  17. package/expo-plugin/withUserflow.d.ts.map +1 -1
  18. package/expo-plugin/withUserflow.js +30 -8
  19. package/expo-plugin/withUserflow.js.map +1 -1
  20. package/lib/commonjs/anchors/AnchorRegistry.js +7 -0
  21. package/lib/commonjs/anchors/AnchorRegistry.js.map +1 -1
  22. package/lib/commonjs/anchors/AutoAnchorRegistry.js +37 -11
  23. package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
  24. package/lib/commonjs/anchors/elementConditionEvaluator.js +189 -55
  25. package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
  26. package/lib/commonjs/anchors/elementTapMonitor.js +92 -0
  27. package/lib/commonjs/anchors/elementTapMonitor.js.map +1 -0
  28. package/lib/commonjs/anchors/elementTargetMatch.js +85 -0
  29. package/lib/commonjs/anchors/elementTargetMatch.js.map +1 -0
  30. package/lib/commonjs/anchors/fiber/fiberPath.js +122 -0
  31. package/lib/commonjs/anchors/fiber/fiberPath.js.map +1 -0
  32. package/lib/commonjs/anchors/fiber/findAnchorFiber.js +122 -87
  33. package/lib/commonjs/anchors/fiber/findAnchorFiber.js.map +1 -1
  34. package/lib/commonjs/anchors/fiber/resolveFiberPath.js +220 -0
  35. package/lib/commonjs/anchors/fiber/resolveFiberPath.js.map +1 -0
  36. package/lib/commonjs/anchors/fiber/touchTargetFiber.js +105 -0
  37. package/lib/commonjs/anchors/fiber/touchTargetFiber.js.map +1 -0
  38. package/lib/commonjs/anchors/fiber/visibleRect.js +147 -0
  39. package/lib/commonjs/anchors/fiber/visibleRect.js.map +1 -0
  40. package/lib/commonjs/anchors/fiber/visibleScreens.js +73 -36
  41. package/lib/commonjs/anchors/fiber/visibleScreens.js.map +1 -1
  42. package/lib/commonjs/anchors/fiber/walkVisibleFibers.js +66 -0
  43. package/lib/commonjs/anchors/fiber/walkVisibleFibers.js.map +1 -0
  44. package/lib/commonjs/anchors/isInstanceOnVisibleScreen.js +51 -0
  45. package/lib/commonjs/anchors/isInstanceOnVisibleScreen.js.map +1 -0
  46. package/lib/commonjs/anchors/resolveAnchorHost.js +2 -1
  47. package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
  48. package/lib/commonjs/anchors/resolveAutoAnchorHost.js +26 -17
  49. package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -1
  50. package/lib/commonjs/anchors/resolveElementTargets.js +158 -0
  51. package/lib/commonjs/anchors/resolveElementTargets.js.map +1 -0
  52. package/lib/commonjs/anchors/semanticMatcher.js +26 -8
  53. package/lib/commonjs/anchors/semanticMatcher.js.map +1 -1
  54. package/lib/commonjs/anchors/targetPressMonitor.js +9 -3
  55. package/lib/commonjs/anchors/targetPressMonitor.js.map +1 -1
  56. package/lib/commonjs/anchors/useUserflowAnchor.js +1 -0
  57. package/lib/commonjs/anchors/useUserflowAnchor.js.map +1 -1
  58. package/lib/commonjs/anonymousId.js +19 -7
  59. package/lib/commonjs/anonymousId.js.map +1 -1
  60. package/lib/commonjs/authoring/ElementPickerOverlay.js +126 -50
  61. package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -1
  62. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +32 -10
  63. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -1
  64. package/lib/commonjs/authoring/chrome/ChromeButton.js +8 -3
  65. package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -1
  66. package/lib/commonjs/authoring/chrome/ChromeIcon.js +4 -0
  67. package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -1
  68. package/lib/commonjs/authoring/chrome/ChromeTopBar.js +23 -10
  69. package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -1
  70. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +19 -12
  71. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -1
  72. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +10 -0
  73. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -1
  74. package/lib/commonjs/authoring/chrome/icons/circle-exclamation.png +0 -0
  75. package/lib/commonjs/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
  76. package/lib/commonjs/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
  77. package/lib/commonjs/authoring/chrome/icons/triangle-exclamation.png +0 -0
  78. package/lib/commonjs/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
  79. package/lib/commonjs/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
  80. package/lib/commonjs/authoring/chrome/tokens.js +7 -6
  81. package/lib/commonjs/authoring/chrome/tokens.js.map +1 -1
  82. package/lib/commonjs/authoring/elementPickerController.js.map +1 -1
  83. package/lib/commonjs/authoring/fingerprintFromInstance.js +204 -4
  84. package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -1
  85. package/lib/commonjs/authoring/hitTest.js +264 -16
  86. package/lib/commonjs/authoring/hitTest.js.map +1 -1
  87. package/lib/commonjs/authoring/hostAtPoint.js +204 -0
  88. package/lib/commonjs/authoring/hostAtPoint.js.map +1 -0
  89. package/lib/commonjs/content/BannerStepButton.js +68 -0
  90. package/lib/commonjs/content/BannerStepButton.js.map +1 -0
  91. package/lib/commonjs/content/buttonAppearance.js +16 -0
  92. package/lib/commonjs/content/buttonAppearance.js.map +1 -1
  93. package/lib/commonjs/content/resolveBannerButtonChrome.js +44 -0
  94. package/lib/commonjs/content/resolveBannerButtonChrome.js.map +1 -0
  95. package/lib/commonjs/content/themeColor.js +15 -0
  96. package/lib/commonjs/content/themeColor.js.map +1 -1
  97. package/lib/commonjs/deepLinking.js +4 -4
  98. package/lib/commonjs/evalJs/EvalJsHost.js +244 -0
  99. package/lib/commonjs/evalJs/EvalJsHost.js.map +1 -0
  100. package/lib/commonjs/evalJs/bootstrap.js +84 -0
  101. package/lib/commonjs/evalJs/bootstrap.js.map +1 -0
  102. package/lib/commonjs/evalJs/bridgeMessages.js +143 -0
  103. package/lib/commonjs/evalJs/bridgeMessages.js.map +1 -0
  104. package/lib/commonjs/evalJs/evalJsBridge.js +31 -0
  105. package/lib/commonjs/evalJs/evalJsBridge.js.map +1 -0
  106. package/lib/commonjs/evalJs/evalJsController.js +124 -0
  107. package/lib/commonjs/evalJs/evalJsController.js.map +1 -0
  108. package/lib/commonjs/evalJs/getWebView.js +81 -0
  109. package/lib/commonjs/evalJs/getWebView.js.map +1 -0
  110. package/lib/commonjs/evalJs/injectEvalPending.js +19 -0
  111. package/lib/commonjs/evalJs/injectEvalPending.js.map +1 -0
  112. package/lib/commonjs/evalJs/types.js +2 -0
  113. package/lib/commonjs/evalJs/types.js.map +1 -0
  114. package/lib/commonjs/evalJs/useEvalJsWebViewInjection.js +40 -0
  115. package/lib/commonjs/evalJs/useEvalJsWebViewInjection.js.map +1 -0
  116. package/lib/commonjs/expo-router/index.js +19 -0
  117. package/lib/commonjs/expo-router/index.js.map +1 -1
  118. package/lib/commonjs/expo-router/redirectSystemPath.js +75 -0
  119. package/lib/commonjs/expo-router/redirectSystemPath.js.map +1 -0
  120. package/lib/commonjs/expo-router/useUserflowExpoRouter.js +2 -2
  121. package/lib/commonjs/index.js +123 -43
  122. package/lib/commonjs/index.js.map +1 -1
  123. package/lib/commonjs/installCheck.js +151 -0
  124. package/lib/commonjs/installCheck.js.map +1 -0
  125. package/lib/commonjs/lifecycle.js.map +1 -1
  126. package/lib/commonjs/navigation/WithUserflowReactNavigation.js +14 -11
  127. package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
  128. package/lib/commonjs/navigation/openFlowNavigateUrl.js +12 -5
  129. package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -1
  130. package/lib/commonjs/pairing/PairingController.js +245 -27
  131. package/lib/commonjs/pairing/PairingController.js.map +1 -1
  132. package/lib/commonjs/pairing/PreviewModeBanner.js +55 -16
  133. package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
  134. package/lib/commonjs/pairing/deepLink.js +22 -5
  135. package/lib/commonjs/pairing/deepLink.js.map +1 -1
  136. package/lib/commonjs/pairing/deviceId.js +50 -0
  137. package/lib/commonjs/pairing/deviceId.js.map +1 -0
  138. package/lib/commonjs/pairing/diagnostics.js +5 -4
  139. package/lib/commonjs/pairing/diagnostics.js.map +1 -1
  140. package/lib/commonjs/pairing/tokenStorage.js +47 -7
  141. package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
  142. package/lib/commonjs/pairing/usePairingState.js +3 -1
  143. package/lib/commonjs/pairing/usePairingState.js.map +1 -1
  144. package/lib/commonjs/pairing/usePreviewBarHold.js +139 -0
  145. package/lib/commonjs/pairing/usePreviewBarHold.js.map +1 -0
  146. package/lib/commonjs/runtime/BannerHost.js +96 -0
  147. package/lib/commonjs/runtime/BannerHost.js.map +1 -0
  148. package/lib/commonjs/runtime/EmbedBannerPlaceholder.js +99 -0
  149. package/lib/commonjs/runtime/EmbedBannerPlaceholder.js.map +1 -0
  150. package/lib/commonjs/runtime/SdkErrorBoundary.js +61 -0
  151. package/lib/commonjs/runtime/SdkErrorBoundary.js.map +1 -0
  152. package/lib/commonjs/runtime/TargetPressBridge.js +31 -13
  153. package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
  154. package/lib/commonjs/runtime/UserflowOverlay.js +97 -0
  155. package/lib/commonjs/runtime/UserflowOverlay.js.map +1 -0
  156. package/lib/commonjs/runtime/UserflowProvider.js +138 -65
  157. package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
  158. package/lib/commonjs/runtime/bannerEngine.js +63 -0
  159. package/lib/commonjs/runtime/bannerEngine.js.map +1 -0
  160. package/lib/commonjs/runtime/bannerEngineContext.js +11 -0
  161. package/lib/commonjs/runtime/bannerEngineContext.js.map +1 -0
  162. package/lib/commonjs/runtime/bannerPlacement.js +37 -0
  163. package/lib/commonjs/runtime/bannerPlacement.js.map +1 -0
  164. package/lib/commonjs/runtime/embedBannerRegistry.js +30 -0
  165. package/lib/commonjs/runtime/embedBannerRegistry.js.map +1 -0
  166. package/lib/commonjs/runtime/flowEngine.js +75 -3
  167. package/lib/commonjs/runtime/flowEngine.js.map +1 -1
  168. package/lib/commonjs/runtime/isolateCall.js +48 -0
  169. package/lib/commonjs/runtime/isolateCall.js.map +1 -0
  170. package/lib/commonjs/runtime/reportSdkError.js +19 -0
  171. package/lib/commonjs/runtime/reportSdkError.js.map +1 -0
  172. package/lib/commonjs/runtime/useBannerSession.js +37 -0
  173. package/lib/commonjs/runtime/useBannerSession.js.map +1 -0
  174. package/lib/commonjs/screenTracker.js +34 -9
  175. package/lib/commonjs/screenTracker.js.map +1 -1
  176. package/lib/commonjs/storage/asyncStorage.js +67 -0
  177. package/lib/commonjs/storage/asyncStorage.js.map +1 -0
  178. package/lib/commonjs/surfaces/BannerBar.js +160 -0
  179. package/lib/commonjs/surfaces/BannerBar.js.map +1 -0
  180. package/lib/commonjs/surfaces/BannerSurface.js +78 -0
  181. package/lib/commonjs/surfaces/BannerSurface.js.map +1 -0
  182. package/lib/commonjs/surfaces/MadeWithUserflow.js +12 -8
  183. package/lib/commonjs/surfaces/MadeWithUserflow.js.map +1 -1
  184. package/lib/commonjs/surfaces/ModalSurface.js +1 -1
  185. package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
  186. package/lib/commonjs/surfaces/TooltipSurface.js +17 -1
  187. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
  188. package/lib/commonjs/surfaces/bannerBarLayout.js +88 -0
  189. package/lib/commonjs/surfaces/bannerBarLayout.js.map +1 -0
  190. package/lib/commonjs/surfaces/bannerBarTokens.js +42 -0
  191. package/lib/commonjs/surfaces/bannerBarTokens.js.map +1 -0
  192. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js +277 -0
  193. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -0
  194. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunEvalJs.js +46 -0
  195. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunEvalJs.js.map +1 -0
  196. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunSession.js +26 -0
  197. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunSession.js.map +1 -0
  198. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js +41 -0
  199. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -0
  200. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js +74 -0
  201. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -0
  202. package/lib/commonjs/surfaces/bannerWebView/bannerWebFrameCss.js +152 -0
  203. package/lib/commonjs/surfaces/bannerWebView/bannerWebFrameCss.js.map +1 -0
  204. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js +148 -0
  205. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -0
  206. package/lib/commonjs/surfaces/bannerWebView/buttonClassName.js +13 -0
  207. package/lib/commonjs/surfaces/bannerWebView/buttonClassName.js.map +1 -0
  208. package/lib/commonjs/surfaces/bannerWebView/resolveCdnHost.js +49 -0
  209. package/lib/commonjs/surfaces/bannerWebView/resolveCdnHost.js.map +1 -0
  210. package/lib/commonjs/surfaces/bannerWebView/richContentDocToHtml.js +83 -0
  211. package/lib/commonjs/surfaces/bannerWebView/richContentDocToHtml.js.map +1 -0
  212. package/lib/commonjs/surfaces/resolveBannerTheme.js +22 -0
  213. package/lib/commonjs/surfaces/resolveBannerTheme.js.map +1 -0
  214. package/lib/commonjs/surfaces/safeArea.js +76 -13
  215. package/lib/commonjs/surfaces/safeArea.js.map +1 -1
  216. package/lib/commonjs/version.js +1 -1
  217. package/lib/module/anchors/AnchorRegistry.js +7 -0
  218. package/lib/module/anchors/AnchorRegistry.js.map +1 -1
  219. package/lib/module/anchors/AutoAnchorRegistry.js +37 -11
  220. package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
  221. package/lib/module/anchors/elementConditionEvaluator.js +189 -55
  222. package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
  223. package/lib/module/anchors/elementTapMonitor.js +87 -0
  224. package/lib/module/anchors/elementTapMonitor.js.map +1 -0
  225. package/lib/module/anchors/elementTargetMatch.js +78 -0
  226. package/lib/module/anchors/elementTargetMatch.js.map +1 -0
  227. package/lib/module/anchors/fiber/fiberPath.js +118 -0
  228. package/lib/module/anchors/fiber/fiberPath.js.map +1 -0
  229. package/lib/module/anchors/fiber/findAnchorFiber.js +120 -87
  230. package/lib/module/anchors/fiber/findAnchorFiber.js.map +1 -1
  231. package/lib/module/anchors/fiber/resolveFiberPath.js +215 -0
  232. package/lib/module/anchors/fiber/resolveFiberPath.js.map +1 -0
  233. package/lib/module/anchors/fiber/touchTargetFiber.js +100 -0
  234. package/lib/module/anchors/fiber/touchTargetFiber.js.map +1 -0
  235. package/lib/module/anchors/fiber/visibleRect.js +139 -0
  236. package/lib/module/anchors/fiber/visibleRect.js.map +1 -0
  237. package/lib/module/anchors/fiber/visibleScreens.js +73 -37
  238. package/lib/module/anchors/fiber/visibleScreens.js.map +1 -1
  239. package/lib/module/anchors/fiber/walkVisibleFibers.js +61 -0
  240. package/lib/module/anchors/fiber/walkVisibleFibers.js.map +1 -0
  241. package/lib/module/anchors/isInstanceOnVisibleScreen.js +46 -0
  242. package/lib/module/anchors/isInstanceOnVisibleScreen.js.map +1 -0
  243. package/lib/module/anchors/resolveAnchorHost.js +2 -1
  244. package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
  245. package/lib/module/anchors/resolveAutoAnchorHost.js +25 -18
  246. package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -1
  247. package/lib/module/anchors/resolveElementTargets.js +152 -0
  248. package/lib/module/anchors/resolveElementTargets.js.map +1 -0
  249. package/lib/module/anchors/semanticMatcher.js +26 -9
  250. package/lib/module/anchors/semanticMatcher.js.map +1 -1
  251. package/lib/module/anchors/targetPressMonitor.js +8 -3
  252. package/lib/module/anchors/targetPressMonitor.js.map +1 -1
  253. package/lib/module/anchors/useUserflowAnchor.js +1 -0
  254. package/lib/module/anchors/useUserflowAnchor.js.map +1 -1
  255. package/lib/module/anonymousId.js +18 -6
  256. package/lib/module/anonymousId.js.map +1 -1
  257. package/lib/module/authoring/ElementPickerOverlay.js +128 -52
  258. package/lib/module/authoring/ElementPickerOverlay.js.map +1 -1
  259. package/lib/module/authoring/chrome/ChromeBottomSheet.js +32 -10
  260. package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -1
  261. package/lib/module/authoring/chrome/ChromeButton.js +8 -3
  262. package/lib/module/authoring/chrome/ChromeButton.js.map +1 -1
  263. package/lib/module/authoring/chrome/ChromeIcon.js +4 -0
  264. package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -1
  265. package/lib/module/authoring/chrome/ChromeTopBar.js +23 -10
  266. package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -1
  267. package/lib/module/authoring/chrome/DoubleTapBridge.js +19 -12
  268. package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -1
  269. package/lib/module/authoring/chrome/doubleTapMonitor.js +10 -0
  270. package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -1
  271. package/lib/module/authoring/chrome/icons/circle-exclamation.png +0 -0
  272. package/lib/module/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
  273. package/lib/module/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
  274. package/lib/module/authoring/chrome/icons/triangle-exclamation.png +0 -0
  275. package/lib/module/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
  276. package/lib/module/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
  277. package/lib/module/authoring/chrome/tokens.js +7 -6
  278. package/lib/module/authoring/chrome/tokens.js.map +1 -1
  279. package/lib/module/authoring/elementPickerController.js.map +1 -1
  280. package/lib/module/authoring/fingerprintFromInstance.js +198 -4
  281. package/lib/module/authoring/fingerprintFromInstance.js.map +1 -1
  282. package/lib/module/authoring/hitTest.js +264 -18
  283. package/lib/module/authoring/hitTest.js.map +1 -1
  284. package/lib/module/authoring/hostAtPoint.js +199 -0
  285. package/lib/module/authoring/hostAtPoint.js.map +1 -0
  286. package/lib/module/content/BannerStepButton.js +63 -0
  287. package/lib/module/content/BannerStepButton.js.map +1 -0
  288. package/lib/module/content/buttonAppearance.js +14 -0
  289. package/lib/module/content/buttonAppearance.js.map +1 -1
  290. package/lib/module/content/resolveBannerButtonChrome.js +41 -0
  291. package/lib/module/content/resolveBannerButtonChrome.js.map +1 -0
  292. package/lib/module/content/themeColor.js +14 -0
  293. package/lib/module/content/themeColor.js.map +1 -1
  294. package/lib/module/deepLinking.js +4 -4
  295. package/lib/module/evalJs/EvalJsHost.js +239 -0
  296. package/lib/module/evalJs/EvalJsHost.js.map +1 -0
  297. package/lib/module/evalJs/bootstrap.js +76 -0
  298. package/lib/module/evalJs/bootstrap.js.map +1 -0
  299. package/lib/module/evalJs/bridgeMessages.js +139 -0
  300. package/lib/module/evalJs/bridgeMessages.js.map +1 -0
  301. package/lib/module/evalJs/evalJsBridge.js +25 -0
  302. package/lib/module/evalJs/evalJsBridge.js.map +1 -0
  303. package/lib/module/evalJs/evalJsController.js +119 -0
  304. package/lib/module/evalJs/evalJsController.js.map +1 -0
  305. package/lib/module/evalJs/getWebView.js +76 -0
  306. package/lib/module/evalJs/getWebView.js.map +1 -0
  307. package/lib/module/evalJs/injectEvalPending.js +15 -0
  308. package/lib/module/evalJs/injectEvalPending.js.map +1 -0
  309. package/lib/module/evalJs/types.js +2 -0
  310. package/lib/module/evalJs/types.js.map +1 -0
  311. package/lib/module/evalJs/useEvalJsWebViewInjection.js +35 -0
  312. package/lib/module/evalJs/useEvalJsWebViewInjection.js.map +1 -0
  313. package/lib/module/expo-router/index.js +1 -0
  314. package/lib/module/expo-router/index.js.map +1 -1
  315. package/lib/module/expo-router/redirectSystemPath.js +70 -0
  316. package/lib/module/expo-router/redirectSystemPath.js.map +1 -0
  317. package/lib/module/expo-router/useUserflowExpoRouter.js +2 -2
  318. package/lib/module/index.js +119 -45
  319. package/lib/module/index.js.map +1 -1
  320. package/lib/module/installCheck.js +139 -0
  321. package/lib/module/installCheck.js.map +1 -0
  322. package/lib/module/lifecycle.js.map +1 -1
  323. package/lib/module/navigation/WithUserflowReactNavigation.js +14 -11
  324. package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
  325. package/lib/module/navigation/openFlowNavigateUrl.js +12 -5
  326. package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -1
  327. package/lib/module/pairing/PairingController.js +245 -27
  328. package/lib/module/pairing/PairingController.js.map +1 -1
  329. package/lib/module/pairing/PreviewModeBanner.js +54 -16
  330. package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
  331. package/lib/module/pairing/deepLink.js +21 -5
  332. package/lib/module/pairing/deepLink.js.map +1 -1
  333. package/lib/module/pairing/deviceId.js +45 -0
  334. package/lib/module/pairing/deviceId.js.map +1 -0
  335. package/lib/module/pairing/diagnostics.js +5 -4
  336. package/lib/module/pairing/diagnostics.js.map +1 -1
  337. package/lib/module/pairing/tokenStorage.js +47 -7
  338. package/lib/module/pairing/tokenStorage.js.map +1 -1
  339. package/lib/module/pairing/usePairingState.js +3 -1
  340. package/lib/module/pairing/usePairingState.js.map +1 -1
  341. package/lib/module/pairing/usePreviewBarHold.js +134 -0
  342. package/lib/module/pairing/usePreviewBarHold.js.map +1 -0
  343. package/lib/module/runtime/BannerHost.js +92 -0
  344. package/lib/module/runtime/BannerHost.js.map +1 -0
  345. package/lib/module/runtime/EmbedBannerPlaceholder.js +94 -0
  346. package/lib/module/runtime/EmbedBannerPlaceholder.js.map +1 -0
  347. package/lib/module/runtime/SdkErrorBoundary.js +55 -0
  348. package/lib/module/runtime/SdkErrorBoundary.js.map +1 -0
  349. package/lib/module/runtime/TargetPressBridge.js +31 -13
  350. package/lib/module/runtime/TargetPressBridge.js.map +1 -1
  351. package/lib/module/runtime/UserflowOverlay.js +92 -0
  352. package/lib/module/runtime/UserflowOverlay.js.map +1 -0
  353. package/lib/module/runtime/UserflowProvider.js +139 -66
  354. package/lib/module/runtime/UserflowProvider.js.map +1 -1
  355. package/lib/module/runtime/bannerEngine.js +55 -0
  356. package/lib/module/runtime/bannerEngine.js.map +1 -0
  357. package/lib/module/runtime/bannerEngineContext.js +7 -0
  358. package/lib/module/runtime/bannerEngineContext.js.map +1 -0
  359. package/lib/module/runtime/bannerPlacement.js +30 -0
  360. package/lib/module/runtime/bannerPlacement.js.map +1 -0
  361. package/lib/module/runtime/embedBannerRegistry.js +24 -0
  362. package/lib/module/runtime/embedBannerRegistry.js.map +1 -0
  363. package/lib/module/runtime/flowEngine.js +72 -3
  364. package/lib/module/runtime/flowEngine.js.map +1 -1
  365. package/lib/module/runtime/isolateCall.js +43 -0
  366. package/lib/module/runtime/isolateCall.js.map +1 -0
  367. package/lib/module/runtime/reportSdkError.js +15 -0
  368. package/lib/module/runtime/reportSdkError.js.map +1 -0
  369. package/lib/module/runtime/useBannerSession.js +33 -0
  370. package/lib/module/runtime/useBannerSession.js.map +1 -0
  371. package/lib/module/screenTracker.js +33 -9
  372. package/lib/module/screenTracker.js.map +1 -1
  373. package/lib/module/storage/asyncStorage.js +61 -0
  374. package/lib/module/storage/asyncStorage.js.map +1 -0
  375. package/lib/module/surfaces/BannerBar.js +155 -0
  376. package/lib/module/surfaces/BannerBar.js.map +1 -0
  377. package/lib/module/surfaces/BannerSurface.js +72 -0
  378. package/lib/module/surfaces/BannerSurface.js.map +1 -0
  379. package/lib/module/surfaces/MadeWithUserflow.js +11 -7
  380. package/lib/module/surfaces/MadeWithUserflow.js.map +1 -1
  381. package/lib/module/surfaces/ModalSurface.js +1 -1
  382. package/lib/module/surfaces/ModalSurface.js.map +1 -1
  383. package/lib/module/surfaces/TooltipSurface.js +17 -1
  384. package/lib/module/surfaces/TooltipSurface.js.map +1 -1
  385. package/lib/module/surfaces/bannerBarLayout.js +69 -0
  386. package/lib/module/surfaces/bannerBarLayout.js.map +1 -0
  387. package/lib/module/surfaces/bannerBarTokens.js +37 -0
  388. package/lib/module/surfaces/bannerBarTokens.js.map +1 -0
  389. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js +272 -0
  390. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -0
  391. package/lib/module/surfaces/bannerWebView/bannerAutoRunEvalJs.js +42 -0
  392. package/lib/module/surfaces/bannerWebView/bannerAutoRunEvalJs.js.map +1 -0
  393. package/lib/module/surfaces/bannerWebView/bannerAutoRunSession.js +19 -0
  394. package/lib/module/surfaces/bannerWebView/bannerAutoRunSession.js.map +1 -0
  395. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js +35 -0
  396. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -0
  397. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js +69 -0
  398. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -0
  399. package/lib/module/surfaces/bannerWebView/bannerWebFrameCss.js +148 -0
  400. package/lib/module/surfaces/bannerWebView/bannerWebFrameCss.js.map +1 -0
  401. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js +143 -0
  402. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -0
  403. package/lib/module/surfaces/bannerWebView/buttonClassName.js +9 -0
  404. package/lib/module/surfaces/bannerWebView/buttonClassName.js.map +1 -0
  405. package/lib/module/surfaces/bannerWebView/resolveCdnHost.js +42 -0
  406. package/lib/module/surfaces/bannerWebView/resolveCdnHost.js.map +1 -0
  407. package/lib/module/surfaces/bannerWebView/richContentDocToHtml.js +79 -0
  408. package/lib/module/surfaces/bannerWebView/richContentDocToHtml.js.map +1 -0
  409. package/lib/module/surfaces/resolveBannerTheme.js +16 -0
  410. package/lib/module/surfaces/resolveBannerTheme.js.map +1 -0
  411. package/lib/module/surfaces/safeArea.js +72 -13
  412. package/lib/module/surfaces/safeArea.js.map +1 -1
  413. package/lib/module/version.js +1 -1
  414. package/lib/typescript/commonjs/src/anchors/AnchorRegistry.d.ts +7 -0
  415. package/lib/typescript/commonjs/src/anchors/AnchorRegistry.d.ts.map +1 -1
  416. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +14 -0
  417. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  418. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +12 -16
  419. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  420. package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts +36 -0
  421. package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts.map +1 -0
  422. package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts +20 -0
  423. package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts.map +1 -0
  424. package/lib/typescript/commonjs/src/anchors/fiber/fiberPath.d.ts +12 -0
  425. package/lib/typescript/commonjs/src/anchors/fiber/fiberPath.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts +21 -8
  427. package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -1
  428. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts +24 -0
  429. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -0
  430. package/lib/typescript/commonjs/src/anchors/fiber/touchTargetFiber.d.ts +24 -0
  431. package/lib/typescript/commonjs/src/anchors/fiber/touchTargetFiber.d.ts.map +1 -0
  432. package/lib/typescript/commonjs/src/anchors/fiber/visibleRect.d.ts +32 -0
  433. package/lib/typescript/commonjs/src/anchors/fiber/visibleRect.d.ts.map +1 -0
  434. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts +6 -1
  435. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  436. package/lib/typescript/commonjs/src/anchors/fiber/walkVisibleFibers.d.ts +20 -0
  437. package/lib/typescript/commonjs/src/anchors/fiber/walkVisibleFibers.d.ts.map +1 -0
  438. package/lib/typescript/commonjs/src/anchors/isInstanceOnVisibleScreen.d.ts +19 -0
  439. package/lib/typescript/commonjs/src/anchors/isInstanceOnVisibleScreen.d.ts.map +1 -0
  440. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +2 -1
  441. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  442. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +10 -1
  443. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  444. package/lib/typescript/commonjs/src/anchors/resolveElementTargets.d.ts +39 -0
  445. package/lib/typescript/commonjs/src/anchors/resolveElementTargets.d.ts.map +1 -0
  446. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +6 -4
  447. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -1
  448. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts +2 -0
  449. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts.map +1 -1
  450. package/lib/typescript/commonjs/src/anchors/useUserflowAnchor.d.ts.map +1 -1
  451. package/lib/typescript/commonjs/src/anonymousId.d.ts +3 -0
  452. package/lib/typescript/commonjs/src/anonymousId.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +1 -0
  454. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -1
  455. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +14 -3
  456. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -1
  457. package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -1
  458. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +1 -1
  459. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -1
  460. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +12 -4
  461. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -1
  462. package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -1
  463. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +5 -0
  464. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +7 -6
  466. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -1
  467. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +2 -3
  468. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -1
  469. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +57 -2
  470. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  471. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +47 -3
  472. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -1
  473. package/lib/typescript/commonjs/src/authoring/hostAtPoint.d.ts +7 -0
  474. package/lib/typescript/commonjs/src/authoring/hostAtPoint.d.ts.map +1 -0
  475. package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts +14 -0
  476. package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts.map +1 -0
  477. package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts +4 -0
  478. package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts.map +1 -1
  479. package/lib/typescript/commonjs/src/content/resolveBannerButtonChrome.d.ts +8 -0
  480. package/lib/typescript/commonjs/src/content/resolveBannerButtonChrome.d.ts.map +1 -0
  481. package/lib/typescript/commonjs/src/content/themeColor.d.ts +2 -0
  482. package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
  483. package/lib/typescript/commonjs/src/content/types.d.ts +1 -0
  484. package/lib/typescript/commonjs/src/content/types.d.ts.map +1 -1
  485. package/lib/typescript/commonjs/src/deepLinking.d.ts +4 -4
  486. package/lib/typescript/commonjs/src/evalJs/EvalJsHost.d.ts +14 -0
  487. package/lib/typescript/commonjs/src/evalJs/EvalJsHost.d.ts.map +1 -0
  488. package/lib/typescript/commonjs/src/evalJs/bootstrap.d.ts +18 -0
  489. package/lib/typescript/commonjs/src/evalJs/bootstrap.d.ts.map +1 -0
  490. package/lib/typescript/commonjs/src/evalJs/bridgeMessages.d.ts +37 -0
  491. package/lib/typescript/commonjs/src/evalJs/bridgeMessages.d.ts.map +1 -0
  492. package/lib/typescript/commonjs/src/evalJs/evalJsBridge.d.ts +16 -0
  493. package/lib/typescript/commonjs/src/evalJs/evalJsBridge.d.ts.map +1 -0
  494. package/lib/typescript/commonjs/src/evalJs/evalJsController.d.ts +24 -0
  495. package/lib/typescript/commonjs/src/evalJs/evalJsController.d.ts.map +1 -0
  496. package/lib/typescript/commonjs/src/evalJs/getWebView.d.ts +64 -0
  497. package/lib/typescript/commonjs/src/evalJs/getWebView.d.ts.map +1 -0
  498. package/lib/typescript/commonjs/src/evalJs/injectEvalPending.d.ts +4 -0
  499. package/lib/typescript/commonjs/src/evalJs/injectEvalPending.d.ts.map +1 -0
  500. package/lib/typescript/commonjs/src/evalJs/types.d.ts +53 -0
  501. package/lib/typescript/commonjs/src/evalJs/types.d.ts.map +1 -0
  502. package/lib/typescript/commonjs/src/evalJs/useEvalJsWebViewInjection.d.ts +12 -0
  503. package/lib/typescript/commonjs/src/evalJs/useEvalJsWebViewInjection.d.ts.map +1 -0
  504. package/lib/typescript/commonjs/src/expo-router/index.d.ts +1 -0
  505. package/lib/typescript/commonjs/src/expo-router/index.d.ts.map +1 -1
  506. package/lib/typescript/commonjs/src/expo-router/redirectSystemPath.d.ts +50 -0
  507. package/lib/typescript/commonjs/src/expo-router/redirectSystemPath.d.ts.map +1 -0
  508. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts +2 -2
  509. package/lib/typescript/commonjs/src/index.d.ts +16 -1
  510. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  511. package/lib/typescript/commonjs/src/installCheck.d.ts +33 -0
  512. package/lib/typescript/commonjs/src/installCheck.d.ts.map +1 -0
  513. package/lib/typescript/commonjs/src/lifecycle.d.ts +4 -1
  514. package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
  515. package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  516. package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  517. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +71 -4
  518. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
  519. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +9 -1
  520. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  521. package/lib/typescript/commonjs/src/pairing/deepLink.d.ts +6 -2
  522. package/lib/typescript/commonjs/src/pairing/deepLink.d.ts.map +1 -1
  523. package/lib/typescript/commonjs/src/pairing/deviceId.d.ts +12 -0
  524. package/lib/typescript/commonjs/src/pairing/deviceId.d.ts.map +1 -0
  525. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +3 -2
  526. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
  527. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +14 -2
  528. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
  529. package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
  530. package/lib/typescript/commonjs/src/pairing/usePreviewBarHold.d.ts +19 -0
  531. package/lib/typescript/commonjs/src/pairing/usePreviewBarHold.d.ts.map +1 -0
  532. package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts +16 -0
  533. package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts.map +1 -0
  534. package/lib/typescript/commonjs/src/runtime/EmbedBannerPlaceholder.d.ts +18 -0
  535. package/lib/typescript/commonjs/src/runtime/EmbedBannerPlaceholder.d.ts.map +1 -0
  536. package/lib/typescript/commonjs/src/runtime/SdkErrorBoundary.d.ts +34 -0
  537. package/lib/typescript/commonjs/src/runtime/SdkErrorBoundary.d.ts.map +1 -0
  538. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +2 -1
  539. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
  540. package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts +15 -0
  541. package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts.map +1 -0
  542. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +9 -3
  543. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
  544. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts +12 -0
  545. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts.map +1 -0
  546. package/lib/typescript/commonjs/src/runtime/bannerEngineContext.d.ts +5 -0
  547. package/lib/typescript/commonjs/src/runtime/bannerEngineContext.d.ts.map +1 -0
  548. package/lib/typescript/commonjs/src/runtime/bannerPlacement.d.ts +12 -0
  549. package/lib/typescript/commonjs/src/runtime/bannerPlacement.d.ts.map +1 -0
  550. package/lib/typescript/commonjs/src/runtime/embedBannerRegistry.d.ts +5 -0
  551. package/lib/typescript/commonjs/src/runtime/embedBannerRegistry.d.ts.map +1 -0
  552. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts +25 -1
  553. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
  554. package/lib/typescript/commonjs/src/runtime/isolateCall.d.ts +20 -0
  555. package/lib/typescript/commonjs/src/runtime/isolateCall.d.ts.map +1 -0
  556. package/lib/typescript/commonjs/src/runtime/reportSdkError.d.ts +10 -0
  557. package/lib/typescript/commonjs/src/runtime/reportSdkError.d.ts.map +1 -0
  558. package/lib/typescript/commonjs/src/runtime/useBannerSession.d.ts +5 -0
  559. package/lib/typescript/commonjs/src/runtime/useBannerSession.d.ts.map +1 -0
  560. package/lib/typescript/commonjs/src/screenTracker.d.ts +7 -3
  561. package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
  562. package/lib/typescript/commonjs/src/storage/asyncStorage.d.ts +15 -0
  563. package/lib/typescript/commonjs/src/storage/asyncStorage.d.ts.map +1 -0
  564. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts +14 -0
  565. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts.map +1 -0
  566. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts +15 -0
  567. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts.map +1 -0
  568. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +10 -6
  569. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts.map +1 -1
  570. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
  571. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts +15 -0
  572. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts.map +1 -0
  573. package/lib/typescript/commonjs/src/surfaces/bannerBarTokens.d.ts +20 -0
  574. package/lib/typescript/commonjs/src/surfaces/bannerBarTokens.d.ts.map +1 -0
  575. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +10 -0
  576. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -0
  577. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts +7 -0
  578. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts.map +1 -0
  579. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts +6 -0
  580. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts.map +1 -0
  581. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +13 -0
  582. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -0
  583. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts +5 -0
  584. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -0
  585. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts +6 -0
  586. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts.map +1 -0
  587. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts +9 -0
  588. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -0
  589. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buttonClassName.d.ts +3 -0
  590. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buttonClassName.d.ts.map +1 -0
  591. package/lib/typescript/commonjs/src/surfaces/bannerWebView/resolveCdnHost.d.ts +10 -0
  592. package/lib/typescript/commonjs/src/surfaces/bannerWebView/resolveCdnHost.d.ts.map +1 -0
  593. package/lib/typescript/commonjs/src/surfaces/bannerWebView/richContentDocToHtml.d.ts +3 -0
  594. package/lib/typescript/commonjs/src/surfaces/bannerWebView/richContentDocToHtml.d.ts.map +1 -0
  595. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts +7 -0
  596. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts.map +1 -0
  597. package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts +9 -1
  598. package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts.map +1 -1
  599. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  600. package/lib/typescript/module/src/anchors/AnchorRegistry.d.ts +7 -0
  601. package/lib/typescript/module/src/anchors/AnchorRegistry.d.ts.map +1 -1
  602. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +14 -0
  603. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  604. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +12 -16
  605. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  606. package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts +36 -0
  607. package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts.map +1 -0
  608. package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts +20 -0
  609. package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts.map +1 -0
  610. package/lib/typescript/module/src/anchors/fiber/fiberPath.d.ts +12 -0
  611. package/lib/typescript/module/src/anchors/fiber/fiberPath.d.ts.map +1 -0
  612. package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts +21 -8
  613. package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -1
  614. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts +24 -0
  615. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -0
  616. package/lib/typescript/module/src/anchors/fiber/touchTargetFiber.d.ts +24 -0
  617. package/lib/typescript/module/src/anchors/fiber/touchTargetFiber.d.ts.map +1 -0
  618. package/lib/typescript/module/src/anchors/fiber/visibleRect.d.ts +32 -0
  619. package/lib/typescript/module/src/anchors/fiber/visibleRect.d.ts.map +1 -0
  620. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts +6 -1
  621. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  622. package/lib/typescript/module/src/anchors/fiber/walkVisibleFibers.d.ts +20 -0
  623. package/lib/typescript/module/src/anchors/fiber/walkVisibleFibers.d.ts.map +1 -0
  624. package/lib/typescript/module/src/anchors/isInstanceOnVisibleScreen.d.ts +19 -0
  625. package/lib/typescript/module/src/anchors/isInstanceOnVisibleScreen.d.ts.map +1 -0
  626. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +2 -1
  627. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  628. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +10 -1
  629. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  630. package/lib/typescript/module/src/anchors/resolveElementTargets.d.ts +39 -0
  631. package/lib/typescript/module/src/anchors/resolveElementTargets.d.ts.map +1 -0
  632. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +6 -4
  633. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -1
  634. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts +2 -0
  635. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts.map +1 -1
  636. package/lib/typescript/module/src/anchors/useUserflowAnchor.d.ts.map +1 -1
  637. package/lib/typescript/module/src/anonymousId.d.ts +3 -0
  638. package/lib/typescript/module/src/anonymousId.d.ts.map +1 -1
  639. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +1 -0
  640. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -1
  641. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +14 -3
  642. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -1
  643. package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -1
  644. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +1 -1
  645. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -1
  646. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +12 -4
  647. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -1
  648. package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -1
  649. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +5 -0
  650. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -1
  651. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +7 -6
  652. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -1
  653. package/lib/typescript/module/src/authoring/elementPickerController.d.ts +2 -3
  654. package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -1
  655. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +57 -2
  656. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  657. package/lib/typescript/module/src/authoring/hitTest.d.ts +47 -3
  658. package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -1
  659. package/lib/typescript/module/src/authoring/hostAtPoint.d.ts +7 -0
  660. package/lib/typescript/module/src/authoring/hostAtPoint.d.ts.map +1 -0
  661. package/lib/typescript/module/src/content/BannerStepButton.d.ts +14 -0
  662. package/lib/typescript/module/src/content/BannerStepButton.d.ts.map +1 -0
  663. package/lib/typescript/module/src/content/buttonAppearance.d.ts +4 -0
  664. package/lib/typescript/module/src/content/buttonAppearance.d.ts.map +1 -1
  665. package/lib/typescript/module/src/content/resolveBannerButtonChrome.d.ts +8 -0
  666. package/lib/typescript/module/src/content/resolveBannerButtonChrome.d.ts.map +1 -0
  667. package/lib/typescript/module/src/content/themeColor.d.ts +2 -0
  668. package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
  669. package/lib/typescript/module/src/content/types.d.ts +1 -0
  670. package/lib/typescript/module/src/content/types.d.ts.map +1 -1
  671. package/lib/typescript/module/src/deepLinking.d.ts +4 -4
  672. package/lib/typescript/module/src/evalJs/EvalJsHost.d.ts +14 -0
  673. package/lib/typescript/module/src/evalJs/EvalJsHost.d.ts.map +1 -0
  674. package/lib/typescript/module/src/evalJs/bootstrap.d.ts +18 -0
  675. package/lib/typescript/module/src/evalJs/bootstrap.d.ts.map +1 -0
  676. package/lib/typescript/module/src/evalJs/bridgeMessages.d.ts +37 -0
  677. package/lib/typescript/module/src/evalJs/bridgeMessages.d.ts.map +1 -0
  678. package/lib/typescript/module/src/evalJs/evalJsBridge.d.ts +16 -0
  679. package/lib/typescript/module/src/evalJs/evalJsBridge.d.ts.map +1 -0
  680. package/lib/typescript/module/src/evalJs/evalJsController.d.ts +24 -0
  681. package/lib/typescript/module/src/evalJs/evalJsController.d.ts.map +1 -0
  682. package/lib/typescript/module/src/evalJs/getWebView.d.ts +64 -0
  683. package/lib/typescript/module/src/evalJs/getWebView.d.ts.map +1 -0
  684. package/lib/typescript/module/src/evalJs/injectEvalPending.d.ts +4 -0
  685. package/lib/typescript/module/src/evalJs/injectEvalPending.d.ts.map +1 -0
  686. package/lib/typescript/module/src/evalJs/types.d.ts +53 -0
  687. package/lib/typescript/module/src/evalJs/types.d.ts.map +1 -0
  688. package/lib/typescript/module/src/evalJs/useEvalJsWebViewInjection.d.ts +12 -0
  689. package/lib/typescript/module/src/evalJs/useEvalJsWebViewInjection.d.ts.map +1 -0
  690. package/lib/typescript/module/src/expo-router/index.d.ts +1 -0
  691. package/lib/typescript/module/src/expo-router/index.d.ts.map +1 -1
  692. package/lib/typescript/module/src/expo-router/redirectSystemPath.d.ts +50 -0
  693. package/lib/typescript/module/src/expo-router/redirectSystemPath.d.ts.map +1 -0
  694. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts +2 -2
  695. package/lib/typescript/module/src/index.d.ts +16 -1
  696. package/lib/typescript/module/src/index.d.ts.map +1 -1
  697. package/lib/typescript/module/src/installCheck.d.ts +33 -0
  698. package/lib/typescript/module/src/installCheck.d.ts.map +1 -0
  699. package/lib/typescript/module/src/lifecycle.d.ts +4 -1
  700. package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
  701. package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  702. package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  703. package/lib/typescript/module/src/pairing/PairingController.d.ts +71 -4
  704. package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
  705. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +9 -1
  706. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  707. package/lib/typescript/module/src/pairing/deepLink.d.ts +6 -2
  708. package/lib/typescript/module/src/pairing/deepLink.d.ts.map +1 -1
  709. package/lib/typescript/module/src/pairing/deviceId.d.ts +12 -0
  710. package/lib/typescript/module/src/pairing/deviceId.d.ts.map +1 -0
  711. package/lib/typescript/module/src/pairing/diagnostics.d.ts +3 -2
  712. package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
  713. package/lib/typescript/module/src/pairing/tokenStorage.d.ts +14 -2
  714. package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
  715. package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
  716. package/lib/typescript/module/src/pairing/usePreviewBarHold.d.ts +19 -0
  717. package/lib/typescript/module/src/pairing/usePreviewBarHold.d.ts.map +1 -0
  718. package/lib/typescript/module/src/runtime/BannerHost.d.ts +16 -0
  719. package/lib/typescript/module/src/runtime/BannerHost.d.ts.map +1 -0
  720. package/lib/typescript/module/src/runtime/EmbedBannerPlaceholder.d.ts +18 -0
  721. package/lib/typescript/module/src/runtime/EmbedBannerPlaceholder.d.ts.map +1 -0
  722. package/lib/typescript/module/src/runtime/SdkErrorBoundary.d.ts +34 -0
  723. package/lib/typescript/module/src/runtime/SdkErrorBoundary.d.ts.map +1 -0
  724. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +2 -1
  725. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
  726. package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts +15 -0
  727. package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts.map +1 -0
  728. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +9 -3
  729. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
  730. package/lib/typescript/module/src/runtime/bannerEngine.d.ts +12 -0
  731. package/lib/typescript/module/src/runtime/bannerEngine.d.ts.map +1 -0
  732. package/lib/typescript/module/src/runtime/bannerEngineContext.d.ts +5 -0
  733. package/lib/typescript/module/src/runtime/bannerEngineContext.d.ts.map +1 -0
  734. package/lib/typescript/module/src/runtime/bannerPlacement.d.ts +12 -0
  735. package/lib/typescript/module/src/runtime/bannerPlacement.d.ts.map +1 -0
  736. package/lib/typescript/module/src/runtime/embedBannerRegistry.d.ts +5 -0
  737. package/lib/typescript/module/src/runtime/embedBannerRegistry.d.ts.map +1 -0
  738. package/lib/typescript/module/src/runtime/flowEngine.d.ts +25 -1
  739. package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
  740. package/lib/typescript/module/src/runtime/isolateCall.d.ts +20 -0
  741. package/lib/typescript/module/src/runtime/isolateCall.d.ts.map +1 -0
  742. package/lib/typescript/module/src/runtime/reportSdkError.d.ts +10 -0
  743. package/lib/typescript/module/src/runtime/reportSdkError.d.ts.map +1 -0
  744. package/lib/typescript/module/src/runtime/useBannerSession.d.ts +5 -0
  745. package/lib/typescript/module/src/runtime/useBannerSession.d.ts.map +1 -0
  746. package/lib/typescript/module/src/screenTracker.d.ts +7 -3
  747. package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
  748. package/lib/typescript/module/src/storage/asyncStorage.d.ts +15 -0
  749. package/lib/typescript/module/src/storage/asyncStorage.d.ts.map +1 -0
  750. package/lib/typescript/module/src/surfaces/BannerBar.d.ts +14 -0
  751. package/lib/typescript/module/src/surfaces/BannerBar.d.ts.map +1 -0
  752. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts +15 -0
  753. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts.map +1 -0
  754. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +10 -6
  755. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts.map +1 -1
  756. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
  757. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts +15 -0
  758. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts.map +1 -0
  759. package/lib/typescript/module/src/surfaces/bannerBarTokens.d.ts +20 -0
  760. package/lib/typescript/module/src/surfaces/bannerBarTokens.d.ts.map +1 -0
  761. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +10 -0
  762. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -0
  763. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts +7 -0
  764. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts.map +1 -0
  765. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts +6 -0
  766. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts.map +1 -0
  767. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +13 -0
  768. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -0
  769. package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts +5 -0
  770. package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -0
  771. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts +6 -0
  772. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts.map +1 -0
  773. package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts +9 -0
  774. package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -0
  775. package/lib/typescript/module/src/surfaces/bannerWebView/buttonClassName.d.ts +3 -0
  776. package/lib/typescript/module/src/surfaces/bannerWebView/buttonClassName.d.ts.map +1 -0
  777. package/lib/typescript/module/src/surfaces/bannerWebView/resolveCdnHost.d.ts +10 -0
  778. package/lib/typescript/module/src/surfaces/bannerWebView/resolveCdnHost.d.ts.map +1 -0
  779. package/lib/typescript/module/src/surfaces/bannerWebView/richContentDocToHtml.d.ts +3 -0
  780. package/lib/typescript/module/src/surfaces/bannerWebView/richContentDocToHtml.d.ts.map +1 -0
  781. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts +7 -0
  782. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts.map +1 -0
  783. package/lib/typescript/module/src/surfaces/safeArea.d.ts +9 -1
  784. package/lib/typescript/module/src/surfaces/safeArea.d.ts.map +1 -1
  785. package/lib/typescript/module/src/version.d.ts +1 -1
  786. package/package.json +16 -3
  787. package/src/anchors/AnchorRegistry.ts +12 -0
  788. package/src/anchors/AutoAnchorRegistry.ts +41 -11
  789. package/src/anchors/elementConditionEvaluator.ts +235 -70
  790. package/src/anchors/elementTapMonitor.ts +95 -0
  791. package/src/anchors/elementTargetMatch.ts +90 -0
  792. package/src/anchors/fiber/fiberPath.ts +117 -0
  793. package/src/anchors/fiber/findAnchorFiber.ts +121 -80
  794. package/src/anchors/fiber/resolveFiberPath.ts +215 -0
  795. package/src/anchors/fiber/touchTargetFiber.ts +125 -0
  796. package/src/anchors/fiber/visibleRect.ts +153 -0
  797. package/src/anchors/fiber/visibleScreens.ts +74 -36
  798. package/src/anchors/fiber/walkVisibleFibers.ts +65 -0
  799. package/src/anchors/isInstanceOnVisibleScreen.ts +55 -0
  800. package/src/anchors/resolveAnchorHost.ts +2 -1
  801. package/src/anchors/resolveAutoAnchorHost.ts +20 -18
  802. package/src/anchors/resolveElementTargets.ts +165 -0
  803. package/src/anchors/semanticMatcher.ts +38 -14
  804. package/src/anchors/targetPressMonitor.ts +12 -3
  805. package/src/anchors/useUserflowAnchor.ts +1 -0
  806. package/src/anonymousId.ts +20 -8
  807. package/src/authoring/ElementPickerOverlay.tsx +168 -59
  808. package/src/authoring/chrome/ChromeBottomSheet.tsx +49 -8
  809. package/src/authoring/chrome/ChromeButton.tsx +9 -4
  810. package/src/authoring/chrome/ChromeIcon.tsx +10 -1
  811. package/src/authoring/chrome/ChromeTopBar.tsx +39 -15
  812. package/src/authoring/chrome/DoubleTapBridge.tsx +19 -12
  813. package/src/authoring/chrome/doubleTapMonitor.ts +10 -0
  814. package/src/authoring/chrome/icons/circle-exclamation.png +0 -0
  815. package/src/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
  816. package/src/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
  817. package/src/authoring/chrome/icons/triangle-exclamation.png +0 -0
  818. package/src/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
  819. package/src/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
  820. package/src/authoring/chrome/tokens.ts +7 -2
  821. package/src/authoring/elementPickerController.ts +2 -4
  822. package/src/authoring/fingerprintFromInstance.ts +170 -4
  823. package/src/authoring/hitTest.ts +324 -16
  824. package/src/authoring/hostAtPoint.ts +247 -0
  825. package/src/content/BannerStepButton.tsx +91 -0
  826. package/src/content/buttonAppearance.ts +16 -0
  827. package/src/content/resolveBannerButtonChrome.ts +49 -0
  828. package/src/content/themeColor.ts +15 -0
  829. package/src/content/types.ts +1 -0
  830. package/src/deepLinking.ts +4 -4
  831. package/src/evalJs/EvalJsHost.tsx +255 -0
  832. package/src/evalJs/bootstrap.ts +83 -0
  833. package/src/evalJs/bridgeMessages.ts +134 -0
  834. package/src/evalJs/evalJsBridge.ts +42 -0
  835. package/src/evalJs/evalJsController.ts +127 -0
  836. package/src/evalJs/getWebView.ts +124 -0
  837. package/src/evalJs/injectEvalPending.ts +14 -0
  838. package/src/evalJs/types.ts +56 -0
  839. package/src/evalJs/useEvalJsWebViewInjection.ts +37 -0
  840. package/src/expo-router/index.ts +8 -0
  841. package/src/expo-router/redirectSystemPath.ts +86 -0
  842. package/src/expo-router/useUserflowExpoRouter.ts +2 -2
  843. package/src/index.ts +139 -45
  844. package/src/installCheck.ts +191 -0
  845. package/src/lifecycle.ts +4 -1
  846. package/src/navigation/WithUserflowReactNavigation.tsx +13 -10
  847. package/src/navigation/openFlowNavigateUrl.ts +12 -5
  848. package/src/pairing/PairingController.ts +283 -29
  849. package/src/pairing/PreviewModeBanner.tsx +71 -14
  850. package/src/pairing/deepLink.ts +23 -5
  851. package/src/pairing/deviceId.ts +46 -0
  852. package/src/pairing/diagnostics.ts +6 -4
  853. package/src/pairing/tokenStorage.ts +60 -7
  854. package/src/pairing/usePairingState.ts +2 -0
  855. package/src/pairing/usePreviewBarHold.ts +160 -0
  856. package/src/runtime/BannerHost.tsx +102 -0
  857. package/src/runtime/EmbedBannerPlaceholder.tsx +115 -0
  858. package/src/runtime/SdkErrorBoundary.tsx +77 -0
  859. package/src/runtime/TargetPressBridge.tsx +36 -13
  860. package/src/runtime/UserflowOverlay.tsx +118 -0
  861. package/src/runtime/UserflowProvider.tsx +146 -64
  862. package/src/runtime/bannerEngine.ts +55 -0
  863. package/src/runtime/bannerEngineContext.ts +5 -0
  864. package/src/runtime/bannerPlacement.ts +36 -0
  865. package/src/runtime/embedBannerRegistry.ts +28 -0
  866. package/src/runtime/flowEngine.ts +76 -3
  867. package/src/runtime/isolateCall.ts +53 -0
  868. package/src/runtime/reportSdkError.ts +12 -0
  869. package/src/runtime/useBannerSession.ts +35 -0
  870. package/src/screenTracker.ts +34 -8
  871. package/src/storage/asyncStorage.ts +88 -0
  872. package/src/surfaces/BannerBar.tsx +176 -0
  873. package/src/surfaces/BannerSurface.tsx +82 -0
  874. package/src/surfaces/MadeWithUserflow.tsx +15 -10
  875. package/src/surfaces/ModalSurface.tsx +1 -1
  876. package/src/surfaces/TooltipSurface.tsx +17 -1
  877. package/src/surfaces/bannerBarLayout.ts +74 -0
  878. package/src/surfaces/bannerBarTokens.ts +34 -0
  879. package/src/surfaces/bannerWebView/BannerWebViewBar.tsx +312 -0
  880. package/src/surfaces/bannerWebView/bannerAutoRunEvalJs.ts +44 -0
  881. package/src/surfaces/bannerWebView/bannerAutoRunSession.ts +19 -0
  882. package/src/surfaces/bannerWebView/bannerNeedsWebView.ts +38 -0
  883. package/src/surfaces/bannerWebView/bannerThemeStyles.ts +91 -0
  884. package/src/surfaces/bannerWebView/bannerWebFrameCss.ts +145 -0
  885. package/src/surfaces/bannerWebView/buildCustomBannerHtml.ts +178 -0
  886. package/src/surfaces/bannerWebView/buttonClassName.ts +15 -0
  887. package/src/surfaces/bannerWebView/resolveCdnHost.ts +47 -0
  888. package/src/surfaces/bannerWebView/richContentDocToHtml.ts +99 -0
  889. package/src/surfaces/resolveBannerTheme.ts +18 -0
  890. package/src/surfaces/safeArea.ts +88 -19
  891. package/src/version.ts +1 -1
  892. package/vendor/core/dist/attributes.d.ts.map +1 -1
  893. package/vendor/core/dist/attributes.js +4 -4
  894. package/vendor/core/dist/attributes.js.map +1 -1
  895. package/vendor/core/dist/constants.d.ts +2 -0
  896. package/vendor/core/dist/constants.d.ts.map +1 -1
  897. package/vendor/core/dist/constants.js +2 -0
  898. package/vendor/core/dist/constants.js.map +1 -1
  899. package/vendor/core/dist/engine/BannerSessionEngine.d.ts +73 -0
  900. package/vendor/core/dist/engine/BannerSessionEngine.d.ts.map +1 -0
  901. package/vendor/core/dist/engine/BannerSessionEngine.js +236 -0
  902. package/vendor/core/dist/engine/BannerSessionEngine.js.map +1 -0
  903. package/vendor/core/dist/engine/ClientConditionEngine.d.ts +20 -1
  904. package/vendor/core/dist/engine/ClientConditionEngine.d.ts.map +1 -1
  905. package/vendor/core/dist/engine/ClientConditionEngine.js +13 -10
  906. package/vendor/core/dist/engine/ClientConditionEngine.js.map +1 -1
  907. package/vendor/core/dist/engine/FlowSessionEngine.d.ts +41 -1
  908. package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -1
  909. package/vendor/core/dist/engine/FlowSessionEngine.js +167 -28
  910. package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -1
  911. package/vendor/core/dist/engine/PairingEngine.d.ts +38 -2
  912. package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
  913. package/vendor/core/dist/engine/PairingEngine.js +19 -2
  914. package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
  915. package/vendor/core/dist/engine/UserflowCore.d.ts +10 -1
  916. package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -1
  917. package/vendor/core/dist/engine/UserflowCore.js +68 -29
  918. package/vendor/core/dist/engine/UserflowCore.js.map +1 -1
  919. package/vendor/core/dist/engine/handleActions.d.ts +17 -3
  920. package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
  921. package/vendor/core/dist/engine/handleActions.js +17 -14
  922. package/vendor/core/dist/engine/handleActions.js.map +1 -1
  923. package/vendor/core/dist/engine/trackCondition.d.ts +2 -0
  924. package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -1
  925. package/vendor/core/dist/engine/trackCondition.js +4 -2
  926. package/vendor/core/dist/engine/trackCondition.js.map +1 -1
  927. package/vendor/core/dist/engine/trackStepTriggers.d.ts +11 -1
  928. package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -1
  929. package/vendor/core/dist/engine/trackStepTriggers.js +42 -16
  930. package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -1
  931. package/vendor/core/dist/errors.d.ts +11 -1
  932. package/vendor/core/dist/errors.d.ts.map +1 -1
  933. package/vendor/core/dist/errors.js +2 -1
  934. package/vendor/core/dist/errors.js.map +1 -1
  935. package/vendor/core/dist/eventAttributes.d.ts.map +1 -1
  936. package/vendor/core/dist/eventAttributes.js +4 -2
  937. package/vendor/core/dist/eventAttributes.js.map +1 -1
  938. package/vendor/core/dist/index.d.ts +5 -2
  939. package/vendor/core/dist/index.d.ts.map +1 -1
  940. package/vendor/core/dist/index.js +1 -0
  941. package/vendor/core/dist/index.js.map +1 -1
  942. package/vendor/core/dist/normalizeAttributes.js +9 -7
  943. package/vendor/core/dist/normalizeAttributes.js.map +1 -1
  944. package/vendor/core/dist/transport/pairing.d.ts +5 -0
  945. package/vendor/core/dist/transport/pairing.d.ts.map +1 -1
  946. package/vendor/core/dist/transport/pairing.js +69 -2
  947. package/vendor/core/dist/transport/pairing.js.map +1 -1
  948. package/vendor/core/dist/transport/phoenix.d.ts +8 -0
  949. package/vendor/core/dist/transport/phoenix.d.ts.map +1 -1
  950. package/vendor/core/dist/transport/phoenix.js +16 -2
  951. package/vendor/core/dist/transport/phoenix.js.map +1 -1
  952. package/vendor/core/dist/version.d.ts +1 -1
  953. package/vendor/core/dist/version.js +1 -1
  954. package/vendor/core/package.json +1 -1
  955. package/vendor/protocol/dist/autoData.d.ts +8 -15
  956. package/vendor/protocol/dist/autoData.d.ts.map +1 -1
  957. package/vendor/protocol/dist/autoData.js.map +1 -1
  958. package/vendor/protocol/dist/flows.d.ts +58 -2
  959. package/vendor/protocol/dist/flows.d.ts.map +1 -1
  960. package/vendor/protocol/dist/flows.js +20 -2
  961. package/vendor/protocol/dist/flows.js.map +1 -1
  962. package/vendor/protocol/dist/messages.d.ts +22 -12
  963. package/vendor/protocol/dist/messages.d.ts.map +1 -1
  964. package/vendor/protocol/dist/messages.js +5 -2
  965. package/vendor/protocol/dist/messages.js.map +1 -1
  966. package/vendor/protocol/package.json +1 -1
package/README.md CHANGED
@@ -9,17 +9,28 @@ release for every content change.
9
9
 
10
10
  ## Requirements
11
11
 
12
- | Peer / dependency | Required? | Why |
13
- | ------------------------------------------- | ---------- | ------------------------------------------------------------------------ |
14
- | `react`, `react-native` | Yes | Host runtime. |
15
- | `@react-native-async-storage/async-storage` | Yes (dep) | Persists the anonymous user id. Installed with this package. |
16
- | `react-native-device-info` | Yes (dep) | Reads the host app store version (bundled; native rebuild required). |
17
- | `react-native-view-shot` | Yes (peer) | Builder in-app picker screenshots. Native module; rebuild after install. |
18
- | `react-native-safe-area-context` | Optional | Correct insets for modal/tooltip surfaces. |
19
- | `@react-navigation/native` | Optional | Screen tracking + NAVIGATE routing (React Navigation). |
20
- | `expo-router` | Optional | Screen tracking + NAVIGATE routing (Expo Router). |
21
- | `@react-native-community/netinfo` | Optional | Instant offline→online reconnect (enhancement, not required). |
22
- | `expo-secure-store` | Optional | Persist Builder pairing JWT in Keychain/Keystore. |
12
+ Declared minimums: React `>=18.2.0`, React Native `>=0.74.0`. This package's
13
+ test suite runs on React Native 0.81 / React 19.1. The TinyTime sample app in
14
+ this repo runs on Expo SDK 57 / React Native 0.86. Expo Go is not supported.
15
+
16
+ Install AsyncStorage, WebView, and (on bare React Native) device-info in the
17
+ **app**, even though this package also depends on them. Expo SDK 54 and later
18
+ autolink transitive native modules. Bare React Native, and Expo SDK 53 and
19
+ older, only autolink packages listed in the app's own `package.json`. A direct
20
+ install also picks a version that matches the app's React Native.
21
+
22
+ | Package | Required? | Why | If missing |
23
+ | ------------------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
24
+ | `react`, `react-native` | Yes | Host runtime. | The app cannot load the SDK. |
25
+ | `@react-native-async-storage/async-storage` | Yes, install in the app | Anonymous user id and the pairing device id. | `identifyAnonymous()` throws. Pairing keeps a device id in memory for the session. A dev-only warning is logged from `Userflow.init`. |
26
+ | `react-native-device-info` | Yes on bare React Native | Host app `app_version` / `app_build`. Expo reads `expo-application` / `expo-constants` instead. | Those attributes are omitted. A dev-only warning is logged on bare React Native. |
27
+ | `react-native-view-shot` `>=5.0.0` | Yes (peer) | Builder element-selection screenshots. | The picker has no screenshot. A dev-only warning is logged from `Userflow.init`. |
28
+ | `react-native-webview` `>=13.8.0` | Yes, install in the app | Evaluate JavaScript and WebView banners. | Those surfaces do not run. A dev-only warning is logged from `Userflow.init`. |
29
+ | `react-native-safe-area-context` | Optional | Insets for modal and tooltip surfaces. | One dev warning. Flow cards use the device's initial safe-area insets, or zero when those are unavailable. |
30
+ | `@react-navigation/native` | Optional | Screen tracking and NAVIGATE routing (React Navigation). | Report screens yourself with `updateScreen` / `useUserflowScreen`. |
31
+ | `expo-router` | Optional | Screen tracking and NAVIGATE routing (Expo Router). | Report screens yourself with `updateScreen` / `useUserflowScreen`. |
32
+ | `@react-native-community/netinfo` | Optional | Instant offline→online reconnect. | Recovery still runs on the heartbeat and when the app returns to the foreground. |
33
+ | `expo-secure-store` | Optional | Persist the Builder pairing JWT in Keychain/Keystore. | The pairing token stays in memory and is lost when the process ends. |
23
34
 
24
35
  Optional peers are declared `optional: true` in `peerDependenciesMeta`, so
25
36
  package managers will not warn if you skip them. Required peers (not marked
@@ -27,46 +38,75 @@ optional) will warn — or fail the install — if they are missing.
27
38
 
28
39
  ### Expo Go is not supported
29
40
 
30
- Use an **Expo development build** (or bare React Native). The SDK is not
31
- compatible with Expo Go.
41
+ Use an **Expo development build** (or bare React Native). In development,
42
+ `Userflow.init` logs:
43
+
44
+ ```text
45
+ [Userflow] This app is running in Expo Go, which cannot load the SDK native modules. Builder preview links will not open the app. Use a development build (npx expo run:ios / npx expo run:android).
46
+ ```
32
47
 
33
48
  ## Install
34
49
 
35
- Packages publish to the private `@userflow-tech` npm org. Create a **granular
36
- access token** on npm (Read-only, limited to `@userflow-tech`) and put it in
37
- the host app’s `.npmrc` via an env var — do not commit the token:
50
+ ### Access
51
+
52
+ Packages publish to the private `@userflow-tech` npm org. Userflow adds the
53
+ client's npm user or organization to a **read-only team** on that org. The
54
+ client then creates a **granular access token** on npm (Read-only, limited to
55
+ `@userflow-tech`). A `404` from `npm install` or `npm view @userflow-tech/react-native`
56
+ means the token is missing, or that user or org is not on the team. npm uses
57
+ 404 for a private package the caller cannot see.
58
+
59
+ ### npm, Yarn, and CI
60
+
61
+ npm and Yarn 1 read `.npmrc`. Do not commit the token:
38
62
 
39
63
  ```ini
40
64
  @userflow-tech:registry=https://registry.npmjs.org/
41
65
  //registry.npmjs.org/:_authToken=${NPM_TOKEN}
42
66
  ```
43
67
 
68
+ Yarn 2 and later ignore `.npmrc`. Add this to `.yarnrc.yml` instead:
69
+
70
+ ```yaml
71
+ npmScopes:
72
+ userflow-tech:
73
+ npmRegistryServer: 'https://registry.npmjs.org'
74
+ npmAuthToken: '${NPM_TOKEN}'
75
+ ```
76
+
77
+ Set `NPM_TOKEN` in the environment that installs dependencies: a local shell,
78
+ CI, and EAS (an EAS secret named `NPM_TOKEN`, available to the install step).
79
+
80
+ ### Packages
81
+
44
82
  ```bash
45
83
  # Expo (dev build)
46
- npx expo install @userflow-tech/react-native react-native-view-shot@^5.0.0
84
+ npx expo install @userflow-tech/react-native @react-native-async-storage/async-storage react-native-webview react-native-view-shot@^5.0.0
47
85
 
48
86
  # Bare React Native
49
- npm install @userflow-tech/react-native react-native-view-shot
87
+ npm install @userflow-tech/react-native @react-native-async-storage/async-storage react-native-device-info react-native-webview react-native-view-shot@^5.0.0
50
88
  cd ios && pod install
51
89
  ```
52
90
 
53
91
  `react-native-view-shot` is a **required peer** (`>=5.0.0`). It is a native
54
- module — rebuild after install (Metro reload is not enough). On Expo SDK 54,
92
+ module — rebuild after install (a Metro reload is not enough). On Expo SDK 54,
55
93
  unpinned `npx expo install react-native-view-shot` resolves **4.0.3**, which
56
- does not satisfy the peer and breaks New Architecture / bridgeless. Pin
57
- `^5.0.0` (or `@latest`) as in the command above.
58
-
59
- `@react-native-async-storage/async-storage` and `react-native-device-info` are
60
- dependencies of this package and are installed automatically with a normal npm
61
- install. After adding or upgrading the SDK, rebuild the native app (`cd ios &&
62
- pod install`, then run again). If autolinking misses a bundled native module
63
- (common with local `file:` links), install it in the host app explicitly:
94
+ does not satisfy the peer. Pin `^5.0.0` as in the command above. If `expo doctor`
95
+ reports that pin, exclude it from Expo's version check:
64
96
 
65
- ```bash
66
- npm install @react-native-async-storage/async-storage react-native-device-info
67
- cd ios && pod install # iOS
97
+ ```json
98
+ {
99
+ "expo": {
100
+ "install": {
101
+ "exclude": ["react-native-view-shot"]
102
+ }
103
+ }
104
+ }
68
105
  ```
69
106
 
107
+ On a bare React Native app, `expo-secure-store` needs Expo modules installed
108
+ first (`npx install-expo-modules@latest`), then `npx expo install expo-secure-store`.
109
+
70
110
  Optional peers as needed:
71
111
 
72
112
  ```bash
@@ -78,72 +118,187 @@ For local tarball installs from this monorepo, pack with `pnpm pack:all` at the
78
118
  repo root and install the single `@userflow-tech/react-native` tarball. Steps:
79
119
  `docs/local-testing.md` in the monorepo.
80
120
 
121
+ ### Install with an AI agent
122
+
123
+ Cursor, Claude Code, and other agents that read Agent Skills can do this
124
+ install. The skill is `install-react-native-with-ai` in
125
+ [userflow/ai-skills-library](https://github.com/userflow/ai-skills-library).
126
+ Web apps use `install-with-ai` from that library instead.
127
+
128
+ ```bash
129
+ npx skills add userflow/ai-skills-library@install-react-native-with-ai
130
+ ```
131
+
132
+ Claude Code loads it from the plugin:
133
+
134
+ ```text
135
+ /plugin marketplace add userflow/ai-skills-library
136
+ /plugin install userflow@ai-skills-library
137
+ /userflow:install-react-native-with-ai
138
+ ```
139
+
81
140
  ## Quick start
82
141
 
83
142
  ```tsx
84
143
  import { Userflow, UserflowProvider } from '@userflow-tech/react-native';
85
144
 
86
145
  await Userflow.init({
87
- clientToken: 'ct_...', // from the Userflow dashboard → Environments
88
- // serverEndpoint: 'https://e.userflow.com', // default; set for staging/local
89
- // pairingEndpoint: 'https://e.userflow.com', // default; set for local Builder pairing
146
+ clientToken: 'ct_...', // from the Userflow dashboard → Environments. Never an esk_ secret key.
147
+ // serverEndpoint: 'https://e.userflow.com', // default (US). EU: 'https://e.eu.userflow.com'
148
+ // pairingEndpoint: 'https://e.userflow.com', // default; pairing stays on the US host
90
149
  });
91
150
 
92
- // Identified user — signature is computed by YOUR backend, never in the app:
93
- await Userflow.identify('user-123', { name: 'Ada' }, { signature });
151
+ // Identified user — signature is computed by YOUR backend, never in the app.
152
+ // `locale_code` is the same user attribute as web (see Localization below).
153
+ await Userflow.identify('user-123', { name: 'Ada', locale_code: 'da-DK' }, { signature });
94
154
 
95
- // …or anonymous (id stored in AsyncStorage):
155
+ // Anonymous users count toward MAU. Call this only when you intend to identify
156
+ // signed-out users. The id is stored in AsyncStorage.
96
157
  await Userflow.identifyAnonymous();
97
158
  ```
98
159
 
99
- Wrap the app tree so flows can render:
160
+ Call `Userflow.teardown()` when tearing the SDK down (removes AppState and
161
+ NetInfo subscriptions). Call `Userflow.reset()` on logout to clear identity and
162
+ disconnect. `reset()` does not apply a new `clientToken` or endpoint; restart
163
+ the app to change those.
164
+
165
+ ### Where to put `init`, `identify`, and `UserflowProvider`
166
+
167
+ Call `Userflow.init` once, as early as you can, from the root component
168
+ (`app/_layout.tsx` with Expo Router, `App.tsx` with bare React Native or React
169
+ Navigation). `UserflowProvider` can mount before that promise resolves. Put it
170
+ once, near the top of the tree, inside `SafeAreaProvider`. Call `identify` after
171
+ sign-in. `identifyAnonymous` identifies signed-out users and counts them toward
172
+ MAU, so use it only when you mean to. Call `Userflow.reset()` on logout.
173
+
174
+ Expo Router:
100
175
 
101
176
  ```tsx
102
- import { UserflowProvider } from '@userflow-tech/react-native';
177
+ import { useEffect } from 'react';
178
+ import { Userflow, UserflowProvider } from '@userflow-tech/react-native';
179
+ import { UserflowExpoRouterScreenTracker } from '@userflow-tech/react-native/expo-router';
180
+ import { Stack } from 'expo-router';
181
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
103
182
 
104
183
  export default function RootLayout() {
184
+ useEffect(() => {
185
+ void Userflow.init({ clientToken: 'ct_...' });
186
+ }, []);
187
+
105
188
  return (
106
- <UserflowProvider>
107
- <App />
108
- </UserflowProvider>
189
+ <SafeAreaProvider>
190
+ <UserflowProvider>
191
+ <UserflowExpoRouterScreenTracker />
192
+ <Stack />
193
+ </UserflowProvider>
194
+ </SafeAreaProvider>
109
195
  );
110
196
  }
111
197
  ```
112
198
 
113
- Call `Userflow.teardown()` when tearing the SDK down (removes AppState and
114
- NetInfo subscriptions). Call `Userflow.reset()` on logout to clear identity and
115
- disconnect.
199
+ React Navigation:
200
+
201
+ ```tsx
202
+ import { useEffect } from 'react';
203
+ import { Userflow, UserflowProvider } from '@userflow-tech/react-native';
204
+ import { WithUserflowReactNavigation } from '@userflow-tech/react-native/navigation';
205
+ import { NavigationContainer } from '@react-navigation/native';
206
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
207
+
208
+ export default function App() {
209
+ useEffect(() => {
210
+ void Userflow.init({ clientToken: 'ct_...' });
211
+ }, []);
212
+
213
+ return (
214
+ <SafeAreaProvider>
215
+ <UserflowProvider>
216
+ <WithUserflowReactNavigation>
217
+ <NavigationContainer>{/* navigators */}</NavigationContainer>
218
+ </WithUserflowReactNavigation>
219
+ </UserflowProvider>
220
+ </SafeAreaProvider>
221
+ );
222
+ }
223
+ ```
224
+
225
+ Without `SafeAreaProvider`, development logs this once and flow cards fall back
226
+ to the device's initial insets:
227
+
228
+ ```text
229
+ [Userflow] UserflowProvider is not inside a <SafeAreaProvider>, so flow cards use the device's initial safe-area insets. Wrap your app in <SafeAreaProvider> from react-native-safe-area-context.
230
+ ```
116
231
 
117
232
  ### Call order
118
233
 
119
- | Call | Before `init()` resolves | Before `identify()` |
120
- | -------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------- |
121
- | `identify` / `identifyAnonymous` | **Throws** `Call Userflow.init() before identify()` | — |
122
- | `group` | **Throws** `Call Userflow.init() before group()` | **Throws** `Call Userflow.identify() before group()` |
123
- | `updateUser` | **Throws** `Call Userflow.init() before updateUser()` | **Throws** `Call Userflow.identify() before updateUser()` |
124
- | `updateGroup` | **Throws** `Call Userflow.init() before updateGroup()` | **Throws** `Call Userflow.identify() before updateGroup()`; also requires a prior `group()` |
125
- | `track` | **Throws** `Call Userflow.init() before track()` | **Throws** `Call Userflow.identify() before track()` |
126
- | `updateScreen` | Silently buffers; included on the next channel join | Silently buffers |
234
+ | Call | Before `init()` resolves | Before `identify()` |
235
+ | -------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
236
+ | `identify` / `identifyAnonymous` | **Throws** `Call Userflow.init() before identify()` | — |
237
+ | `group` | **Throws** `Call Userflow.init() before group()` | **Throws** `Call Userflow.identify() before group()` |
238
+ | `updateUser` | **Throws** `Call Userflow.init() before updateUser()` | **Throws** `Call Userflow.identify() before updateUser()` |
239
+ | `updateGroup` | **Throws** `Call Userflow.init() before updateGroup()` | **Throws** `Call Userflow.identify() before updateGroup()`; also requires a prior `group()` |
240
+ | `track` | **Throws** `Call Userflow.init() before track()` | **Throws** `Call Userflow.identify() before track()`. Network, rate-limit, and unexpected SDK errors are isolated (the promise resolves; see [isolation.md](docs/isolation.md)) |
241
+ | `updateScreen` | Silently buffers; included on the next channel join | Silently buffers |
127
242
 
128
243
  Other rules:
129
244
 
130
- - `init()` is **idempotent**. A second call returns the cached promise and does
131
- **not** apply new options. Restart the process (or call `reset()` then
132
- re-init carefully) if you need different credentials.
245
+ - `init()` is **idempotent** once it has succeeded. A later call returns the
246
+ cached promise and does **not** apply new options. In development, a call
247
+ with a different `clientToken`, `serverEndpoint`, or `pairingEndpoint` while
248
+ that init is in flight or has succeeded logs
249
+ `[Userflow] Userflow.init() already ran with different options. The new clientToken, serverEndpoint, and pairingEndpoint are ignored because init runs once per process. Userflow.reset() does not apply new credentials. Restart the app to change them.`
250
+ Restart the app to change them after a successful init. If `init` rejects
251
+ (wrong token, or the EU endpoint hint), call it again with the corrected
252
+ options; that retry runs. `Userflow.reset()` clears the signed-in user;
253
+ it does not apply new credentials.
133
254
  - `identify()` with a **different** user id resets the previous identity first.
134
255
  Same-id re-identify merges attributes.
135
256
  - Identity verification `signature` is optional in the type, but **required by
136
257
  the server** when the environment has identity verification enabled. See
137
258
  [docs/identity-verification.md](docs/identity-verification.md).
138
259
 
260
+ ## Localization
261
+
262
+ Pass the end-user's locale the same way as userflow.js: as a user attribute on
263
+ `identify`, `identifyAnonymous`, or `updateUser`. The attribute name is the
264
+ company's locale attribute (default `locale_code`).
265
+
266
+ ```ts
267
+ await Userflow.identify('user-123', { name: 'Ada', locale_code: 'da-DK' }, { signature });
268
+ ```
269
+
270
+ When that locale is enabled on the flow in the Builder, the end-user sees the
271
+ translated content. If the user has no locale stored, or the stored code is not
272
+ a locale the company has set up, the flow stays in its original language.
273
+ Omitting the attribute on a later identify does not clear a locale already
274
+ stored for that user. A locale the company has, but that is not enabled on this
275
+ flow, hides the flow — same as web.
276
+
277
+ The value is stored on the end user under the company's locale attribute.
278
+ Identifying the same user id on mobile keeps a locale already sent from the web
279
+ app, so mobile does not need to send it again. Sending a new value overwrites
280
+ it; sending `null` clears it. The SDK does not read the device locale.
281
+
282
+ ## Host isolation
283
+
284
+ The SDK is in-process JS, so it cannot fully sandbox itself from the host app.
285
+ Overlay render errors and fire-and-forget tracking failures are caught, logged
286
+ as `[Userflow] isolated error` via `console.warn`, and swallowed so they cannot
287
+ unmount or crash the host tree. `init` / `identify` still throw — a swallowed
288
+ identify would look like success. Native crashes and errors in **your** children
289
+ of `UserflowProvider` are out of scope.
290
+
291
+ Details: [docs/isolation.md](docs/isolation.md).
292
+
139
293
  ## Screen tracking
140
294
 
141
295
  Each accepted screen/path also sends a `screen_viewed` event after identify
142
- (with `screen_name` or `screen_path`). That is a second client message alongside
143
- `UpdateClientContext`; both count toward the 100/min cap. Modal / sheet
144
- presentations are skipped (Expo Router also watches navigation state, so overlays
145
- that do not change the pathname are skipped too). Returning from background past
146
- the lifecycle grace window re-fires the current screen.
296
+ (with `screen_name`, which holds the Expo Router path or the screen name). That
297
+ is a second client message alongside `UpdateClientContext`; both count toward
298
+ the 100/min cap. Modal / sheet presentations are skipped (Expo Router also
299
+ watches navigation state, so overlays that do not change the pathname are
300
+ skipped too). Returning from background past the lifecycle grace window
301
+ re-fires the current screen.
147
302
 
148
303
  ### Expo Router
149
304
 
@@ -155,13 +310,16 @@ subpath under `UserflowProvider` (the tracker is a separate entry so apps withou
155
310
  import { UserflowProvider } from '@userflow-tech/react-native';
156
311
  import { UserflowExpoRouterScreenTracker } from '@userflow-tech/react-native/expo-router';
157
312
  import { Stack } from 'expo-router';
313
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
158
314
 
159
315
  export default function RootLayout() {
160
316
  return (
161
- <UserflowProvider>
162
- <UserflowExpoRouterScreenTracker />
163
- <Stack />
164
- </UserflowProvider>
317
+ <SafeAreaProvider>
318
+ <UserflowProvider>
319
+ <UserflowExpoRouterScreenTracker />
320
+ <Stack />
321
+ </UserflowProvider>
322
+ </SafeAreaProvider>
165
323
  );
166
324
  }
167
325
  ```
@@ -175,14 +333,17 @@ Wrap `NavigationContainer` with `WithUserflowReactNavigation` from the
175
333
  import { UserflowProvider } from '@userflow-tech/react-native';
176
334
  import { WithUserflowReactNavigation } from '@userflow-tech/react-native/navigation';
177
335
  import { NavigationContainer } from '@react-navigation/native';
336
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
178
337
 
179
338
  export default function App() {
180
339
  return (
181
- <UserflowProvider>
182
- <WithUserflowReactNavigation>
183
- <NavigationContainer>{/* navigators */}</NavigationContainer>
184
- </WithUserflowReactNavigation>
185
- </UserflowProvider>
340
+ <SafeAreaProvider>
341
+ <UserflowProvider>
342
+ <WithUserflowReactNavigation>
343
+ <NavigationContainer>{/* navigators */}</NavigationContainer>
344
+ </WithUserflowReactNavigation>
345
+ </UserflowProvider>
346
+ </SafeAreaProvider>
186
347
  );
187
348
  }
188
349
  ```
@@ -200,9 +361,11 @@ useUserflowScreen(route.name);
200
361
  ## Element targeting (anchors)
201
362
 
202
363
  Tooltip steps and ELEMENT client conditions resolve a dashboard selector like
203
- `#invite-teammates` to a host view. Prefer a plain `testID` (or `nativeID` /
204
- `accessibilityLabel`) — no SDK hook required. A misspelled or missing anchor can
205
- mean the tooltip misses **or** a gated flow never starts at all.
364
+ `#invite-teammates` to a host view. Tag it with `userflowId` (strongest), then
365
+ `testID`, then `nativeID`, then `accessibilityLabel` — no SDK hook required. A
366
+ misspelled or missing anchor can mean the tooltip misses **or** a gated flow
367
+ never starts at all. `PRESENT`, `NOT_PRESENT`, `CLICK`, and `NOT_CLICK`
368
+ auto-start conditions are evaluated on device.
206
369
 
207
370
  ```tsx
208
371
  import { Pressable, Text } from 'react-native';
@@ -230,10 +393,10 @@ Full contract, prop priority, missing-target behavior, and duplicate-id rules:
230
393
 
231
394
  To preview draft flows from the Userflow builder onto a device (QR / deep link):
232
395
 
233
- 1. Register the environment's **`scheme_id`** (e.g. `userflow-257587` — **not**
234
- the env UUID) with the `@userflow-tech/react-native` config plugin, then
235
- **rebuild native** (`npx expo prebuild` / a new development client). Metro
236
- reload is not enough.
396
+ 1. Register the environment's **`scheme_id`** (e.g.
397
+ `userflow-v7twv2fw2ja2jaco7kesvowmem` — **not** the env UUID) with the
398
+ `@userflow-tech/react-native` config plugin, then **rebuild native**
399
+ (`npx expo prebuild` / a new development client). Metro reload is not enough.
237
400
  2. Call `Userflow.init` (optionally with `pairingEndpoint` / `serverEndpoint`
238
401
  for staging or local stacks) and wrap the tree in `UserflowProvider`.
239
402
  3. Open the builder Preview dialog → **Pair a device** → scan/open the QR. The
@@ -243,7 +406,9 @@ To preview draft flows from the Userflow builder onto a device (QR / deep link):
243
406
  ```json
244
407
  {
245
408
  "expo": {
246
- "plugins": [["@userflow-tech/react-native", { "schemeId": "userflow-257587" }]]
409
+ "plugins": [
410
+ ["@userflow-tech/react-native", { "schemeId": "userflow-v7twv2fw2ja2jaco7kesvowmem" }]
411
+ ]
247
412
  }
248
413
  }
249
414
  ```
@@ -259,12 +424,12 @@ await Userflow.init({
259
424
 
260
425
  Deep-link / pairing helpers:
261
426
 
262
- | Member | Description |
263
- | ----------------------- | ---------------------------------------------------------------- |
264
- | `didHandleURL(url)` | Handle a one-shot preview deep link (`…://?token=…`). |
265
- | `handlePairingUrl(url)` | Handle a pairing deep link (`…://?pairing_token=…`). |
266
- | `exitPreview()` | Disconnect the pairing websocket and leave preview mode. |
267
- | `PreviewModeBanner` | Mounted by `UserflowProvider` while paired (full-bleed top bar). |
427
+ | Member | Description |
428
+ | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
429
+ | `didHandleURL(url)` | Handle a one-shot preview deep link (`…://?token=…`). |
430
+ | `handlePairingUrl(url)` | Handle a pairing deep link (`…://?pairing_token=…`, optionally `&purpose=preview` or `&purpose=select_element`). |
431
+ | `exitPreview()` | Disconnect the pairing websocket and leave preview mode. |
432
+ | `PreviewModeBanner` | Mounted by `UserflowProvider` while paired. The top bar shows at once for a preview link, stays hidden for an element-selection link and after any pick until the next preview, and waits briefly on a link with no purpose. |
268
433
 
269
434
  Full scheme registration, Linking ownership, and verify commands:
270
435
  [docs/deep-linking.md](docs/deep-linking.md). Symptom table:
@@ -299,54 +464,54 @@ Screen tracking ≠ action routing. React Navigation apps need
299
464
 
300
465
  ### `Userflow`
301
466
 
302
- | Member | Description |
303
- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
304
- | `init(config)` | Validate credentials, store config, start lifecycle + network controllers. |
305
- | `identify(userId, attributes?, options?)` | Identify a user; auto-sets `sdk` / `device_os` / `device_type` and `app_version` / `app_build` from init; `options.signature` for identity verification. |
306
- | `identifyAnonymous(attributes?, options?)` | Stable anonymous id via AsyncStorage; auto-sets `sdk` / `device_os` / `device_type` and `app_version` / `app_build`. |
307
- | `group(groupId, attributes?, options?)` | Associate the current user with a group. |
308
- | `updateUser(attributes?)` | Upsert attributes for the current user without re-identifying. |
309
- | `updateGroup(attributes?, options?)` | Upsert group / membership attributes without re-grouping. |
310
- | `track(name, attributes?, options?)` | Record a custom event (literal attribute values only); `userOnly` skips group. |
311
- | `reset()` | Clear identity, client conditions, flow session; disconnect. |
312
- | `teardown()` | Stop AppState / NetInfo / screen-tracking subscriptions. |
313
- | `updateScreen(name)` | Report the active screen (prefer hooks when possible). |
314
- | `setOnNavigate(handler)` | Override or clear the host NAVIGATE handler. |
315
- | `reportActivity()` | Reset the idle timer; reconnect an idle-suspended socket. |
316
- | `didHandleURL(url)` | Handle a Userflow preview deep link (`…://?token=…`). |
317
- | `handlePairingUrl(url)` | Handle a Builder pairing deep link (`…://?pairing_token=…`; dev builds only). |
318
- | `exitPreview()` | Leave Builder preview mode; disconnect the pairing websocket (dev only). |
319
- | `inspectPairingDeepLink(url)` | Classify a URL as pairing without consuming it; reports rejection reason. |
320
- | `isPairingAttempt(reason)` | True when a rejection was a recognisable pairing attempt worth reporting. |
321
- | `parsePairingDeepLink(url)` / `isUserflowPairingUrl(url)` | Parse / detect a pairing deep link. |
322
- | `getUserId()` | Current user id, or `null` before identify. |
323
- | `getAttributes()` | Copy of attributes for the current user. |
324
- | `getFlowSessionEngine()` | Mid-flow session engine (created lazily; attach runs after identify). |
325
- | `getHostAppVersion()` | Host app native version cached at init, or `null` before init / when unavailable. |
326
- | `getDeviceContext()` | Platform metadata cached during `init` (`sdk`, `deviceOs`, `deviceType`), or `null` before init. |
327
- | `logHostAppVersion()` | Log the host app's native version (not `SDK_VERSION`) and platform OS. Uses bundled device-info on bare RN. |
328
- | `logDeviceContext()` | Log cached user-attribute values (`sdk` / `device_os` / `device_type`). Requires `init`. |
467
+ | Member | Description |
468
+ | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
469
+ | `init(config)` | Validate credentials, store config, start lifecycle + network controllers. |
470
+ | `identify(userId, attributes?, options?)` | Identify a user; auto-sets `sdk` / `device_os` / `device_type` and `app_version` / `app_build` from init; `options.signature` for identity verification. |
471
+ | `identifyAnonymous(attributes?, options?)` | Stable anonymous id via AsyncStorage; auto-sets `sdk` / `device_os` / `device_type` and `app_version` / `app_build`. |
472
+ | `group(groupId, attributes?, options?)` | Associate the current user with a group. |
473
+ | `updateUser(attributes?)` | Upsert attributes for the current user without re-identifying. |
474
+ | `updateGroup(attributes?, options?)` | Upsert group / membership attributes without re-grouping. |
475
+ | `track(name, attributes?, options?)` | Record a custom event (literal attribute values only); `userOnly` skips group. Misuse (`UserflowAuthError`) rejects; network / rate-limit / SDK bugs are isolated. |
476
+ | `reset()` | Clear identity, client conditions, flow session; disconnect. |
477
+ | `teardown()` | Stop AppState / NetInfo / screen-tracking subscriptions. |
478
+ | `updateScreen(name)` | Report the active screen (prefer hooks when possible). |
479
+ | `setOnNavigate(handler)` | Override or clear the host NAVIGATE handler. |
480
+ | `reportActivity()` | Reset the idle timer; reconnect an idle-suspended socket. |
481
+ | `didHandleURL(url)` | Handle a Userflow preview deep link (`…://?token=…`). |
482
+ | `handlePairingUrl(url)` | Handle a Builder pairing deep link (`…://?pairing_token=…`). Works in every build; the signed JWT gates the session. |
483
+ | `exitPreview()` | Leave Builder preview mode; disconnect the pairing websocket. Works in every build. |
484
+ | `inspectPairingDeepLink(url)` | Classify a URL as pairing without consuming it; reports rejection reason. |
485
+ | `isPairingAttempt(reason)` | True when a rejection was a recognisable pairing attempt worth reporting. |
486
+ | `parsePairingDeepLink(url)` / `isUserflowPairingUrl(url)` | Parse / detect a pairing deep link. |
487
+ | `getUserId()` | Current user id, or `null` before identify. |
488
+ | `getAttributes()` | Copy of attributes for the current user. |
489
+ | `getFlowSessionEngine()` | Mid-flow session engine (created lazily; attach runs after identify). |
490
+ | `getHostAppVersion()` | Host app native version cached at init, or `null` before init / when unavailable. |
491
+ | `getDeviceContext()` | Platform metadata cached during `init` (`sdk`, `deviceOs`, `deviceType`), or `null` before init. |
492
+ | `logHostAppVersion()` | Log the host app's native version (not `SDK_VERSION`) and platform OS. Uses bundled device-info on bare RN. |
493
+ | `logDeviceContext()` | Log cached user-attribute values (`sdk` / `device_os` / `device_type`). Requires `init`. |
329
494
 
330
495
  ### Hooks and components
331
496
 
332
- | Export | Description |
333
- | --------------------------------------- | ---------------------------------------------------------------------------------------- |
334
- | `UserflowProvider` | Root overlay host. Does not track screens on its own. |
335
- | `PreviewModeBanner` | Shown by the provider as a full-bleed top bar while a Builder pairing session is active. |
336
- | `useUserflow()` | Provider context (`{ engine }`); throws outside the provider. |
337
- | `useFlowSessionState()` | Reactive view of the active mid-flow session (advanced / custom UI). |
338
- | `useUserflowScreen(name)` | Report the active screen from a React tree. |
339
- | `useUserflowAnchor(id)` | Optional override: register a view as a MANUAL target (beats `testID`). |
340
- | `useUserflowScrollContainer(onScroll?)` | Optional override: register a `ScrollView` for tooltip scroll-into-view. |
341
- | `Userflow.setScrollPadding(padding)` | Sticky chrome insets when scrolling targets into view. |
342
- | `Userflow.setCustomScrollIntoView(fn)` | Replace scroll-into-view (e.g. unsupported scroll libraries). |
497
+ | Export | Description |
498
+ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
499
+ | `UserflowProvider` | Root overlay host. Does not track screens on its own. Overlay render errors are isolated from host children. |
500
+ | `PreviewModeBanner` | Shown by the provider while a Builder pairing session is active. It shows at once for a preview link, stays hidden for an element-selection link and after any pick until the next preview, and waits briefly on a link with no purpose. |
501
+ | `useUserflow()` | Provider context (`{ engine }`); throws outside the provider. |
502
+ | `useFlowSessionState()` | Reactive view of the active mid-flow session (advanced / custom UI). |
503
+ | `useUserflowScreen(name)` | Report the active screen from a React tree. |
504
+ | `useUserflowAnchor(id)` | Optional override: register a view as a MANUAL target (beats `userflowId` / `testID`). |
505
+ | `useUserflowScrollContainer(onScroll?)` | Optional override: register a `ScrollView` for tooltip scroll-into-view. |
506
+ | `Userflow.setScrollPadding(padding)` | Sticky chrome insets when scrolling targets into view. |
507
+ | `Userflow.setCustomScrollIntoView(fn)` | Replace scroll-into-view (e.g. unsupported scroll libraries). |
343
508
 
344
509
  ### Subpath exports
345
510
 
346
- | Import | Provides |
347
- | ----------------------------------------- | ---------------------------------------------------------- |
348
- | `@userflow-tech/react-native/navigation` | `WithUserflowReactNavigation` |
349
- | `@userflow-tech/react-native/expo-router` | `UserflowExpoRouterScreenTracker`, `useUserflowExpoRouter` |
511
+ | Import | Provides |
512
+ | ----------------------------------------- | ------------------------------------------------------------------------------------------------------- |
513
+ | `@userflow-tech/react-native/navigation` | `WithUserflowReactNavigation` |
514
+ | `@userflow-tech/react-native/expo-router` | `UserflowExpoRouterScreenTracker`, `useUserflowExpoRouter`, `redirectSystemPath` (for `+native-intent`) |
350
515
 
351
516
  ### Constants
352
517
 
@@ -359,24 +524,160 @@ Screen tracking ≠ action routing. React Navigation apps need
359
524
 
360
525
  ## Guides in this package
361
526
 
362
- | Doc | Topic |
363
- | -------------------------------------------------------------- | ---------------------------------------------------------- |
364
- | [docs/anchoring.md](docs/anchoring.md) | Manual targets, scroll containers, missing-target behavior |
365
- | [docs/deep-linking.md](docs/deep-linking.md) | Builder preview URLs and pairing sessions |
366
- | [docs/identity-verification.md](docs/identity-verification.md) | HMAC signature on your backend |
367
- | [docs/troubleshooting.md](docs/troubleshooting.md) | Symptom → cause for common integration failures |
368
- | [docs/theme-mapping.md](docs/theme-mapping.md) | Web → RN theme token mapping (contributor-facing) |
527
+ | Doc | Topic |
528
+ | -------------------------------------------------------------- | ----------------------------------------------------------- |
529
+ | [docs/anchoring.md](docs/anchoring.md) | Manual targets, scroll containers, missing-target behavior |
530
+ | [docs/isolation.md](docs/isolation.md) | What “isolated as possible” means; overlay + `track` guards |
531
+ | [docs/deep-linking.md](docs/deep-linking.md) | Builder preview URLs and pairing sessions |
532
+ | [docs/identity-verification.md](docs/identity-verification.md) | HMAC signature on your backend |
533
+ | [docs/troubleshooting.md](docs/troubleshooting.md) | Symptom → cause for common integration failures |
534
+ | [docs/theme-mapping.md](docs/theme-mapping.md) | Web → RN theme token mapping (contributor-facing) |
369
535
 
370
536
  ## Experimental
371
537
 
372
538
  - AUTO / codeless element targeting (exact-id fast path + scored matcher;
373
539
  scored path needs Babel full mode to populate the auto-anchor registry).
374
540
  See [docs/anchoring.md](docs/anchoring.md).
541
+ - Build-time stamping with `@userflow-tech/react-native/babel-plugin`. Jest
542
+ runs the plugin too, which changes snapshots. Read
543
+ [Babel plugin and snapshot tests](#babel-plugin-and-snapshot-tests) before
544
+ enabling it.
545
+
546
+ ## Install diagnostics
547
+
548
+ In development, the first `Userflow.init` checks native module registration and
549
+ logs one warning when something the SDK needs is not linked. It does not
550
+ `require` an unlinked package. Rebuild the native app after fixing the list; a
551
+ Metro reload is not enough. The warning looks like this (only the missing lines
552
+ are included):
553
+
554
+ ```text
555
+ [Userflow] Native setup is incomplete. Flows may not run until you fix the following, then rebuild the app (a Metro reload is not enough):
556
+ - @react-native-async-storage/async-storage is not linked. Anonymous users and Builder pairing will not persist. Add it to the app package.json (npx expo install @react-native-async-storage/async-storage), run pod install on iOS, and rebuild.
557
+ - react-native-view-shot is not linked, so Builder element selection gets no screenshot. Install react-native-view-shot@^5.0.0 and rebuild. On Expo SDK 54, pin ^5.0.0; an unpinned npx expo install resolves 4.0.3.
558
+ - react-native-webview is not linked. Evaluate JavaScript and WebView banners will not run. Install it (npx expo install react-native-webview) and rebuild.
559
+ - react-native-device-info is not linked, so app_version and app_build are not sent. npm install react-native-device-info, then rebuild.
560
+ See docs/troubleshooting.md.
561
+ ```
562
+
563
+ Passing an environment secret key as `clientToken` throws:
564
+
565
+ ```text
566
+ clientToken is an environment secret key (esk_...). That key must never ship in the app. Pass the client token (ct_...) from Settings → Environments instead.
567
+ ```
568
+
569
+ When the default US endpoint rejects the token with `invalid_client_token`, the
570
+ error also says: `For EU-hosted environments pass serverEndpoint: 'https://e.eu.userflow.com'.`
571
+ Pairing stays on `https://e.userflow.com`.
572
+
573
+ `expo prebuild` warns when the config plugin has no `schemeId`, when
574
+ `react-native-view-shot` is missing or older than 5, and (on Expo SDK 53 and
575
+ older) when AsyncStorage or WebView is not a direct dependency. Passing an
576
+ environment UUID as `schemeId` fails the prebuild:
577
+
578
+ ```text
579
+ [@userflow-tech/react-native] schemeId "550e8400-e29b-41d4-a716-446655440000" looks like an environment id. Pass the scheme_id value that starts with userflow- (an opaque id from the dashboard), not the environment UUID.
580
+ ```
581
+
582
+ ## Jest
583
+
584
+ Mock the package in the host app's Jest setup so tests do not load native
585
+ modules. Mock the router entry you import as well:
586
+
587
+ ```ts
588
+ // jest.setup.ts
589
+ import type { ReactNode } from 'react';
590
+
591
+ jest.mock('@userflow-tech/react-native', () => ({
592
+ Userflow: {
593
+ init: jest.fn(() => Promise.resolve()),
594
+ identify: jest.fn(() => Promise.resolve()),
595
+ identifyAnonymous: jest.fn(() => Promise.resolve()),
596
+ reset: jest.fn(() => Promise.resolve()),
597
+ track: jest.fn(() => Promise.resolve()),
598
+ updateScreen: jest.fn(),
599
+ },
600
+ UserflowProvider: ({ children }: { children: ReactNode }) => children,
601
+ }));
602
+
603
+ // Expo Router
604
+ jest.mock('@userflow-tech/react-native/expo-router', () => ({
605
+ UserflowExpoRouterScreenTracker: () => null,
606
+ }));
607
+
608
+ // React Navigation
609
+ jest.mock('@userflow-tech/react-native/navigation', () => ({
610
+ WithUserflowReactNavigation: ({ children }: { children: ReactNode }) => children,
611
+ }));
612
+ ```
613
+
614
+ In a JavaScript setup file, drop the `ReactNode` import and the type
615
+ annotations.
616
+
617
+ A custom Metro config that does not extend `getDefaultConfig` from `expo/metro-config`
618
+ or `@react-native/metro-config` leaves `allowOptionalDependencies` off. Optional
619
+ peers that this package loads inside `try/catch` then fail the bundle with
620
+ `Unable to resolve module`. Extend the default config so that flag stays on.
621
+
622
+ ### Babel plugin and snapshot tests
623
+
624
+ If you add the optional `@userflow-tech/react-native/babel-plugin` to
625
+ `babel.config.js`, Jest runs it too, because `babel-jest` reads the same config.
626
+ The plugin adds props to `View`, `Text`, `Pressable`, the Touchables,
627
+ `TextInput`, and `Image`, and React Native's Jest mocks render them, so they
628
+ appear in snapshots:
629
+
630
+ ```diff
631
+ <Text
632
+ + __ufid="src/SettingsScreen.tsx::SettingsScreen > View#0 > Text{text=Settings}"
633
+ + collapsable={false}
634
+ + nativeID="uf_1mcelg9"
635
+ >
636
+ Settings
637
+ </Text>
638
+ ```
639
+
640
+ - `nativeID="uf_…"` is added to elements without a `testID`, `nativeID`, or
641
+ `userflowId`.
642
+ - `collapsable={false}` is added to `View`, `Text`, `Pressable`, and the
643
+ Touchables, including elements that have a `testID`.
644
+ - `__ufid` (the element's path in the file) is added in every non-production
645
+ build, which includes Jest.
646
+ - `__ufManual="true"` is added to elements that have a `testID`, `nativeID`, or
647
+ `userflowId`.
648
+
649
+ Updating the snapshots once does not settle it. The ids come from the file path,
650
+ the component name, each element's position among siblings of the same type, and
651
+ static labels. Changing a label, adding an element above others of the same type,
652
+ or moving or renaming a file changes them again. The plugin also imports this
653
+ package into every stamped file, so any test that renders a stamped component
654
+ loads the SDK. Keep the mock above in the Jest setup file.
655
+
656
+ Skip the plugin under Jest:
657
+
658
+ ```js
659
+ // babel.config.js
660
+ module.exports = function (api) {
661
+ const isTest = api.env('test');
662
+ return {
663
+ presets: ['babel-preset-expo'],
664
+ plugins: isTest ? [] : ['@userflow-tech/react-native/babel-plugin'],
665
+ };
666
+ };
667
+ ```
668
+
669
+ Remove `api.cache(true)` if your config has it. Called before `api.env`, it makes
670
+ Babel throw `Caching has already been configured with .never or .forever()`.
671
+ `api.env` already caches the config per environment. Development and release
672
+ builds still run the plugin.
673
+
674
+ To keep some stamping under test, pass `{ stampOnly: isTest }` to the plugin
675
+ instead. Snapshots then gain only `nativeID` and `collapsable`, and stamped files
676
+ skip the SDK import. The plugin's `exclude` option does not help here: it skips
677
+ the files it lists, not the components a test renders.
375
678
 
376
679
  ## What is not available yet
377
680
 
378
- - Banners and embed (inline) surfaces
379
- - `Userflow.track()` / custom event tracking
380
681
  - `INPUT_VALUE` / `FILLED_IN_INPUT` client conditions
381
682
 
382
683
  Flows gated on unsupported client conditions stay unknown and **never start**.