@onairos/react-native 3.4.1 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (574) hide show
  1. package/README.md +423 -374
  2. package/lib/commonjs/api/index.js +9 -145
  3. package/lib/commonjs/assets/animations/loaderani.json +1 -0
  4. package/lib/commonjs/assets/animations/persona-animation.json +1 -0
  5. package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  6. package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  7. package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
  8. package/lib/commonjs/assets/icons/Gmail.png +0 -0
  9. package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
  10. package/lib/commonjs/assets/icons/Redditicon.png +0 -0
  11. package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
  12. package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
  13. package/lib/commonjs/assets/icons/chatgpt.png +0 -0
  14. package/lib/commonjs/assets/icons/claude.png +0 -0
  15. package/lib/commonjs/assets/icons/gemini.png +0 -0
  16. package/lib/commonjs/assets/icons/grok.png +0 -0
  17. package/lib/commonjs/assets/images/Checkbox.svg +3 -0
  18. package/lib/commonjs/assets/images/EnochE.svg +19 -0
  19. package/lib/commonjs/assets/images/Enochicon1.png +0 -0
  20. package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
  21. package/lib/commonjs/assets/images/Facebookicon.png +0 -0
  22. package/lib/commonjs/assets/images/Gmail.png +0 -0
  23. package/lib/commonjs/assets/images/Googlelogo.png +0 -0
  24. package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
  25. package/lib/commonjs/assets/images/OnairosNewLogo.png +0 -0
  26. package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
  27. package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
  28. package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
  29. package/lib/commonjs/assets/images/Redditicon.png +0 -0
  30. package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
  31. package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
  32. package/lib/commonjs/assets/images/arrow.svg +20 -0
  33. package/lib/commonjs/assets/images/basicproficon.svg +43 -0
  34. package/lib/commonjs/assets/images/basicprofile.svg +3 -0
  35. package/lib/commonjs/assets/images/chatgpt.png +0 -0
  36. package/lib/commonjs/assets/images/checkmark.svg +4 -0
  37. package/lib/commonjs/assets/images/claude.png +0 -0
  38. package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
  39. package/lib/commonjs/assets/images/contenticon.svg +23 -0
  40. package/lib/commonjs/assets/images/gemini.png +0 -0
  41. package/lib/commonjs/assets/images/grok.png +0 -0
  42. package/lib/commonjs/assets/images/persona1.png +0 -0
  43. package/lib/commonjs/assets/images/persona2.png +0 -0
  44. package/lib/commonjs/assets/images/persona3.png +0 -0
  45. package/lib/commonjs/assets/images/persona4.png +0 -0
  46. package/lib/commonjs/assets/images/persona5.png +0 -0
  47. package/lib/commonjs/assets/images/personalityicon.svg +18 -0
  48. package/lib/commonjs/assets/images/x-close.svg +3 -0
  49. package/lib/commonjs/components/BodyText.js +9 -0
  50. package/lib/commonjs/components/BrandMark.js +10 -0
  51. package/lib/commonjs/components/CodeInput.js +9 -0
  52. package/lib/commonjs/components/EmailInput.js +8 -0
  53. package/lib/commonjs/components/GoogleButton.js +9 -0
  54. package/lib/commonjs/components/HeadingGroup.js +9 -0
  55. package/lib/commonjs/components/LLMDataInputModal.js +14 -0
  56. package/lib/commonjs/components/ModalHeader.js +9 -0
  57. package/lib/commonjs/components/ModalSheet.js +9 -0
  58. package/lib/commonjs/components/Onairos.js +14 -374
  59. package/lib/commonjs/components/OnairosButton.js +13 -309
  60. package/lib/commonjs/components/OnairosSignInButton.js +12 -0
  61. package/lib/commonjs/components/Overlay.js +13 -483
  62. package/lib/commonjs/components/PersonaImage.js +10 -0
  63. package/lib/commonjs/components/PersonaLoadingScreen.js +12 -0
  64. package/lib/commonjs/components/PersonalizationConsentScreen.js +13 -0
  65. package/lib/commonjs/components/PinCreationScreen.js +12 -0
  66. package/lib/commonjs/components/PinInput.js +9 -302
  67. package/lib/commonjs/components/PlatformConnectorsStep.js +23 -0
  68. package/lib/commonjs/components/PlatformList.js +10 -137
  69. package/lib/commonjs/components/PlatformToggle.js +9 -0
  70. package/lib/commonjs/components/PrimaryButton.js +10 -0
  71. package/lib/commonjs/components/SignInMatchAnimation.js +9 -0
  72. package/lib/commonjs/components/SignInStep.js +12 -0
  73. package/lib/commonjs/components/UniversalOnboarding.js +30 -1702
  74. package/lib/commonjs/components/VerificationStep.js +11 -0
  75. package/lib/commonjs/components/WelcomeScreen.js +22 -0
  76. package/lib/commonjs/components/icons/Basicproficon.js +8 -0
  77. package/lib/commonjs/components/icons/Basicprofile.js +8 -0
  78. package/lib/commonjs/components/icons/Checkbox.js +8 -0
  79. package/lib/commonjs/components/icons/Checkmark.js +8 -0
  80. package/lib/commonjs/components/icons/Contentanalysis.js +8 -0
  81. package/lib/commonjs/components/icons/Contenticon.js +8 -0
  82. package/lib/commonjs/components/icons/EnochE.js +8 -0
  83. package/lib/commonjs/components/icons/Personalityicon.js +8 -0
  84. package/lib/commonjs/components/icons/Personalityprofile.js +8 -0
  85. package/lib/commonjs/components/icons/Personalitytraits.js +8 -0
  86. package/lib/commonjs/components/icons/Userpreferences.js +8 -0
  87. package/lib/commonjs/components/icons/index.js +17 -0
  88. package/lib/commonjs/components/onboarding/OAuthWebView.js +18 -827
  89. package/lib/commonjs/components/onboarding/OnboardingHeader.js +10 -74
  90. package/lib/commonjs/components/onboarding/PinInput.js +10 -283
  91. package/lib/commonjs/components/onboarding/PlatformConnector.js +11 -249
  92. package/lib/commonjs/config/api.js +7 -0
  93. package/lib/commonjs/constants/index.js +7 -83
  94. package/lib/commonjs/context/AuthContext.js +10 -0
  95. package/lib/commonjs/hooks/useConnectedAccounts.js +9 -0
  96. package/lib/commonjs/hooks/useConnections.js +8 -159
  97. package/lib/commonjs/hooks/useCredentials.js +10 -177
  98. package/lib/commonjs/hooks/useUserConnections.js +10 -0
  99. package/lib/commonjs/index.js +34 -106
  100. package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +421 -421
  101. package/lib/commonjs/services/apiClient.js +8 -0
  102. package/lib/commonjs/services/apiKeyService.js +9 -952
  103. package/lib/commonjs/services/authService.js +10 -0
  104. package/lib/commonjs/services/biometricPinService.js +8 -0
  105. package/lib/commonjs/services/chatGPTConversationExtractor.js +8 -0
  106. package/lib/commonjs/services/chatGPTConversationService.js +9 -0
  107. package/lib/commonjs/services/claudeConversationExtractor.js +8 -0
  108. package/lib/commonjs/services/claudeConversationService.js +9 -0
  109. package/lib/commonjs/services/connectedAccountsService.js +10 -0
  110. package/lib/commonjs/services/googleAuthService.js +11 -0
  111. package/lib/commonjs/services/hingeDataExtractor.js +8 -0
  112. package/lib/commonjs/services/hingeDataService.js +9 -0
  113. package/lib/commonjs/services/imageCompressionService.js +7 -0
  114. package/lib/commonjs/services/instagramDataExtractor.js +8 -0
  115. package/lib/commonjs/services/instagramDataService.js +9 -0
  116. package/lib/commonjs/services/jwtStorageService.js +7 -0
  117. package/lib/commonjs/services/linkedinDOMExtractor.js +7 -0
  118. package/lib/commonjs/services/linkedinProfileService.js +9 -0
  119. package/lib/commonjs/services/linkedinScrapingService.js +8 -0
  120. package/lib/commonjs/services/llmDataStorage.js +8 -0
  121. package/lib/commonjs/services/mobileTrainingService.js +8 -0
  122. package/lib/commonjs/services/oauthService.js +11 -390
  123. package/lib/commonjs/services/pinEncryptionService.js +8 -0
  124. package/lib/commonjs/services/pinStorageUtils.js +7 -0
  125. package/lib/commonjs/services/platformAuthService.js +12 -1067
  126. package/lib/commonjs/services/sephoraDataExtractor.js +8 -0
  127. package/lib/commonjs/services/sephoraDataService.js +9 -0
  128. package/lib/commonjs/services/storageService.js +8 -0
  129. package/lib/commonjs/services/telegramDataExtractor.js +8 -0
  130. package/lib/commonjs/services/telegramDataService.js +11 -0
  131. package/lib/commonjs/services/trainingApiHelpers.js +7 -0
  132. package/lib/commonjs/services/userConnectionsService.js +10 -0
  133. package/lib/commonjs/services/youtubeMigrationService.js +10 -0
  134. package/lib/commonjs/theme/index.js +7 -0
  135. package/lib/commonjs/types/ambient.d.js +1 -2
  136. package/lib/commonjs/types/declarations.d.js +1 -2
  137. package/lib/commonjs/types/index.js +1 -6
  138. package/lib/commonjs/types/node-fix.d.js +1 -2
  139. package/lib/commonjs/types/node-override.d.js +1 -2
  140. package/lib/commonjs/types/opacity.d.js +1 -2
  141. package/lib/commonjs/types.js +1 -14
  142. package/lib/commonjs/utils/Portal.js +8 -98
  143. package/lib/commonjs/utils/api.js +9 -129
  144. package/lib/commonjs/utils/assetRegistry.js +33 -0
  145. package/lib/commonjs/utils/auth.js +9 -111
  146. package/lib/commonjs/utils/connectorTests.js +29 -0
  147. package/lib/commonjs/utils/crypto.js +8 -62
  148. package/lib/commonjs/utils/debugHelper.js +1 -64
  149. package/lib/commonjs/utils/encryption.js +7 -76
  150. package/lib/commonjs/utils/eventUtils.js +1 -0
  151. package/lib/commonjs/utils/haptics.js +9 -0
  152. package/lib/commonjs/utils/imagePreloader.js +1 -0
  153. package/lib/commonjs/utils/networkDiagnostics.js +8 -0
  154. package/lib/commonjs/utils/onairosApi.js +9 -350
  155. package/lib/commonjs/utils/programmaticFlow.js +9 -117
  156. package/lib/commonjs/utils/retryHelper.js +1 -220
  157. package/lib/commonjs/utils/secureStorage.js +10 -349
  158. package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -0
  159. package/lib/commonjs/utils/webviewScripts/claude.js +1 -0
  160. package/lib/commonjs/utils/webviewScripts/hinge.js +1 -0
  161. package/lib/commonjs/utils/webviewScripts/index.js +13 -0
  162. package/lib/commonjs/utils/webviewScripts/instagram.js +1 -0
  163. package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
  164. package/lib/commonjs/utils/webviewScripts/sephora.js +1 -0
  165. package/lib/commonjs/utils/webviewScripts/telegram.js +1 -0
  166. package/lib/module/api/index.js +1 -139
  167. package/lib/module/assets/animations/loaderani.json +1 -0
  168. package/lib/module/assets/animations/persona-animation.json +1 -0
  169. package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  170. package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  171. package/lib/module/assets/icons/Facebookicon.png +0 -0
  172. package/lib/module/assets/icons/Gmail.png +0 -0
  173. package/lib/module/assets/icons/Linkedinicon.png +0 -0
  174. package/lib/module/assets/icons/Redditicon.png +0 -0
  175. package/lib/module/assets/icons/YouTubeicon2.png +0 -0
  176. package/lib/module/assets/icons/YouTubeicon3.png +0 -0
  177. package/lib/module/assets/icons/chatgpt.png +0 -0
  178. package/lib/module/assets/icons/claude.png +0 -0
  179. package/lib/module/assets/icons/farcaster.png +0 -0
  180. package/lib/module/assets/icons/gemini.png +0 -0
  181. package/lib/module/assets/icons/grok.png +0 -0
  182. package/lib/module/assets/icons/instagram.png +0 -0
  183. package/lib/module/assets/icons/pinterest.png +0 -0
  184. package/lib/module/assets/icons/swerv_logo.png +0 -0
  185. package/lib/module/assets/icons/twitter.jpg +0 -0
  186. package/lib/module/assets/images/Checkbox.svg +3 -0
  187. package/lib/module/assets/images/EnochE.svg +19 -0
  188. package/lib/module/assets/images/Enochicon1.png +0 -0
  189. package/lib/module/assets/images/Face_ID_logo.png +0 -0
  190. package/lib/module/assets/images/Facebookicon.png +0 -0
  191. package/lib/module/assets/images/Gmail.png +0 -0
  192. package/lib/module/assets/images/Googlelogo.png +0 -0
  193. package/lib/module/assets/images/Linkedinicon.png +0 -0
  194. package/lib/module/assets/images/OnairosNewLogo.png +0 -0
  195. package/lib/module/assets/images/Onairoslogo.png +0 -0
  196. package/lib/module/assets/images/Personalityprofile.svg +3 -0
  197. package/lib/module/assets/images/Personalitytraits.svg +3 -0
  198. package/lib/module/assets/images/Redditicon.png +0 -0
  199. package/lib/module/assets/images/Userpreferences.svg +3 -0
  200. package/lib/module/assets/images/YouTubeicon3.png +0 -0
  201. package/lib/module/assets/images/arrow.svg +20 -0
  202. package/lib/module/assets/images/basicproficon.svg +43 -0
  203. package/lib/module/assets/images/basicprofile.svg +3 -0
  204. package/lib/module/assets/images/chatgpt.png +0 -0
  205. package/lib/module/assets/images/checkmark.svg +4 -0
  206. package/lib/module/assets/images/claude.png +0 -0
  207. package/lib/module/assets/images/contentanalysis.svg +3 -0
  208. package/lib/module/assets/images/contenticon.svg +23 -0
  209. package/lib/module/assets/images/gemini.png +0 -0
  210. package/lib/module/assets/images/grok.png +0 -0
  211. package/lib/module/assets/images/persona1.png +0 -0
  212. package/lib/module/assets/images/persona2.png +0 -0
  213. package/lib/module/assets/images/persona3.png +0 -0
  214. package/lib/module/assets/images/persona4.png +0 -0
  215. package/lib/module/assets/images/persona5.png +0 -0
  216. package/lib/module/assets/images/personalityicon.svg +18 -0
  217. package/lib/module/assets/images/x-close.svg +3 -0
  218. package/lib/module/components/BodyText.js +1 -0
  219. package/lib/module/components/BrandMark.js +1 -0
  220. package/lib/module/components/CodeInput.js +1 -0
  221. package/lib/module/components/EmailInput.js +1 -0
  222. package/lib/module/components/GoogleButton.js +1 -0
  223. package/lib/module/components/HeadingGroup.js +1 -0
  224. package/lib/module/components/LLMDataInputModal.js +8 -0
  225. package/lib/module/components/ModalHeader.js +1 -0
  226. package/lib/module/components/ModalSheet.js +1 -0
  227. package/lib/module/components/Onairos.js +1 -367
  228. package/lib/module/components/OnairosButton.js +1 -302
  229. package/lib/module/components/OnairosSignInButton.js +1 -0
  230. package/lib/module/components/Overlay.js +1 -474
  231. package/lib/module/components/PersonaImage.js +1 -0
  232. package/lib/module/components/PersonaLoadingScreen.js +1 -0
  233. package/lib/module/components/PersonalizationConsentScreen.js +1 -0
  234. package/lib/module/components/PinCreationScreen.js +1 -0
  235. package/lib/module/components/PinInput.js +1 -293
  236. package/lib/module/components/PlatformConnectorsStep.js +7 -0
  237. package/lib/module/components/PlatformList.js +1 -129
  238. package/lib/module/components/PlatformToggle.js +1 -0
  239. package/lib/module/components/PrimaryButton.js +1 -0
  240. package/lib/module/components/SignInMatchAnimation.js +1 -0
  241. package/lib/module/components/SignInStep.js +1 -0
  242. package/lib/module/components/UniversalOnboarding.js +1 -1693
  243. package/lib/module/components/VerificationStep.js +1 -0
  244. package/lib/module/components/WelcomeScreen.js +1 -0
  245. package/lib/module/components/icons/Basicproficon.js +1 -0
  246. package/lib/module/components/icons/Basicprofile.js +1 -0
  247. package/lib/module/components/icons/Checkbox.js +1 -0
  248. package/lib/module/components/icons/Checkmark.js +1 -0
  249. package/lib/module/components/icons/Contentanalysis.js +1 -0
  250. package/lib/module/components/icons/Contenticon.js +1 -0
  251. package/lib/module/components/icons/EnochE.js +1 -0
  252. package/lib/module/components/icons/Personalityicon.js +1 -0
  253. package/lib/module/components/icons/Personalityprofile.js +1 -0
  254. package/lib/module/components/icons/Personalitytraits.js +1 -0
  255. package/lib/module/components/icons/Userpreferences.js +1 -0
  256. package/lib/module/components/icons/index.js +1 -0
  257. package/lib/module/components/onboarding/OAuthWebView.js +1 -818
  258. package/lib/module/components/onboarding/OnboardingHeader.js +1 -66
  259. package/lib/module/components/onboarding/PinInput.js +1 -274
  260. package/lib/module/components/onboarding/PlatformConnector.js +1 -240
  261. package/lib/module/config/api.js +1 -0
  262. package/lib/module/constants/index.js +1 -77
  263. package/lib/module/context/AuthContext.js +1 -0
  264. package/lib/module/hooks/useConnectedAccounts.js +1 -0
  265. package/lib/module/hooks/useConnections.js +1 -152
  266. package/lib/module/hooks/useCredentials.js +6 -169
  267. package/lib/module/hooks/useUserConnections.js +1 -0
  268. package/lib/module/index.js +1 -32
  269. package/lib/module/services/SDK_API_KEY_VALIDATION.md +421 -421
  270. package/lib/module/services/apiClient.js +1 -0
  271. package/lib/module/services/apiKeyService.js +1 -925
  272. package/lib/module/services/authService.js +1 -0
  273. package/lib/module/services/biometricPinService.js +1 -0
  274. package/lib/module/services/chatGPTConversationExtractor.js +1 -0
  275. package/lib/module/services/chatGPTConversationService.js +1 -0
  276. package/lib/module/services/claudeConversationExtractor.js +1 -0
  277. package/lib/module/services/claudeConversationService.js +1 -0
  278. package/lib/module/services/connectedAccountsService.js +1 -0
  279. package/lib/module/services/googleAuthService.js +1 -0
  280. package/lib/module/services/hingeDataExtractor.js +1 -0
  281. package/lib/module/services/hingeDataService.js +1 -0
  282. package/lib/module/services/imageCompressionService.js +1 -0
  283. package/lib/module/services/instagramDataExtractor.js +1 -0
  284. package/lib/module/services/instagramDataService.js +1 -0
  285. package/lib/module/services/jwtStorageService.js +1 -0
  286. package/lib/module/services/linkedinDOMExtractor.js +1 -0
  287. package/lib/module/services/linkedinProfileService.js +1 -0
  288. package/lib/module/services/linkedinScrapingService.js +1 -0
  289. package/lib/module/services/llmDataStorage.js +1 -0
  290. package/lib/module/services/mobileTrainingService.js +1 -0
  291. package/lib/module/services/oauthService.js +1 -380
  292. package/lib/module/services/pinEncryptionService.js +7 -0
  293. package/lib/module/services/pinStorageUtils.js +1 -0
  294. package/lib/module/services/platformAuthService.js +1 -1041
  295. package/lib/module/services/sephoraDataExtractor.js +1 -0
  296. package/lib/module/services/sephoraDataService.js +1 -0
  297. package/lib/module/services/storageService.js +1 -0
  298. package/lib/module/services/telegramDataExtractor.js +1 -0
  299. package/lib/module/services/telegramDataService.js +8 -0
  300. package/lib/module/services/trainingApiHelpers.js +1 -0
  301. package/lib/module/services/userConnectionsService.js +1 -0
  302. package/lib/module/services/youtubeMigrationService.js +1 -0
  303. package/lib/module/theme/index.js +1 -0
  304. package/lib/module/types.js +1 -10
  305. package/lib/module/utils/Portal.js +1 -90
  306. package/lib/module/utils/api.js +1 -117
  307. package/lib/module/utils/assetRegistry.js +33 -0
  308. package/lib/module/utils/auth.js +1 -99
  309. package/lib/module/utils/connectorTests.js +28 -0
  310. package/lib/module/utils/crypto.js +1 -54
  311. package/lib/module/utils/debugHelper.js +1 -54
  312. package/lib/module/utils/encryption.js +1 -67
  313. package/lib/module/utils/eventUtils.js +1 -0
  314. package/lib/module/utils/haptics.js +8 -0
  315. package/lib/module/utils/imagePreloader.js +1 -0
  316. package/lib/module/utils/networkDiagnostics.js +1 -0
  317. package/lib/module/utils/onairosApi.js +1 -333
  318. package/lib/module/utils/programmaticFlow.js +1 -111
  319. package/lib/module/utils/retryHelper.js +1 -211
  320. package/lib/module/utils/secureStorage.js +6 -330
  321. package/lib/module/utils/webviewScripts/chatgpt.js +1 -0
  322. package/lib/module/utils/webviewScripts/claude.js +1 -0
  323. package/lib/module/utils/webviewScripts/hinge.js +1 -0
  324. package/lib/module/utils/webviewScripts/index.js +1 -0
  325. package/lib/module/utils/webviewScripts/instagram.js +1 -0
  326. package/lib/module/utils/webviewScripts/linkedin.js +1 -0
  327. package/lib/module/utils/webviewScripts/sephora.js +1 -0
  328. package/lib/module/utils/webviewScripts/telegram.js +1 -0
  329. package/package.json +62 -39
  330. package/lib/commonjs/api/index.js.map +0 -1
  331. package/lib/commonjs/assets/images/email.png +0 -0
  332. package/lib/commonjs/assets/images/linkedin.png +0 -0
  333. package/lib/commonjs/assets/images/reddit.png +0 -0
  334. package/lib/commonjs/assets/images/youtube.png +0 -0
  335. package/lib/commonjs/components/DataRequestModal.js +0 -228
  336. package/lib/commonjs/components/DataRequestModal.js.map +0 -1
  337. package/lib/commonjs/components/DataRequestScreen.js +0 -329
  338. package/lib/commonjs/components/DataRequestScreen.js.map +0 -1
  339. package/lib/commonjs/components/EmailVerificationModal.js +0 -320
  340. package/lib/commonjs/components/EmailVerificationModal.js.map +0 -1
  341. package/lib/commonjs/components/Onairos.js.map +0 -1
  342. package/lib/commonjs/components/OnairosButton.js.map +0 -1
  343. package/lib/commonjs/components/Overlay.js.map +0 -1
  344. package/lib/commonjs/components/PinInput.js.map +0 -1
  345. package/lib/commonjs/components/PlatformList.js.map +0 -1
  346. package/lib/commonjs/components/TrainingModal.js +0 -717
  347. package/lib/commonjs/components/TrainingModal.js.map +0 -1
  348. package/lib/commonjs/components/UniversalOnboarding.js.map +0 -1
  349. package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
  350. package/lib/commonjs/components/onboarding/OAuthWebView.js.map +0 -1
  351. package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +0 -1
  352. package/lib/commonjs/components/onboarding/PinInput.js.map +0 -1
  353. package/lib/commonjs/components/onboarding/PlatformConnector.js.map +0 -1
  354. package/lib/commonjs/components/screens/ConnectorScreen.js +0 -146
  355. package/lib/commonjs/components/screens/ConnectorScreen.js.map +0 -1
  356. package/lib/commonjs/components/screens/LoadingScreen.js +0 -91
  357. package/lib/commonjs/components/screens/LoadingScreen.js.map +0 -1
  358. package/lib/commonjs/components/screens/PinCreationScreen.js +0 -61
  359. package/lib/commonjs/components/screens/PinCreationScreen.js.map +0 -1
  360. package/lib/commonjs/constants/index.js.map +0 -1
  361. package/lib/commonjs/hooks/useConnections.js.map +0 -1
  362. package/lib/commonjs/hooks/useCredentials.js.map +0 -1
  363. package/lib/commonjs/index.js.map +0 -1
  364. package/lib/commonjs/services/apiKeyService.js.map +0 -1
  365. package/lib/commonjs/services/oauthService.js.map +0 -1
  366. package/lib/commonjs/services/platformAuthService.js.map +0 -1
  367. package/lib/commonjs/types/ambient.d.js.map +0 -1
  368. package/lib/commonjs/types/declarations.d.js.map +0 -1
  369. package/lib/commonjs/types/index.d.js.map +0 -1
  370. package/lib/commonjs/types/index.js.map +0 -1
  371. package/lib/commonjs/types/node-fix.d.js.map +0 -1
  372. package/lib/commonjs/types/node-override.d.js.map +0 -1
  373. package/lib/commonjs/types/opacity.d.js.map +0 -1
  374. package/lib/commonjs/types/types.d.js.map +0 -1
  375. package/lib/commonjs/types.js.map +0 -1
  376. package/lib/commonjs/utils/Portal.js.map +0 -1
  377. package/lib/commonjs/utils/api.js.map +0 -1
  378. package/lib/commonjs/utils/auth.js.map +0 -1
  379. package/lib/commonjs/utils/crypto.js.map +0 -1
  380. package/lib/commonjs/utils/debugHelper.js.map +0 -1
  381. package/lib/commonjs/utils/encryption.js.map +0 -1
  382. package/lib/commonjs/utils/onairosApi.js.map +0 -1
  383. package/lib/commonjs/utils/programmaticFlow.js.map +0 -1
  384. package/lib/commonjs/utils/retryHelper.js.map +0 -1
  385. package/lib/commonjs/utils/secureStorage.js.map +0 -1
  386. package/lib/module/api/index.js.map +0 -1
  387. package/lib/module/assets/images/email.png +0 -0
  388. package/lib/module/assets/images/linkedin.png +0 -0
  389. package/lib/module/assets/images/reddit.png +0 -0
  390. package/lib/module/assets/images/youtube.png +0 -0
  391. package/lib/module/components/DataRequestModal.js +0 -220
  392. package/lib/module/components/DataRequestModal.js.map +0 -1
  393. package/lib/module/components/DataRequestScreen.js +0 -321
  394. package/lib/module/components/DataRequestScreen.js.map +0 -1
  395. package/lib/module/components/EmailVerificationModal.js +0 -311
  396. package/lib/module/components/EmailVerificationModal.js.map +0 -1
  397. package/lib/module/components/Onairos.js.map +0 -1
  398. package/lib/module/components/OnairosButton.js.map +0 -1
  399. package/lib/module/components/Overlay.js.map +0 -1
  400. package/lib/module/components/PinInput.js.map +0 -1
  401. package/lib/module/components/PlatformList.js.map +0 -1
  402. package/lib/module/components/TrainingModal.js +0 -708
  403. package/lib/module/components/TrainingModal.js.map +0 -1
  404. package/lib/module/components/UniversalOnboarding.js.map +0 -1
  405. package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
  406. package/lib/module/components/onboarding/OAuthWebView.js.map +0 -1
  407. package/lib/module/components/onboarding/OnboardingHeader.js.map +0 -1
  408. package/lib/module/components/onboarding/PinInput.js.map +0 -1
  409. package/lib/module/components/onboarding/PlatformConnector.js.map +0 -1
  410. package/lib/module/components/screens/ConnectorScreen.js +0 -138
  411. package/lib/module/components/screens/ConnectorScreen.js.map +0 -1
  412. package/lib/module/components/screens/LoadingScreen.js +0 -83
  413. package/lib/module/components/screens/LoadingScreen.js.map +0 -1
  414. package/lib/module/components/screens/PinCreationScreen.js +0 -53
  415. package/lib/module/components/screens/PinCreationScreen.js.map +0 -1
  416. package/lib/module/constants/index.js.map +0 -1
  417. package/lib/module/hooks/useConnections.js.map +0 -1
  418. package/lib/module/hooks/useCredentials.js.map +0 -1
  419. package/lib/module/index.js.map +0 -1
  420. package/lib/module/services/apiKeyService.js.map +0 -1
  421. package/lib/module/services/oauthService.js.map +0 -1
  422. package/lib/module/services/platformAuthService.js.map +0 -1
  423. package/lib/module/types/ambient.d.js.map +0 -1
  424. package/lib/module/types/declarations.d.js.map +0 -1
  425. package/lib/module/types/index.d.js.map +0 -1
  426. package/lib/module/types/index.js.map +0 -1
  427. package/lib/module/types/node-fix.d.js.map +0 -1
  428. package/lib/module/types/node-override.d.js.map +0 -1
  429. package/lib/module/types/opacity.d.js.map +0 -1
  430. package/lib/module/types/types.d.js.map +0 -1
  431. package/lib/module/types.js.map +0 -1
  432. package/lib/module/utils/Portal.js.map +0 -1
  433. package/lib/module/utils/api.js.map +0 -1
  434. package/lib/module/utils/auth.js.map +0 -1
  435. package/lib/module/utils/crypto.js.map +0 -1
  436. package/lib/module/utils/debugHelper.js.map +0 -1
  437. package/lib/module/utils/encryption.js.map +0 -1
  438. package/lib/module/utils/onairosApi.js.map +0 -1
  439. package/lib/module/utils/programmaticFlow.js.map +0 -1
  440. package/lib/module/utils/retryHelper.js.map +0 -1
  441. package/lib/module/utils/secureStorage.js.map +0 -1
  442. package/lib/typescript/api/index.d.ts +0 -8
  443. package/lib/typescript/api/index.d.ts.map +0 -1
  444. package/lib/typescript/components/DataRequestModal.d.ts +0 -11
  445. package/lib/typescript/components/DataRequestModal.d.ts.map +0 -1
  446. package/lib/typescript/components/DataRequestScreen.d.ts +0 -11
  447. package/lib/typescript/components/DataRequestScreen.d.ts.map +0 -1
  448. package/lib/typescript/components/EmailVerificationModal.d.ts +0 -11
  449. package/lib/typescript/components/EmailVerificationModal.d.ts.map +0 -1
  450. package/lib/typescript/components/Onairos.d.ts +0 -4
  451. package/lib/typescript/components/Onairos.d.ts.map +0 -1
  452. package/lib/typescript/components/OnairosButton.d.ts +0 -12
  453. package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
  454. package/lib/typescript/components/Overlay.d.ts +0 -4
  455. package/lib/typescript/components/Overlay.d.ts.map +0 -1
  456. package/lib/typescript/components/PinInput.d.ts +0 -4
  457. package/lib/typescript/components/PinInput.d.ts.map +0 -1
  458. package/lib/typescript/components/PlatformList.d.ts +0 -4
  459. package/lib/typescript/components/PlatformList.d.ts.map +0 -1
  460. package/lib/typescript/components/TrainingModal.d.ts +0 -4
  461. package/lib/typescript/components/TrainingModal.d.ts.map +0 -1
  462. package/lib/typescript/components/UniversalOnboarding.d.ts +0 -4
  463. package/lib/typescript/components/UniversalOnboarding.d.ts.map +0 -1
  464. package/lib/typescript/components/onboarding/OAuthWebView.d.ts +0 -10
  465. package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +0 -1
  466. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +0 -11
  467. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts.map +0 -1
  468. package/lib/typescript/components/onboarding/PinInput.d.ts +0 -4
  469. package/lib/typescript/components/onboarding/PinInput.d.ts.map +0 -1
  470. package/lib/typescript/components/onboarding/PlatformConnector.d.ts +0 -13
  471. package/lib/typescript/components/onboarding/PlatformConnector.d.ts.map +0 -1
  472. package/lib/typescript/components/screens/ConnectorScreen.d.ts +0 -9
  473. package/lib/typescript/components/screens/ConnectorScreen.d.ts.map +0 -1
  474. package/lib/typescript/components/screens/LoadingScreen.d.ts +0 -9
  475. package/lib/typescript/components/screens/LoadingScreen.d.ts.map +0 -1
  476. package/lib/typescript/components/screens/PinCreationScreen.d.ts +0 -10
  477. package/lib/typescript/components/screens/PinCreationScreen.d.ts.map +0 -1
  478. package/lib/typescript/constants/index.d.ts +0 -53
  479. package/lib/typescript/constants/index.d.ts.map +0 -1
  480. package/lib/typescript/hooks/useConnections.d.ts +0 -9
  481. package/lib/typescript/hooks/useConnections.d.ts.map +0 -1
  482. package/lib/typescript/hooks/useCredentials.d.ts +0 -9
  483. package/lib/typescript/hooks/useCredentials.d.ts.map +0 -1
  484. package/lib/typescript/index.d.ts +0 -18
  485. package/lib/typescript/index.d.ts.map +0 -1
  486. package/lib/typescript/services/apiKeyService.d.ts +0 -132
  487. package/lib/typescript/services/apiKeyService.d.ts.map +0 -1
  488. package/lib/typescript/services/oauthService.d.ts +0 -50
  489. package/lib/typescript/services/oauthService.d.ts.map +0 -1
  490. package/lib/typescript/services/platformAuthService.d.ts +0 -144
  491. package/lib/typescript/services/platformAuthService.d.ts.map +0 -1
  492. package/lib/typescript/types/index.d.ts +0 -231
  493. package/lib/typescript/types/index.d.ts.map +0 -1
  494. package/lib/typescript/types.d.ts +0 -270
  495. package/lib/typescript/types.d.ts.map +0 -1
  496. package/lib/typescript/utils/Portal.d.ts +0 -14
  497. package/lib/typescript/utils/Portal.d.ts.map +0 -1
  498. package/lib/typescript/utils/api.d.ts +0 -6
  499. package/lib/typescript/utils/api.d.ts.map +0 -1
  500. package/lib/typescript/utils/auth.d.ts +0 -6
  501. package/lib/typescript/utils/auth.d.ts.map +0 -1
  502. package/lib/typescript/utils/crypto.d.ts +0 -4
  503. package/lib/typescript/utils/crypto.d.ts.map +0 -1
  504. package/lib/typescript/utils/debugHelper.d.ts +0 -29
  505. package/lib/typescript/utils/debugHelper.d.ts.map +0 -1
  506. package/lib/typescript/utils/encryption.d.ts +0 -19
  507. package/lib/typescript/utils/encryption.d.ts.map +0 -1
  508. package/lib/typescript/utils/onairosApi.d.ts +0 -87
  509. package/lib/typescript/utils/onairosApi.d.ts.map +0 -1
  510. package/lib/typescript/utils/programmaticFlow.d.ts +0 -23
  511. package/lib/typescript/utils/programmaticFlow.d.ts.map +0 -1
  512. package/lib/typescript/utils/retryHelper.d.ts +0 -69
  513. package/lib/typescript/utils/retryHelper.d.ts.map +0 -1
  514. package/lib/typescript/utils/secureStorage.d.ts +0 -94
  515. package/lib/typescript/utils/secureStorage.d.ts.map +0 -1
  516. package/src/api/index.ts +0 -111
  517. package/src/assets/images/email.png +0 -0
  518. package/src/assets/images/linkedin.png +0 -0
  519. package/src/assets/images/onairos_logo.png +0 -0
  520. package/src/assets/images/reddit.png +0 -0
  521. package/src/assets/images/youtube.png +0 -0
  522. package/src/components/DataRequestModal.tsx +0 -227
  523. package/src/components/DataRequestScreen.tsx +0 -356
  524. package/src/components/EmailVerificationModal.tsx +0 -364
  525. package/src/components/Onairos.tsx +0 -425
  526. package/src/components/OnairosButton.tsx +0 -359
  527. package/src/components/Overlay.tsx +0 -506
  528. package/src/components/PinInput.tsx +0 -343
  529. package/src/components/PlatformList.tsx +0 -145
  530. package/src/components/TrainingModal.tsx +0 -737
  531. package/src/components/UniversalOnboarding.tsx +0 -1839
  532. package/src/components/UniversalOnboarding.tsx.new +0 -455
  533. package/src/components/onboarding/OAuthWebView.tsx +0 -838
  534. package/src/components/onboarding/OnboardingHeader.tsx +0 -70
  535. package/src/components/onboarding/PinInput.tsx +0 -356
  536. package/src/components/onboarding/PlatformConnector.tsx +0 -302
  537. package/src/components/screens/ConnectorScreen.tsx +0 -153
  538. package/src/components/screens/LoadingScreen.tsx +0 -100
  539. package/src/components/screens/PinCreationScreen.tsx +0 -67
  540. package/src/constants/index.ts +0 -83
  541. package/src/hooks/useConnections.ts +0 -163
  542. package/src/hooks/useCredentials.ts +0 -175
  543. package/src/index.js +0 -14
  544. package/src/index.ts +0 -50
  545. package/src/services/SDK_API_KEY_VALIDATION.md +0 -421
  546. package/src/services/apiKeyService.ts +0 -984
  547. package/src/services/oauthService.ts +0 -412
  548. package/src/services/platformAuthService.ts +0 -1113
  549. package/src/types/ambient.d.ts +0 -29
  550. package/src/types/declarations.d.ts +0 -26
  551. package/src/types/index.d.ts +0 -274
  552. package/src/types/index.ts +0 -244
  553. package/src/types/node-fix.d.ts +0 -19
  554. package/src/types/node-override.d.ts +0 -24
  555. package/src/types/opacity.d.ts +0 -16
  556. package/src/types/types.d.ts +0 -18
  557. package/src/types.ts +0 -298
  558. package/src/utils/Portal.tsx +0 -83
  559. package/src/utils/api.js +0 -112
  560. package/src/utils/auth.js +0 -104
  561. package/src/utils/crypto.js +0 -60
  562. package/src/utils/debugHelper.ts +0 -53
  563. package/src/utils/encryption.ts +0 -69
  564. package/src/utils/onairosApi.ts +0 -391
  565. package/src/utils/programmaticFlow.ts +0 -113
  566. package/src/utils/retryHelper.ts +0 -275
  567. package/src/utils/secureStorage.ts +0 -361
  568. package/types/index.d.ts +0 -218
  569. package/types/node-env.d.ts +0 -15
  570. /package/{src/assets/images → lib/commonjs/assets/icons}/farcaster.png +0 -0
  571. /package/{src/assets/images → lib/commonjs/assets/icons}/instagram.png +0 -0
  572. /package/{src/assets/images → lib/commonjs/assets/icons}/pinterest.png +0 -0
  573. /package/{src/assets/images → lib/commonjs/assets/icons}/swerv_logo.png +0 -0
  574. /package/{src/assets/images → lib/commonjs/assets/icons}/twitter.jpg +0 -0
package/README.md CHANGED
@@ -1,375 +1,424 @@
1
- # Onairos React Native SDK
2
-
3
- A React Native SDK for integrating Onairos authentication and AI model training into your mobile applications. This package provides a complete solution for social media platform connection, secure authentication, and AI model training.
4
-
5
- ## Features
6
-
7
- - Universal onboarding flow with multi-platform support
8
- - Multi-platform OAuth authentication (Instagram, Pinterest, Reddit, YouTube)
9
- - Secure credential management with biometric authentication
10
- - PIN-based security with validation
11
- - Deep linking support for OAuth callbacks
12
- - AI model training progress tracking
13
- - Customizable UI components
14
- - TypeScript support
15
-
16
- ## Installation
17
-
18
- ```bash
19
- npm install onairos-react-native
20
- # or
21
- yarn add onairos-react-native
22
- ```
23
-
24
- ### TypeScript Support
25
-
26
- The package includes full TypeScript declarations. Import types directly:
27
-
28
- ```typescript
29
- import { OnairosButton, OnairosCredentials, PlatformConfig } from 'onairos-react-native';
30
-
31
- // Type your component props
32
- const MyComponent: React.FC<{ credentials: OnairosCredentials }> = ({ credentials }) => {
33
- // Your component code
34
- };
35
-
36
- // Type your handlers
37
- const handleResolved = (apiUrl: string, accessToken: string, loginDetails: any) => {
38
- console.log('Authentication successful:', { apiUrl, accessToken, loginDetails });
39
- };
40
- ```
41
-
42
- ### Required Dependencies
43
-
44
- The package requires the following dependencies:
45
-
46
- ```bash
47
- # Core dependencies
48
- yarn add @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-safe-area-context
49
-
50
- # Authentication dependencies
51
- yarn add react-native-webview react-native-keychain
52
-
53
- # UI dependencies
54
- yarn add react-native-vector-icons
55
-
56
- # Network and encryption
57
- yarn add @react-native-community/netinfo react-native-rsa-native react-native-crypto-js
58
- ```
59
-
60
- ### iOS Setup
61
-
62
- 1. Install pods:
63
- ```bash
64
- cd ios && pod install
65
- ```
66
-
67
- 2. Add the following to your `Info.plist`:
68
- ```xml
69
- <key>CFBundleURLTypes</key>
70
- <array>
71
- <dict>
72
- <key>CFBundleURLSchemes</key>
73
- <array>
74
- <!-- <string>onairosreact</string> -->
75
- <string>onairosanime</string>
76
- </array>
77
- </dict>
78
- </array>
79
-
80
- <!-- Add for biometric authentication -->
81
- <key>NSFaceIDUsageDescription</key>
82
- <string>We use Face ID to securely access your Onairos account</string>
83
- ```
84
-
85
- 3. Configure your OAuth providers in the project settings and register the callback URLs.
86
-
87
- ### Android Setup
88
-
89
- 1. Add the following to your `android/app/src/main/AndroidManifest.xml`:
90
- ```xml
91
- <activity>
92
- <!-- ... -->
93
- <intent-filter>
94
- <action android:name="android.intent.action.VIEW" />
95
- <category android:name="android.intent.category.DEFAULT" />
96
- <category android:name="android.intent.category.BROWSABLE" />
97
- <!-- <data android:scheme="onairosreact" /> -->
98
- <data android:scheme="onairosanime" />
99
- </intent-filter>
100
- </activity>
101
- ```
102
-
103
- 2. Add biometric permissions:
104
- ```xml
105
- <uses-permission android:name="android.permission.USE_BIOMETRIC" />
106
- ```
107
-
108
- ## Usage
109
-
110
- 📖 **[Quick Integration Guide](./QUICK_INTEGRATION_GUIDE.md) - Start here for immediate copy-paste setup!**
111
-
112
- 📖 **For comprehensive usage examples in both JavaScript and TypeScript, see [USAGE_EXAMPLES.md](./USAGE_EXAMPLES.md)**
113
-
114
- ### Important: Setup Portal Host
115
-
116
- For modals and overlays to appear properly, you must wrap your app with the `PortalHost` component:
117
-
118
- ```javascript
119
- import { PortalHost } from 'onairos-react-native';
120
-
121
- export default function App() {
122
- return (
123
- <PortalHost>
124
- {/* Your app content goes here */}
125
- <MainNavigator />
126
- </PortalHost>
127
- );
128
- }
129
- ```
130
-
131
- ### Basic Button Integration
132
-
133
- 1. Import the OnairosButton component:
134
- ```javascript
135
- import { OnairosButton } from 'onairos-react-native';
136
- ```
137
-
138
- 2. Use the component in your app:
139
- ```javascript
140
- export default function App() {
141
- const handleResolved = (apiUrl, accessToken, loginDetails) => {
142
- console.log('Authentication successful:', { apiUrl, accessToken, loginDetails });
143
- // Store the tokens and proceed with your app logic
144
- };
145
-
146
- return (
147
- <View style={styles.container}>
148
- <OnairosButton
149
- AppName="YourApp"
150
- requestData={{
151
- "Social Media": {
152
- "Profile Information": "Access to your basic profile data",
153
- "Post History": "Access to your post history for analysis"
154
- },
155
- "Content": {
156
- "Images": "Access to image data for AI training",
157
- "Text": "Access to text data for AI training"
158
- }
159
- }}
160
- returnLink="your-app://auth-callback"
161
- onResolved={handleResolved}
162
- buttonType="pill"
163
- color="#00BFA5"
164
- />
165
- </View>
166
- );
167
- }
168
- ```
169
-
170
- ### Initialize OAuth Service
171
-
172
- Add this to your app's entry point to handle deep linking for OAuth:
173
-
174
- ```javascript
175
- import { initializeOAuthService } from 'onairos-react-native';
176
-
177
- // In your app's entry point
178
- useEffect(() => {
179
- // Set up OAuth deep linking
180
- initializeOAuthService();
181
-
182
- // Clean up when component unmounts
183
- return () => {
184
- cleanupOAuthService();
185
- };
186
- }, []);
187
- ```
188
-
189
- ### Working with Secure Storage
190
-
191
- ```javascript
192
- import { storeCredentials, getCredentials, hasCredentials } from 'onairos-react-native';
193
-
194
- // Check if user has stored credentials
195
- const checkAuth = async () => {
196
- const hasExisting = await hasCredentials();
197
-
198
- if (hasExisting) {
199
- // Get credentials with biometric authentication
200
- const credentials = await getCredentials({
201
- useBiometrics: true,
202
- biometricPrompt: {
203
- title: 'Authenticate to continue',
204
- subtitle: 'Please verify your identity'
205
- }
206
- });
207
-
208
- if (credentials) {
209
- // User is authenticated
210
- console.log('User authenticated:', credentials.username);
211
- }
212
- } else {
213
- // Redirect to onboarding flow
214
- setShowOnboarding(true);
215
- }
216
- };
217
- ```
218
-
219
- ## API Reference
220
-
221
- ### Main Components
222
-
223
- #### `OnairosButton`
224
-
225
- The main entry point for Onairos authentication.
226
-
227
- | Prop | Type | Required | Description |
228
- |------|------|----------|-------------|
229
- | AppName | string | Yes | Your application name |
230
- | requestData | object | Yes | Platform-specific OAuth scopes and data requests |
231
- | returnLink | string | Yes | Deep link URL for OAuth callback |
232
- | embedd | boolean | No | Whether to use embedded flow (default: false) |
233
- | color | string | No | Button color (default: #00BFA5) |
234
- | icon | string | No | Button icon name (default: 'auto_awesome') |
235
- | onResolved | function | Yes | Callback for successful auth with (apiUrl, accessToken, loginDetails) |
236
- | login | boolean | No | Enable login mode (default: false) |
237
- | buttonType | 'circle' \| 'pill' | No | Button style (default: 'circle') |
238
- | debug | boolean | No | Enable debug mode (default: false) |
239
- | test | boolean | No | Enable test mode (default: false) |
240
-
241
- #### `UniversalOnboarding`
242
-
243
- The universal onboarding flow component.
244
-
245
- | Prop | Type | Required | Description |
246
- |------|------|----------|-------------|
247
- | visible | boolean | Yes | Whether the onboarding is visible |
248
- | onClose | function | Yes | Callback when onboarding is closed |
249
- | AppName | string | Yes | Your application name |
250
- | requestData | object | Yes | Platform-specific OAuth scopes |
251
- | returnLink | string | Yes | Deep link URL for OAuth callback |
252
- | onComplete | function | Yes | Callback when onboarding is complete |
253
- | embedd | boolean | No | Whether to use embedded flow |
254
- | debug | boolean | No | Enable debug mode |
255
- | test | boolean | No | Enable test mode |
256
-
257
- #### `Overlay`
258
-
259
- Data request overlay component.
260
-
261
- | Prop | Type | Required | Description |
262
- |------|------|----------|-------------|
263
- | visible | boolean | Yes | Whether the overlay is visible |
264
- | onClose | function | Yes | Callback when overlay is closed |
265
- | onAccept | function | Yes | Callback when request is accepted |
266
- | AppName | string | Yes | Your application name |
267
- | requestData | object | Yes | Data being requested |
268
- | biometricType | 'FaceID' \| 'TouchID' \| 'BiometricID' | No | Type of biometric auth to use |
269
-
270
- ### Utility Functions
271
-
272
- #### Secure Storage
273
-
274
- - `storeCredentials(credentials, options)`: Store credentials securely
275
- - `getCredentials(options)`: Retrieve credentials with optional biometric auth
276
- - `hasCredentials()`: Check if user has stored credentials
277
- - `deleteCredentials()`: Delete stored credentials
278
- - `updateCredentials(updates, options)`: Update specific fields in credentials
279
- - `generateDeviceUsername()`: Generate a device-specific unique username
280
- - `verifyCredentials(credentials)`: Verify if credentials are valid
281
-
282
- #### OAuth Service
283
-
284
- - `connectPlatform(platform)`: Initiate OAuth flow for a specific platform
285
- - `disconnectPlatform(platform, credentials)`: Disconnect a platform
286
- - `initializeOAuthService()`: Initialize OAuth service handlers
287
- - `cleanupOAuthService()`: Clean up OAuth service handlers
288
- - `storePlatformConnection(platform, connectionData, credentials)`: Store platform connection
289
-
290
- #### API Communication
291
-
292
- - `validateCredentials(username, options)`: Validate user credentials with the API
293
- - `createAccount(credentials, options)`: Create a new user account
294
- - `authenticate(credentials, options)`: Authenticate with the API using credentials
295
- - `refreshToken(refreshToken, options)`: Refresh authentication token
296
- - `getPlatformData(accessToken, platform, options)`: Get user's connected platform data
297
- - `getUserProfile(accessToken, options)`: Get user profile information
298
- - `updatePlatformConnections(accessToken, platforms, options)`: Update user platform connections
299
-
300
- ## Development and Testing
301
-
302
- ### Setup Development Environment
303
-
304
- 1. Clone the repository:
305
- ```bash
306
- git clone https://github.com/onairos/onairos-react-native.git
307
- cd onairos-react-native
308
- ```
309
-
310
- 2. Install dependencies:
311
- ```bash
312
- yarn install
313
- ```
314
-
315
- 3. Run the typecheck:
316
- ```bash
317
- yarn typecheck
318
- ```
319
-
320
- ### Building the Package
321
-
322
- ```bash
323
- npm run build:all
324
- ```
325
-
326
- ### Testing with a Local App
327
-
328
- 1. Link the package locally:
329
- ```bash
330
- # In your package directory
331
- yarn link
332
-
333
- # In your app directory
334
- yarn link onairos-react-native
335
- ```
336
-
337
- 2. Run your app and test the integration.
338
-
339
- ## Troubleshooting
340
-
341
- ### OAuth Callback Issues
342
-
343
- - Ensure your deep link schemes are properly configured in both iOS and Android
344
- - Check that the callback URLs match what's registered with your OAuth providers
345
- - Ensure all required permissions are enabled in your app configurations
346
-
347
- ### Biometric Authentication Issues
348
-
349
- - Ensure proper permissions are set in Info.plist and AndroidManifest.xml
350
- - Test on physical devices as simulators may not support all biometric features
351
- - For iOS, ensure that Face ID/Touch ID is enabled and set up on the device
352
-
353
- ### Platform Specific Issues
354
-
355
- #### iOS
356
-
357
- - For keychain issues, check that the Keychain Sharing capability is enabled
358
- - Ensure the bundle identifier is consistent with your OAuth configuration
359
-
360
- #### Android
361
-
362
- - For deep linking issues, check the androidManifest.xml configuration
363
- - Ensure that biometric hardware is available on test devices
364
-
365
- ## Contributing
366
-
367
- 1. Fork the repository
368
- 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
369
- 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
370
- 4. Push to the branch (`git push origin feature/amazing-feature`)
371
- 5. Open a Pull Request
372
-
373
- ## License
374
-
1
+ # Onairos React Native SDK
2
+
3
+ A React Native SDK for integrating Onairos authentication and AI model training into your mobile applications. This package provides a complete solution for social media platform connection, secure authentication, and AI model training.
4
+
5
+ ## Features
6
+
7
+ - Universal onboarding flow with multi-platform support
8
+ - Multi-platform OAuth authentication (Pinterest, YouTube, LinkedIn, Gmail, Reddit)
9
+ - Real-time AI model training with Socket.io integration
10
+ - Secure credential management with biometric authentication
11
+ - PIN-based security with validation and encryption
12
+ - Deep linking support for OAuth callbacks
13
+ - Email verification and account management
14
+ - Existing user detection and data confirmation
15
+ - Background training optimization
16
+ - Comprehensive error handling and retry logic
17
+ - Haptic feedback integration
18
+ - Customizable UI components
19
+ - Full TypeScript support
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ npm install @onairos/react-native
25
+ # or
26
+ yarn add @onairos/react-native
27
+ ```
28
+
29
+ ## 🎯 Example App
30
+
31
+ A complete example app is available in the `example/` directory demonstrating real-world SDK integration:
32
+
33
+ ```bash
34
+ cd example
35
+ npm install
36
+ npm run ios # or npm run android
37
+ ```
38
+
39
+ The example app showcases:
40
+ - ✅ SDK initialization and configuration
41
+ - ✅ OnairosButton component integration
42
+ - WelcomeScreen component usage
43
+ - ✅ Custom styling options
44
+ - JWT token handling and user data extraction
45
+ - ✅ Error handling and debugging
46
+
47
+ See [`example/README.md`](./example/README.md) for detailed setup instructions.
48
+
49
+ ### TypeScript Support
50
+
51
+ The package includes full TypeScript declarations. Import types directly:
52
+
53
+ ```typescript
54
+ import { OnairosButton, OnairosCredentials, PlatformConfig } from '@onairos/react-native';
55
+
56
+ // Type your component props
57
+ const MyComponent: React.FC<{ credentials: OnairosCredentials }> = ({ credentials }) => {
58
+ // Your component code
59
+ };
60
+
61
+ // Type your handlers
62
+ const handleResolved = (apiUrl: string, accessToken: string, loginDetails: any) => {
63
+ console.log('Authentication successful:', { apiUrl, accessToken, loginDetails });
64
+ };
65
+ ```
66
+
67
+ ### Required Dependencies
68
+
69
+ The package requires the following dependencies:
70
+
71
+ ```bash
72
+ # Core dependencies
73
+ yarn add @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-safe-area-context
74
+
75
+ # Authentication dependencies
76
+ yarn add react-native-webview react-native-keychain
77
+
78
+ # UI dependencies
79
+ yarn add react-native-vector-icons
80
+
81
+ # Network and encryption
82
+ yarn add @react-native-community/netinfo react-native-rsa-native react-native-crypto-js
83
+ ```
84
+
85
+ ### iOS Setup
86
+
87
+ 1. Install pods:
88
+ ```bash
89
+ cd ios && pod install
90
+ ```
91
+
92
+ 2. Add the following to your `Info.plist`:
93
+ ```xml
94
+ <key>CFBundleURLTypes</key>
95
+ <array>
96
+ <dict>
97
+ <key>CFBundleURLSchemes</key>
98
+ <array>
99
+ <!-- <string>onairosreact</string> -->
100
+ <string>onairosanime</string>
101
+ </array>
102
+ </dict>
103
+ </array>
104
+
105
+ <!-- Add for biometric authentication -->
106
+ <key>NSFaceIDUsageDescription</key>
107
+ <string>We use Face ID to securely access your Onairos account</string>
108
+ ```
109
+
110
+ 3. Configure your OAuth providers in the project settings and register the callback URLs.
111
+
112
+ ### Android Setup
113
+
114
+ 1. Add the following to your `android/app/src/main/AndroidManifest.xml`:
115
+ ```xml
116
+ <activity>
117
+ <!-- ... -->
118
+ <intent-filter>
119
+ <action android:name="android.intent.action.VIEW" />
120
+ <category android:name="android.intent.category.DEFAULT" />
121
+ <category android:name="android.intent.category.BROWSABLE" />
122
+ <!-- <data android:scheme="onairosreact" /> -->
123
+ <data android:scheme="onairosanime" />
124
+ </intent-filter>
125
+ </activity>
126
+ ```
127
+
128
+ 2. Add biometric permissions:
129
+ ```xml
130
+ <uses-permission android:name="android.permission.USE_BIOMETRIC" />
131
+ ```
132
+
133
+ ## Usage
134
+
135
+ 📖 **[Quick Integration Guide](./QUICK_INTEGRATION_GUIDE.md) - Start here for immediate copy-paste setup!**
136
+
137
+ 📖 **For comprehensive usage examples in both JavaScript and TypeScript, see [USAGE_EXAMPLES.md](./USAGE_EXAMPLES.md)**
138
+
139
+ ### Important: Setup Portal Host
140
+
141
+ For modals and overlays to appear properly, you must wrap your app with the `PortalHost` component:
142
+
143
+ ```javascript
144
+ import { PortalHost } from '@onairos/react-native';
145
+
146
+ export default function App() {
147
+ return (
148
+ <PortalHost>
149
+ {/* Your app content goes here */}
150
+ <MainNavigator />
151
+ </PortalHost>
152
+ );
153
+ }
154
+ ```
155
+
156
+ ### Basic Button Integration
157
+
158
+ 1. Import the OnairosButton component:
159
+ ```javascript
160
+ import { OnairosButton } from '@onairos/react-native';
161
+ ```
162
+
163
+ 2. Use the component in your app:
164
+ ```javascript
165
+ export default function App() {
166
+ const handleResolved = (apiUrl, accessToken, loginDetails) => {
167
+ console.log('Authentication successful:', { apiUrl, accessToken, loginDetails });
168
+ // Store the tokens and proceed with your app logic
169
+ };
170
+
171
+ return (
172
+ <View style={styles.container}>
173
+ <OnairosButton
174
+ AppName="YourApp"
175
+ requestData={{
176
+ "Social Media": {
177
+ "Profile Information": "Access to your basic profile data",
178
+ "Post History": "Access to your post history for analysis"
179
+ },
180
+ "Content": {
181
+ "Images": "Access to image data for AI training",
182
+ "Text": "Access to text data for AI training"
183
+ }
184
+ }}
185
+ returnLink="your-app://auth-callback"
186
+ onResolved={handleResolved}
187
+ buttonType="pill"
188
+ color="#00BFA5"
189
+ />
190
+ </View>
191
+ );
192
+ }
193
+ ```
194
+
195
+ ### Initialize OAuth Service
196
+
197
+ Add this to your app's entry point to handle deep linking for OAuth:
198
+
199
+ ```javascript
200
+ import { initializeOAuthService } from '@onairos/react-native';
201
+
202
+ // In your app's entry point
203
+ useEffect(() => {
204
+ // Set up OAuth deep linking
205
+ initializeOAuthService();
206
+
207
+ // Clean up when component unmounts
208
+ return () => {
209
+ cleanupOAuthService();
210
+ };
211
+ }, []);
212
+ ```
213
+
214
+ ### Working with Secure Storage
215
+
216
+ ```javascript
217
+ import { storeCredentials, getCredentials, hasCredentials } from '@onairos/react-native';
218
+
219
+ // Check if user has stored credentials
220
+ const checkAuth = async () => {
221
+ const hasExisting = await hasCredentials();
222
+
223
+ if (hasExisting) {
224
+ // Get credentials with biometric authentication
225
+ const credentials = await getCredentials({
226
+ useBiometrics: true,
227
+ biometricPrompt: {
228
+ title: 'Authenticate to continue',
229
+ subtitle: 'Please verify your identity'
230
+ }
231
+ });
232
+
233
+ if (credentials) {
234
+ // User is authenticated
235
+ console.log('User authenticated:', credentials.username);
236
+ }
237
+ } else {
238
+ // Redirect to onboarding flow
239
+ setShowOnboarding(true);
240
+ }
241
+ };
242
+ ```
243
+
244
+ ## API Reference
245
+
246
+ ### Main Components
247
+
248
+ #### `OnairosButton`
249
+
250
+ The main entry point for Onairos authentication with full training flow support.
251
+
252
+ | Prop | Type | Required | Description |
253
+ |------|------|----------|-------------|
254
+ | AppName | string | Yes | Your application name |
255
+ | requestData | object | Yes | Platform-specific OAuth scopes and data requests |
256
+ | returnLink | string | Yes | Deep link URL for OAuth callback |
257
+ | embedd | boolean | No | Whether to use embedded flow (default: false) |
258
+ | color | string | No | Button color (default: #00BFA5) |
259
+ | icon | string | No | Button icon name (default: 'auto_awesome') |
260
+ | onResolved | function | Yes | Callback for successful auth with (apiUrl, accessToken, loginDetails) |
261
+ | login | boolean | No | Enable login mode (default: false) |
262
+ | buttonType | 'circle' \| 'pill' | No | Button style (default: 'circle') |
263
+ | debug | boolean | No | Enable debug mode (default: false) |
264
+ | test | boolean | No | Enable test mode (default: false) |
265
+
266
+ #### `UniversalOnboarding`
267
+
268
+ The universal onboarding flow component.
269
+
270
+ | Prop | Type | Required | Description |
271
+ |------|------|----------|-------------|
272
+ | visible | boolean | Yes | Whether the onboarding is visible |
273
+ | onClose | function | Yes | Callback when onboarding is closed |
274
+ | AppName | string | Yes | Your application name |
275
+ | requestData | object | Yes | Platform-specific OAuth scopes |
276
+ | returnLink | string | Yes | Deep link URL for OAuth callback |
277
+ | onComplete | function | Yes | Callback when onboarding is complete |
278
+ | embedd | boolean | No | Whether to use embedded flow |
279
+ | debug | boolean | No | Enable debug mode |
280
+ | test | boolean | No | Enable test mode |
281
+
282
+ #### `TrainingModal`
283
+
284
+ Email authentication and training progress modal.
285
+
286
+ | Prop | Type | Required | Description |
287
+ |------|------|----------|-------------|
288
+ | visible | boolean | Yes | Whether the modal is visible |
289
+ | onCancel | function | Yes | Callback when modal is cancelled |
290
+ | onComplete | function | Yes | Callback when training is complete |
291
+ | modelKey | string | No | Model key for training |
292
+ | username | string | No | Username for training |
293
+ | isPrimaryAuth | boolean | No | Whether this is primary authentication |
294
+ | autoFocusEmailInput | boolean | No | Auto-focus email input on show |
295
+
296
+ #### `WelcomeScreen`
297
+
298
+ New welcome flow component with modern UI.
299
+
300
+ | Prop | Type | Required | Description |
301
+ |------|------|----------|-------------|
302
+ | visible | boolean | Yes | Whether the screen is visible |
303
+ | onClose | function | Yes | Callback when screen is closed |
304
+ | onComplete | function | Yes | Callback when flow is complete |
305
+
306
+ #### `Overlay`
307
+
308
+ Data request overlay component.
309
+
310
+ | Prop | Type | Required | Description |
311
+ |------|------|----------|-------------|
312
+ | visible | boolean | Yes | Whether the overlay is visible |
313
+ | onClose | function | Yes | Callback when overlay is closed |
314
+ | onAccept | function | Yes | Callback when request is accepted |
315
+ | AppName | string | Yes | Your application name |
316
+ | requestData | object | Yes | Data being requested |
317
+ | biometricType | 'FaceID' \| 'TouchID' \| 'BiometricID' | No | Type of biometric auth to use |
318
+
319
+ ### Utility Functions
320
+
321
+ #### Secure Storage
322
+
323
+ - `storeCredentials(credentials, options)`: Store credentials securely
324
+ - `getCredentials(options)`: Retrieve credentials with optional biometric auth
325
+ - `hasCredentials()`: Check if user has stored credentials
326
+ - `deleteCredentials()`: Delete stored credentials
327
+ - `updateCredentials(updates, options)`: Update specific fields in credentials
328
+ - `generateDeviceUsername()`: Generate a device-specific unique username
329
+ - `verifyCredentials(credentials)`: Verify if credentials are valid
330
+
331
+ #### OAuth Service
332
+
333
+ - `connectPlatform(platform)`: Initiate OAuth flow for a specific platform
334
+ - `disconnectPlatform(platform, credentials)`: Disconnect a platform
335
+ - `initializeOAuthService()`: Initialize OAuth service handlers
336
+ - `cleanupOAuthService()`: Clean up OAuth service handlers
337
+ - `storePlatformConnection(platform, connectionData, credentials)`: Store platform connection
338
+
339
+ #### API Communication
340
+
341
+ - `validateCredentials(username, options)`: Validate user credentials with the API
342
+ - `createAccount(credentials, options)`: Create a new user account
343
+ - `authenticate(credentials, options)`: Authenticate with the API using credentials
344
+ - `refreshToken(refreshToken, options)`: Refresh authentication token
345
+ - `getPlatformData(accessToken, platform, options)`: Get user's connected platform data
346
+ - `getUserProfile(accessToken, options)`: Get user profile information
347
+ - `updatePlatformConnections(accessToken, platforms, options)`: Update user platform connections
348
+
349
+ ## Development and Testing
350
+
351
+ ### Setup Development Environment
352
+
353
+ 1. Clone the repository:
354
+ ```bash
355
+ git clone https://github.com/onairos/onairos-react-native.git
356
+ cd onairos-react-native
357
+ ```
358
+
359
+ 2. Install dependencies:
360
+ ```bash
361
+ yarn install
362
+ ```
363
+
364
+ 3. Run the typecheck:
365
+ ```bash
366
+ yarn typecheck
367
+ ```
368
+
369
+ ### Building the Package
370
+
371
+ ```bash
372
+ npm run build:all
373
+ ```
374
+
375
+ ### Testing with a Local App
376
+
377
+ 1. Link the package locally:
378
+ ```bash
379
+ # In your package directory
380
+ yarn link
381
+
382
+ # In your app directory
383
+ yarn link @onairos/react-native
384
+ ```
385
+
386
+ 2. Run your app and test the integration.
387
+
388
+ ## Troubleshooting
389
+
390
+ ### OAuth Callback Issues
391
+
392
+ - Ensure your deep link schemes are properly configured in both iOS and Android
393
+ - Check that the callback URLs match what's registered with your OAuth providers
394
+ - Ensure all required permissions are enabled in your app configurations
395
+
396
+ ### Biometric Authentication Issues
397
+
398
+ - Ensure proper permissions are set in Info.plist and AndroidManifest.xml
399
+ - Test on physical devices as simulators may not support all biometric features
400
+ - For iOS, ensure that Face ID/Touch ID is enabled and set up on the device
401
+
402
+ ### Platform Specific Issues
403
+
404
+ #### iOS
405
+
406
+ - For keychain issues, check that the Keychain Sharing capability is enabled
407
+ - Ensure the bundle identifier is consistent with your OAuth configuration
408
+
409
+ #### Android
410
+
411
+ - For deep linking issues, check the androidManifest.xml configuration
412
+ - Ensure that biometric hardware is available on test devices
413
+
414
+ ## Contributing
415
+
416
+ 1. Fork the repository
417
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
418
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
419
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
420
+ 5. Open a Pull Request
421
+
422
+ ## License
423
+
375
424
  MIT