@onairos/react-native 3.1.14 → 3.1.16

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 (307) hide show
  1. package/lib/commonjs/api/index.js.map +1 -1
  2. package/lib/commonjs/components/BodyText.js.map +1 -1
  3. package/lib/commonjs/components/BrandMark.js.map +1 -1
  4. package/lib/commonjs/components/CodeInput.js.map +1 -1
  5. package/lib/commonjs/components/DataRequestModal.js.map +1 -1
  6. package/lib/commonjs/components/DataRequestScreen.js.map +1 -1
  7. package/lib/commonjs/components/EmailInput.js.map +1 -1
  8. package/lib/commonjs/components/EmailVerificationModal.js.map +1 -1
  9. package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +1 -1
  10. package/lib/commonjs/components/GoogleButton.js.map +1 -1
  11. package/lib/commonjs/components/HeadingGroup.js.map +1 -1
  12. package/lib/commonjs/components/ModalHeader.js.map +1 -1
  13. package/lib/commonjs/components/ModalSheet.js.map +1 -1
  14. package/lib/commonjs/components/Onairos.js.map +1 -1
  15. package/lib/commonjs/components/OnairosSignInButton.js +19 -83
  16. package/lib/commonjs/components/OnairosSignInButton.js.map +1 -1
  17. package/lib/commonjs/components/Overlay.js.map +1 -1
  18. package/lib/commonjs/components/PersonaImage.js.map +1 -1
  19. package/lib/commonjs/components/PersonaLoadingScreen.js.map +1 -1
  20. package/lib/commonjs/components/PersonalizationConsentScreen.js.map +1 -1
  21. package/lib/commonjs/components/PinCreationScreen.js.map +1 -1
  22. package/lib/commonjs/components/PinInput.js.map +1 -1
  23. package/lib/commonjs/components/PlatformConnectorsStep.js.map +1 -1
  24. package/lib/commonjs/components/PlatformList.js.map +1 -1
  25. package/lib/commonjs/components/PlatformToggle.js.map +1 -1
  26. package/lib/commonjs/components/PrimaryButton.js.map +1 -1
  27. package/lib/commonjs/components/SignInMatchAnimation.js.map +1 -1
  28. package/lib/commonjs/components/SignInStep.js.map +1 -1
  29. package/lib/commonjs/components/TrainingModal.js.map +1 -1
  30. package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
  31. package/lib/commonjs/components/VerificationStep.js.map +1 -1
  32. package/lib/commonjs/components/WelcomeScreen.js.map +1 -1
  33. package/lib/commonjs/components/icons/Basicproficon.js.map +1 -1
  34. package/lib/commonjs/components/icons/Basicprofile.js.map +1 -1
  35. package/lib/commonjs/components/icons/Checkbox.js.map +1 -1
  36. package/lib/commonjs/components/icons/Checkmark.js.map +1 -1
  37. package/lib/commonjs/components/icons/Contentanalysis.js.map +1 -1
  38. package/lib/commonjs/components/icons/Contenticon.js.map +1 -1
  39. package/lib/commonjs/components/icons/EnochE.js.map +1 -1
  40. package/lib/commonjs/components/icons/Personalityicon.js.map +1 -1
  41. package/lib/commonjs/components/icons/Personalityprofile.js.map +1 -1
  42. package/lib/commonjs/components/icons/Personalitytraits.js.map +1 -1
  43. package/lib/commonjs/components/icons/Userpreferences.js.map +1 -1
  44. package/lib/commonjs/components/icons/index.js.map +1 -1
  45. package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
  46. package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +1 -1
  47. package/lib/commonjs/components/onboarding/PinInput.js.map +1 -1
  48. package/lib/commonjs/components/onboarding/PlatformConnector.js.map +1 -1
  49. package/lib/commonjs/components/screens/ConnectorScreen.js.map +1 -1
  50. package/lib/commonjs/components/screens/LoadingScreen.js.map +1 -1
  51. package/lib/commonjs/components/screens/PinCreationScreen.js.map +1 -1
  52. package/lib/commonjs/config/api.js.map +1 -1
  53. package/lib/commonjs/constants/index.js.map +1 -1
  54. package/lib/commonjs/context/AuthContext.js.map +1 -1
  55. package/lib/commonjs/hooks/useConnectedAccounts.js.map +1 -1
  56. package/lib/commonjs/hooks/useConnections.js.map +1 -1
  57. package/lib/commonjs/hooks/useCredentials.js.map +1 -1
  58. package/lib/commonjs/hooks/useUserConnections.js.map +1 -1
  59. package/lib/commonjs/index.js +222 -11
  60. package/lib/commonjs/index.js.map +1 -1
  61. package/lib/commonjs/services/apiClient.js.map +1 -1
  62. package/lib/commonjs/services/apiKeyService.js.map +1 -1
  63. package/lib/commonjs/services/authService.js.map +1 -1
  64. package/lib/commonjs/services/biometricPinService.js.map +1 -1
  65. package/lib/commonjs/services/connectedAccountsService.js.map +1 -1
  66. package/lib/commonjs/services/googleAuthService.js.map +1 -1
  67. package/lib/commonjs/services/imageCompressionService.js.map +1 -1
  68. package/lib/commonjs/services/jwtStorageService.js.map +1 -1
  69. package/lib/commonjs/services/mobileTrainingService.js.map +1 -1
  70. package/lib/commonjs/services/oauthService.js.map +1 -1
  71. package/lib/commonjs/services/pinEncryptionService.js.map +1 -1
  72. package/lib/commonjs/services/pinStorageUtils.js.map +1 -1
  73. package/lib/commonjs/services/platformAuthService.js.map +1 -1
  74. package/lib/commonjs/services/storageService.js.map +1 -1
  75. package/lib/commonjs/services/trainingApiHelpers.js.map +1 -1
  76. package/lib/commonjs/services/userConnectionsService.js.map +1 -1
  77. package/lib/commonjs/services/youtubeMigrationService.js.map +1 -1
  78. package/lib/commonjs/theme/index.js.map +1 -1
  79. package/lib/commonjs/types/ambient.d.js.map +1 -1
  80. package/lib/commonjs/types/declarations.d.js.map +1 -1
  81. package/lib/commonjs/types/index.d.js.map +1 -1
  82. package/lib/commonjs/types/index.js.map +1 -1
  83. package/lib/commonjs/types/node-fix.d.js.map +1 -1
  84. package/lib/commonjs/types/node-override.d.js.map +1 -1
  85. package/lib/commonjs/types/opacity.d.js.map +1 -1
  86. package/lib/commonjs/types/types.d.js.map +1 -1
  87. package/lib/commonjs/types.js.map +1 -1
  88. package/lib/commonjs/utils/Portal.js.map +1 -1
  89. package/lib/commonjs/utils/api.js.map +1 -1
  90. package/lib/commonjs/utils/auth.js.map +1 -1
  91. package/lib/commonjs/utils/crypto.js.map +1 -1
  92. package/lib/commonjs/utils/debugHelper.js.map +1 -1
  93. package/lib/commonjs/utils/encryption.js.map +1 -1
  94. package/lib/commonjs/utils/eventUtils.js.map +1 -1
  95. package/lib/commonjs/utils/haptics.js.map +1 -1
  96. package/lib/commonjs/utils/imagePreloader.js.map +1 -1
  97. package/lib/commonjs/utils/onairosApi.js.map +1 -1
  98. package/lib/commonjs/utils/programmaticFlow.js.map +1 -1
  99. package/lib/commonjs/utils/retryHelper.js.map +1 -1
  100. package/lib/commonjs/utils/secureStorage.js.map +1 -1
  101. package/lib/module/api/index.js.map +1 -1
  102. package/lib/module/components/BodyText.js.map +1 -1
  103. package/lib/module/components/BrandMark.js.map +1 -1
  104. package/lib/module/components/CodeInput.js.map +1 -1
  105. package/lib/module/components/DataRequestModal.js.map +1 -1
  106. package/lib/module/components/DataRequestScreen.js.map +1 -1
  107. package/lib/module/components/EmailInput.js.map +1 -1
  108. package/lib/module/components/EmailVerificationModal.js.map +1 -1
  109. package/lib/module/components/ExistingUserDataConfirmation.js.map +1 -1
  110. package/lib/module/components/GoogleButton.js.map +1 -1
  111. package/lib/module/components/HeadingGroup.js.map +1 -1
  112. package/lib/module/components/ModalHeader.js.map +1 -1
  113. package/lib/module/components/ModalSheet.js.map +1 -1
  114. package/lib/module/components/Onairos.js.map +1 -1
  115. package/lib/module/components/OnairosSignInButton.js +19 -83
  116. package/lib/module/components/OnairosSignInButton.js.map +1 -1
  117. package/lib/module/components/Overlay.js.map +1 -1
  118. package/lib/module/components/PersonaImage.js.map +1 -1
  119. package/lib/module/components/PersonaLoadingScreen.js.map +1 -1
  120. package/lib/module/components/PersonalizationConsentScreen.js.map +1 -1
  121. package/lib/module/components/PinCreationScreen.js.map +1 -1
  122. package/lib/module/components/PinInput.js.map +1 -1
  123. package/lib/module/components/PlatformConnectorsStep.js.map +1 -1
  124. package/lib/module/components/PlatformList.js.map +1 -1
  125. package/lib/module/components/PlatformToggle.js.map +1 -1
  126. package/lib/module/components/PrimaryButton.js.map +1 -1
  127. package/lib/module/components/SignInMatchAnimation.js.map +1 -1
  128. package/lib/module/components/SignInStep.js.map +1 -1
  129. package/lib/module/components/TrainingModal.js.map +1 -1
  130. package/lib/module/components/UniversalOnboarding.js.map +1 -1
  131. package/lib/module/components/VerificationStep.js.map +1 -1
  132. package/lib/module/components/WelcomeScreen.js.map +1 -1
  133. package/lib/module/components/icons/Basicproficon.js.map +1 -1
  134. package/lib/module/components/icons/Basicprofile.js.map +1 -1
  135. package/lib/module/components/icons/Checkbox.js.map +1 -1
  136. package/lib/module/components/icons/Checkmark.js.map +1 -1
  137. package/lib/module/components/icons/Contentanalysis.js.map +1 -1
  138. package/lib/module/components/icons/Contenticon.js.map +1 -1
  139. package/lib/module/components/icons/EnochE.js.map +1 -1
  140. package/lib/module/components/icons/Personalityicon.js.map +1 -1
  141. package/lib/module/components/icons/Personalityprofile.js.map +1 -1
  142. package/lib/module/components/icons/Personalitytraits.js.map +1 -1
  143. package/lib/module/components/icons/Userpreferences.js.map +1 -1
  144. package/lib/module/components/icons/index.js.map +1 -1
  145. package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
  146. package/lib/module/components/onboarding/OnboardingHeader.js.map +1 -1
  147. package/lib/module/components/onboarding/PinInput.js.map +1 -1
  148. package/lib/module/components/onboarding/PlatformConnector.js.map +1 -1
  149. package/lib/module/components/screens/ConnectorScreen.js.map +1 -1
  150. package/lib/module/components/screens/LoadingScreen.js.map +1 -1
  151. package/lib/module/components/screens/PinCreationScreen.js.map +1 -1
  152. package/lib/module/config/api.js.map +1 -1
  153. package/lib/module/constants/index.js.map +1 -1
  154. package/lib/module/context/AuthContext.js.map +1 -1
  155. package/lib/module/hooks/useConnectedAccounts.js.map +1 -1
  156. package/lib/module/hooks/useConnections.js.map +1 -1
  157. package/lib/module/hooks/useCredentials.js.map +1 -1
  158. package/lib/module/hooks/useUserConnections.js.map +1 -1
  159. package/lib/module/index.js +5 -3
  160. package/lib/module/index.js.map +1 -1
  161. package/lib/module/services/apiClient.js.map +1 -1
  162. package/lib/module/services/apiKeyService.js.map +1 -1
  163. package/lib/module/services/authService.js.map +1 -1
  164. package/lib/module/services/biometricPinService.js.map +1 -1
  165. package/lib/module/services/connectedAccountsService.js.map +1 -1
  166. package/lib/module/services/googleAuthService.js.map +1 -1
  167. package/lib/module/services/imageCompressionService.js.map +1 -1
  168. package/lib/module/services/jwtStorageService.js.map +1 -1
  169. package/lib/module/services/mobileTrainingService.js.map +1 -1
  170. package/lib/module/services/oauthService.js.map +1 -1
  171. package/lib/module/services/pinEncryptionService.js.map +1 -1
  172. package/lib/module/services/pinStorageUtils.js.map +1 -1
  173. package/lib/module/services/platformAuthService.js.map +1 -1
  174. package/lib/module/services/storageService.js.map +1 -1
  175. package/lib/module/services/trainingApiHelpers.js.map +1 -1
  176. package/lib/module/services/userConnectionsService.js.map +1 -1
  177. package/lib/module/services/youtubeMigrationService.js.map +1 -1
  178. package/lib/module/theme/index.js.map +1 -1
  179. package/lib/module/types/ambient.d.js.map +1 -1
  180. package/lib/module/types/declarations.d.js.map +1 -1
  181. package/lib/module/types/index.d.js.map +1 -1
  182. package/lib/module/types/index.js.map +1 -1
  183. package/lib/module/types/node-fix.d.js.map +1 -1
  184. package/lib/module/types/node-override.d.js.map +1 -1
  185. package/lib/module/types/opacity.d.js.map +1 -1
  186. package/lib/module/types/types.d.js.map +1 -1
  187. package/lib/module/types.js.map +1 -1
  188. package/lib/module/utils/Portal.js.map +1 -1
  189. package/lib/module/utils/api.js.map +1 -1
  190. package/lib/module/utils/auth.js.map +1 -1
  191. package/lib/module/utils/crypto.js.map +1 -1
  192. package/lib/module/utils/debugHelper.js.map +1 -1
  193. package/lib/module/utils/encryption.js.map +1 -1
  194. package/lib/module/utils/eventUtils.js.map +1 -1
  195. package/lib/module/utils/haptics.js.map +1 -1
  196. package/lib/module/utils/imagePreloader.js.map +1 -1
  197. package/lib/module/utils/onairosApi.js.map +1 -1
  198. package/lib/module/utils/programmaticFlow.js.map +1 -1
  199. package/lib/module/utils/retryHelper.js.map +1 -1
  200. package/lib/module/utils/secureStorage.js.map +1 -1
  201. package/lib/typescript/api/index.d.ts +15 -15
  202. package/lib/typescript/components/BodyText.d.ts +9 -9
  203. package/lib/typescript/components/BrandMark.d.ts +10 -10
  204. package/lib/typescript/components/CodeInput.d.ts +9 -9
  205. package/lib/typescript/components/DataRequestModal.d.ts +10 -10
  206. package/lib/typescript/components/DataRequestScreen.d.ts +10 -10
  207. package/lib/typescript/components/EmailInput.d.ts +7 -7
  208. package/lib/typescript/components/EmailVerificationModal.d.ts +10 -10
  209. package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +11 -11
  210. package/lib/typescript/components/GoogleButton.d.ts +10 -10
  211. package/lib/typescript/components/HeadingGroup.d.ts +10 -10
  212. package/lib/typescript/components/ModalHeader.d.ts +10 -10
  213. package/lib/typescript/components/ModalSheet.d.ts +12 -12
  214. package/lib/typescript/components/Onairos.d.ts +3 -3
  215. package/lib/typescript/components/OnairosSignInButton.d.ts +12 -13
  216. package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -1
  217. package/lib/typescript/components/Overlay.d.ts +3 -3
  218. package/lib/typescript/components/PersonaImage.d.ts +7 -7
  219. package/lib/typescript/components/PersonaLoadingScreen.d.ts +9 -9
  220. package/lib/typescript/components/PersonalizationConsentScreen.d.ts +9 -9
  221. package/lib/typescript/components/PinCreationScreen.d.ts +9 -9
  222. package/lib/typescript/components/PinInput.d.ts +13 -13
  223. package/lib/typescript/components/PlatformConnectorsStep.d.ts +10 -10
  224. package/lib/typescript/components/PlatformList.d.ts +3 -3
  225. package/lib/typescript/components/PlatformToggle.d.ts +19 -19
  226. package/lib/typescript/components/PrimaryButton.d.ts +21 -21
  227. package/lib/typescript/components/SignInMatchAnimation.d.ts +8 -8
  228. package/lib/typescript/components/SignInStep.d.ts +11 -11
  229. package/lib/typescript/components/TrainingModal.d.ts +14 -14
  230. package/lib/typescript/components/UniversalOnboarding.d.ts +16 -16
  231. package/lib/typescript/components/VerificationStep.d.ts +12 -12
  232. package/lib/typescript/components/WelcomeScreen.d.ts +8 -8
  233. package/lib/typescript/components/icons/Basicproficon.d.ts +4 -4
  234. package/lib/typescript/components/icons/Basicprofile.d.ts +4 -4
  235. package/lib/typescript/components/icons/Checkbox.d.ts +4 -4
  236. package/lib/typescript/components/icons/Checkmark.d.ts +4 -4
  237. package/lib/typescript/components/icons/Contentanalysis.d.ts +4 -4
  238. package/lib/typescript/components/icons/Contenticon.d.ts +4 -4
  239. package/lib/typescript/components/icons/EnochE.d.ts +4 -4
  240. package/lib/typescript/components/icons/Personalityicon.d.ts +4 -4
  241. package/lib/typescript/components/icons/Personalityprofile.d.ts +4 -4
  242. package/lib/typescript/components/icons/Personalitytraits.d.ts +4 -4
  243. package/lib/typescript/components/icons/Userpreferences.d.ts +4 -4
  244. package/lib/typescript/components/icons/index.d.ts +11 -11
  245. package/lib/typescript/components/onboarding/OAuthWebView.d.ts +9 -9
  246. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +10 -10
  247. package/lib/typescript/components/onboarding/PinInput.d.ts +3 -3
  248. package/lib/typescript/components/onboarding/PlatformConnector.d.ts +12 -12
  249. package/lib/typescript/components/screens/ConnectorScreen.d.ts +8 -8
  250. package/lib/typescript/components/screens/LoadingScreen.d.ts +8 -8
  251. package/lib/typescript/components/screens/PinCreationScreen.d.ts +9 -9
  252. package/lib/typescript/config/api.d.ts +23 -23
  253. package/lib/typescript/constants/index.d.ts +52 -52
  254. package/lib/typescript/context/AuthContext.d.ts +33 -33
  255. package/lib/typescript/hooks/useConnectedAccounts.d.ts +10 -10
  256. package/lib/typescript/hooks/useConnections.d.ts +13 -13
  257. package/lib/typescript/hooks/useCredentials.d.ts +8 -8
  258. package/lib/typescript/hooks/useUserConnections.d.ts +11 -11
  259. package/lib/typescript/index.d.ts +36 -35
  260. package/lib/typescript/index.d.ts.map +1 -1
  261. package/lib/typescript/services/apiClient.d.ts +90 -90
  262. package/lib/typescript/services/apiKeyService.d.ts +131 -131
  263. package/lib/typescript/services/authService.d.ts +215 -215
  264. package/lib/typescript/services/biometricPinService.d.ts +28 -28
  265. package/lib/typescript/services/connectedAccountsService.d.ts +55 -55
  266. package/lib/typescript/services/googleAuthService.d.ts +62 -62
  267. package/lib/typescript/services/imageCompressionService.d.ts +36 -36
  268. package/lib/typescript/services/jwtStorageService.d.ts +85 -85
  269. package/lib/typescript/services/mobileTrainingService.d.ts +44 -44
  270. package/lib/typescript/services/oauthService.d.ts +49 -49
  271. package/lib/typescript/services/pinEncryptionService.d.ts +16 -16
  272. package/lib/typescript/services/pinStorageUtils.d.ts +24 -24
  273. package/lib/typescript/services/platformAuthService.d.ts +68 -68
  274. package/lib/typescript/services/storageService.d.ts +127 -127
  275. package/lib/typescript/services/trainingApiHelpers.d.ts +37 -37
  276. package/lib/typescript/services/userConnectionsService.d.ts +89 -89
  277. package/lib/typescript/services/youtubeMigrationService.d.ts +11 -11
  278. package/lib/typescript/theme/index.d.ts +415 -415
  279. package/lib/typescript/types/index.d.ts +264 -264
  280. package/lib/typescript/types.d.ts +266 -266
  281. package/lib/typescript/utils/Portal.d.ts +13 -13
  282. package/lib/typescript/utils/api.d.ts +5 -5
  283. package/lib/typescript/utils/auth.d.ts +5 -5
  284. package/lib/typescript/utils/crypto.d.ts +3 -3
  285. package/lib/typescript/utils/debugHelper.d.ts +28 -28
  286. package/lib/typescript/utils/encryption.d.ts +18 -18
  287. package/lib/typescript/utils/eventUtils.d.ts +107 -107
  288. package/lib/typescript/utils/haptics.d.ts +10 -10
  289. package/lib/typescript/utils/imagePreloader.d.ts +1 -1
  290. package/lib/typescript/utils/onairosApi.d.ts +86 -86
  291. package/lib/typescript/utils/programmaticFlow.d.ts +22 -22
  292. package/lib/typescript/utils/retryHelper.d.ts +68 -68
  293. package/lib/typescript/utils/secureStorage.d.ts +93 -93
  294. package/package.json +1 -1
  295. package/src/components/OnairosSignInButton.tsx +110 -166
  296. package/src/index.ts +6 -4
  297. package/types/index.d.ts +213 -213
  298. package/types/node-env.d.ts +14 -14
  299. package/README.md +0 -404
  300. package/lib/commonjs/components/OnairosButton.js +0 -290
  301. package/lib/commonjs/components/OnairosButton.js.map +0 -1
  302. package/lib/module/components/OnairosButton.js +0 -282
  303. package/lib/module/components/OnairosButton.js.map +0 -1
  304. package/lib/typescript/components/OnairosButton.d.ts +0 -37
  305. package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
  306. package/src/components/OnairosButton.tsx +0 -339
  307. package/src/index.js +0 -14
package/README.md DELETED
@@ -1,404 +0,0 @@
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
- ### TypeScript Support
30
-
31
- The package includes full TypeScript declarations. Import types directly:
32
-
33
- ```typescript
34
- import { OnairosButton, OnairosCredentials, PlatformConfig } from '@onairos/react-native';
35
-
36
- // Type your component props
37
- const MyComponent: React.FC<{ credentials: OnairosCredentials }> = ({ credentials }) => {
38
- // Your component code
39
- };
40
-
41
- // Type your handlers
42
- const handleResolved = (apiUrl: string, accessToken: string, loginDetails: any) => {
43
- console.log('Authentication successful:', { apiUrl, accessToken, loginDetails });
44
- };
45
- ```
46
-
47
- ### Required Dependencies
48
-
49
- The package requires the following dependencies:
50
-
51
- ```bash
52
- # Core dependencies
53
- yarn add @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-safe-area-context
54
-
55
- # Authentication dependencies
56
- yarn add react-native-webview react-native-keychain
57
-
58
- # UI dependencies
59
- yarn add react-native-vector-icons
60
-
61
- # Network and encryption
62
- yarn add @react-native-community/netinfo react-native-rsa-native react-native-crypto-js
63
- ```
64
-
65
- ### iOS Setup
66
-
67
- 1. Install pods:
68
- ```bash
69
- cd ios && pod install
70
- ```
71
-
72
- 2. Add the following to your `Info.plist`:
73
- ```xml
74
- <key>CFBundleURLTypes</key>
75
- <array>
76
- <dict>
77
- <key>CFBundleURLSchemes</key>
78
- <array>
79
- <!-- <string>onairosreact</string> -->
80
- <string>onairosanime</string>
81
- </array>
82
- </dict>
83
- </array>
84
-
85
- <!-- Add for biometric authentication -->
86
- <key>NSFaceIDUsageDescription</key>
87
- <string>We use Face ID to securely access your Onairos account</string>
88
- ```
89
-
90
- 3. Configure your OAuth providers in the project settings and register the callback URLs.
91
-
92
- ### Android Setup
93
-
94
- 1. Add the following to your `android/app/src/main/AndroidManifest.xml`:
95
- ```xml
96
- <activity>
97
- <!-- ... -->
98
- <intent-filter>
99
- <action android:name="android.intent.action.VIEW" />
100
- <category android:name="android.intent.category.DEFAULT" />
101
- <category android:name="android.intent.category.BROWSABLE" />
102
- <!-- <data android:scheme="onairosreact" /> -->
103
- <data android:scheme="onairosanime" />
104
- </intent-filter>
105
- </activity>
106
- ```
107
-
108
- 2. Add biometric permissions:
109
- ```xml
110
- <uses-permission android:name="android.permission.USE_BIOMETRIC" />
111
- ```
112
-
113
- ## Usage
114
-
115
- 📖 **[Quick Integration Guide](./QUICK_INTEGRATION_GUIDE.md) - Start here for immediate copy-paste setup!**
116
-
117
- 📖 **For comprehensive usage examples in both JavaScript and TypeScript, see [USAGE_EXAMPLES.md](./USAGE_EXAMPLES.md)**
118
-
119
- ### Important: Setup Portal Host
120
-
121
- For modals and overlays to appear properly, you must wrap your app with the `PortalHost` component:
122
-
123
- ```javascript
124
- import { PortalHost } from '@onairos/react-native';
125
-
126
- export default function App() {
127
- return (
128
- <PortalHost>
129
- {/* Your app content goes here */}
130
- <MainNavigator />
131
- </PortalHost>
132
- );
133
- }
134
- ```
135
-
136
- ### Basic Button Integration
137
-
138
- 1. Import the OnairosButton component:
139
- ```javascript
140
- import { OnairosButton } from '@onairos/react-native';
141
- ```
142
-
143
- 2. Use the component in your app:
144
- ```javascript
145
- export default function App() {
146
- const handleResolved = (apiUrl, accessToken, loginDetails) => {
147
- console.log('Authentication successful:', { apiUrl, accessToken, loginDetails });
148
- // Store the tokens and proceed with your app logic
149
- };
150
-
151
- return (
152
- <View style={styles.container}>
153
- <OnairosButton
154
- AppName="YourApp"
155
- requestData={{
156
- "Social Media": {
157
- "Profile Information": "Access to your basic profile data",
158
- "Post History": "Access to your post history for analysis"
159
- },
160
- "Content": {
161
- "Images": "Access to image data for AI training",
162
- "Text": "Access to text data for AI training"
163
- }
164
- }}
165
- returnLink="your-app://auth-callback"
166
- onResolved={handleResolved}
167
- buttonType="pill"
168
- color="#00BFA5"
169
- />
170
- </View>
171
- );
172
- }
173
- ```
174
-
175
- ### Initialize OAuth Service
176
-
177
- Add this to your app's entry point to handle deep linking for OAuth:
178
-
179
- ```javascript
180
- import { initializeOAuthService } from '@onairos/react-native';
181
-
182
- // In your app's entry point
183
- useEffect(() => {
184
- // Set up OAuth deep linking
185
- initializeOAuthService();
186
-
187
- // Clean up when component unmounts
188
- return () => {
189
- cleanupOAuthService();
190
- };
191
- }, []);
192
- ```
193
-
194
- ### Working with Secure Storage
195
-
196
- ```javascript
197
- import { storeCredentials, getCredentials, hasCredentials } from '@onairos/react-native';
198
-
199
- // Check if user has stored credentials
200
- const checkAuth = async () => {
201
- const hasExisting = await hasCredentials();
202
-
203
- if (hasExisting) {
204
- // Get credentials with biometric authentication
205
- const credentials = await getCredentials({
206
- useBiometrics: true,
207
- biometricPrompt: {
208
- title: 'Authenticate to continue',
209
- subtitle: 'Please verify your identity'
210
- }
211
- });
212
-
213
- if (credentials) {
214
- // User is authenticated
215
- console.log('User authenticated:', credentials.username);
216
- }
217
- } else {
218
- // Redirect to onboarding flow
219
- setShowOnboarding(true);
220
- }
221
- };
222
- ```
223
-
224
- ## API Reference
225
-
226
- ### Main Components
227
-
228
- #### `OnairosButton`
229
-
230
- The main entry point for Onairos authentication with full training flow support.
231
-
232
- | Prop | Type | Required | Description |
233
- |------|------|----------|-------------|
234
- | AppName | string | Yes | Your application name |
235
- | requestData | object | Yes | Platform-specific OAuth scopes and data requests |
236
- | returnLink | string | Yes | Deep link URL for OAuth callback |
237
- | embedd | boolean | No | Whether to use embedded flow (default: false) |
238
- | color | string | No | Button color (default: #00BFA5) |
239
- | icon | string | No | Button icon name (default: 'auto_awesome') |
240
- | onResolved | function | Yes | Callback for successful auth with (apiUrl, accessToken, loginDetails) |
241
- | login | boolean | No | Enable login mode (default: false) |
242
- | buttonType | 'circle' \| 'pill' | No | Button style (default: 'circle') |
243
- | debug | boolean | No | Enable debug mode (default: false) |
244
- | test | boolean | No | Enable test mode (default: false) |
245
-
246
- #### `UniversalOnboarding`
247
-
248
- The universal onboarding flow component.
249
-
250
- | Prop | Type | Required | Description |
251
- |------|------|----------|-------------|
252
- | visible | boolean | Yes | Whether the onboarding is visible |
253
- | onClose | function | Yes | Callback when onboarding is closed |
254
- | AppName | string | Yes | Your application name |
255
- | requestData | object | Yes | Platform-specific OAuth scopes |
256
- | returnLink | string | Yes | Deep link URL for OAuth callback |
257
- | onComplete | function | Yes | Callback when onboarding is complete |
258
- | embedd | boolean | No | Whether to use embedded flow |
259
- | debug | boolean | No | Enable debug mode |
260
- | test | boolean | No | Enable test mode |
261
-
262
- #### `TrainingModal`
263
-
264
- Email authentication and training progress modal.
265
-
266
- | Prop | Type | Required | Description |
267
- |------|------|----------|-------------|
268
- | visible | boolean | Yes | Whether the modal is visible |
269
- | onCancel | function | Yes | Callback when modal is cancelled |
270
- | onComplete | function | Yes | Callback when training is complete |
271
- | modelKey | string | No | Model key for training |
272
- | username | string | No | Username for training |
273
- | isPrimaryAuth | boolean | No | Whether this is primary authentication |
274
- | autoFocusEmailInput | boolean | No | Auto-focus email input on show |
275
-
276
- #### `WelcomeScreen`
277
-
278
- New welcome flow component with modern UI.
279
-
280
- | Prop | Type | Required | Description |
281
- |------|------|----------|-------------|
282
- | visible | boolean | Yes | Whether the screen is visible |
283
- | onClose | function | Yes | Callback when screen is closed |
284
- | onComplete | function | Yes | Callback when flow is complete |
285
-
286
- #### `Overlay`
287
-
288
- Data request overlay component.
289
-
290
- | Prop | Type | Required | Description |
291
- |------|------|----------|-------------|
292
- | visible | boolean | Yes | Whether the overlay is visible |
293
- | onClose | function | Yes | Callback when overlay is closed |
294
- | onAccept | function | Yes | Callback when request is accepted |
295
- | AppName | string | Yes | Your application name |
296
- | requestData | object | Yes | Data being requested |
297
- | biometricType | 'FaceID' \| 'TouchID' \| 'BiometricID' | No | Type of biometric auth to use |
298
-
299
- ### Utility Functions
300
-
301
- #### Secure Storage
302
-
303
- - `storeCredentials(credentials, options)`: Store credentials securely
304
- - `getCredentials(options)`: Retrieve credentials with optional biometric auth
305
- - `hasCredentials()`: Check if user has stored credentials
306
- - `deleteCredentials()`: Delete stored credentials
307
- - `updateCredentials(updates, options)`: Update specific fields in credentials
308
- - `generateDeviceUsername()`: Generate a device-specific unique username
309
- - `verifyCredentials(credentials)`: Verify if credentials are valid
310
-
311
- #### OAuth Service
312
-
313
- - `connectPlatform(platform)`: Initiate OAuth flow for a specific platform
314
- - `disconnectPlatform(platform, credentials)`: Disconnect a platform
315
- - `initializeOAuthService()`: Initialize OAuth service handlers
316
- - `cleanupOAuthService()`: Clean up OAuth service handlers
317
- - `storePlatformConnection(platform, connectionData, credentials)`: Store platform connection
318
-
319
- #### API Communication
320
-
321
- - `validateCredentials(username, options)`: Validate user credentials with the API
322
- - `createAccount(credentials, options)`: Create a new user account
323
- - `authenticate(credentials, options)`: Authenticate with the API using credentials
324
- - `refreshToken(refreshToken, options)`: Refresh authentication token
325
- - `getPlatformData(accessToken, platform, options)`: Get user's connected platform data
326
- - `getUserProfile(accessToken, options)`: Get user profile information
327
- - `updatePlatformConnections(accessToken, platforms, options)`: Update user platform connections
328
-
329
- ## Development and Testing
330
-
331
- ### Setup Development Environment
332
-
333
- 1. Clone the repository:
334
- ```bash
335
- git clone https://github.com/onairos/onairos-react-native.git
336
- cd onairos-react-native
337
- ```
338
-
339
- 2. Install dependencies:
340
- ```bash
341
- yarn install
342
- ```
343
-
344
- 3. Run the typecheck:
345
- ```bash
346
- yarn typecheck
347
- ```
348
-
349
- ### Building the Package
350
-
351
- ```bash
352
- npm run build:all
353
- ```
354
-
355
- ### Testing with a Local App
356
-
357
- 1. Link the package locally:
358
- ```bash
359
- # In your package directory
360
- yarn link
361
-
362
- # In your app directory
363
- yarn link @onairos/react-native
364
- ```
365
-
366
- 2. Run your app and test the integration.
367
-
368
- ## Troubleshooting
369
-
370
- ### OAuth Callback Issues
371
-
372
- - Ensure your deep link schemes are properly configured in both iOS and Android
373
- - Check that the callback URLs match what's registered with your OAuth providers
374
- - Ensure all required permissions are enabled in your app configurations
375
-
376
- ### Biometric Authentication Issues
377
-
378
- - Ensure proper permissions are set in Info.plist and AndroidManifest.xml
379
- - Test on physical devices as simulators may not support all biometric features
380
- - For iOS, ensure that Face ID/Touch ID is enabled and set up on the device
381
-
382
- ### Platform Specific Issues
383
-
384
- #### iOS
385
-
386
- - For keychain issues, check that the Keychain Sharing capability is enabled
387
- - Ensure the bundle identifier is consistent with your OAuth configuration
388
-
389
- #### Android
390
-
391
- - For deep linking issues, check the androidManifest.xml configuration
392
- - Ensure that biometric hardware is available on test devices
393
-
394
- ## Contributing
395
-
396
- 1. Fork the repository
397
- 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
398
- 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
399
- 4. Push to the branch (`git push origin feature/amazing-feature`)
400
- 5. Open a Pull Request
401
-
402
- ## License
403
-
404
- MIT
@@ -1,290 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.OnairosButton = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
10
- var _UniversalOnboarding = require("./UniversalOnboarding");
11
- var _WelcomeScreen = _interopRequireDefault(require("./WelcomeScreen"));
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
- const {
15
- width
16
- } = _reactNative.Dimensions.get('window');
17
- const OnairosButton = exports.OnairosButton = /*#__PURE__*/(0, _react.forwardRef)(({
18
- AppName,
19
- buttonType = 'normal',
20
- buttonWidth = 180,
21
- buttonHeight = 48,
22
- hasStroke = false,
23
- enabled = true,
24
- buttonForm = 'default',
25
- onResolved,
26
- onRejection,
27
- preCheck,
28
- color = '#1BA9D4',
29
- swerv = false,
30
- darkMode = false,
31
- returnLink,
32
- preferredPlatform,
33
- autoFetch = false,
34
- inferenceData,
35
- textLayout = 'right',
36
- textColor = 'black',
37
- proofMode = false,
38
- webpageName,
39
- debug = false,
40
- testMode = false,
41
- requestData,
42
- onPress,
43
- primaryAuthOnly = false,
44
- useNewWelcomeFlow = false
45
- }, ref) => {
46
- const [isLoading, setIsLoading] = (0, _react.useState)(false);
47
- const [isPressed, setIsPressed] = (0, _react.useState)(false);
48
- const [showOnboarding, setShowOnboarding] = (0, _react.useState)(false);
49
- console.log('[OnairosButton] Initializing. Initial showOnboarding:', showOnboarding);
50
- (0, _react.useEffect)(() => {
51
- console.log('[OnairosButton] LogEffect: showOnboarding state changed to:', showOnboarding);
52
- }, [showOnboarding]);
53
-
54
- // Expose methods via ref
55
- (0, _react.useImperativeHandle)(ref, () => ({
56
- trigger: async () => {
57
- await handlePress();
58
- return Promise.resolve();
59
- },
60
- reset: async () => {
61
- return Promise.resolve();
62
- }
63
- }));
64
- const handlePress = async () => {
65
- console.log('[OnairosButton] handlePress called.');
66
- if (!enabled || isLoading) return;
67
- setIsLoading(true);
68
- try {
69
- if (preCheck) {
70
- const shouldProceed = await preCheck();
71
- if (!shouldProceed) {
72
- console.log('[OnairosButton] Precheck failed. Setting showOnboarding to false (indirectly, by not setting to true).');
73
- onRejection === null || onRejection === void 0 || onRejection('Precheck validation failed');
74
- setIsLoading(false);
75
- return;
76
- }
77
- }
78
- console.log('[OnairosButton] handlePress: Setting showOnboarding to true.');
79
- setShowOnboarding(true);
80
- setIsLoading(false);
81
- } catch (error) {
82
- console.error('[OnairosButton] Error in handlePress:', error);
83
- onRejection === null || onRejection === void 0 || onRejection(error instanceof Error ? error.message : 'Unknown error');
84
- setIsLoading(false);
85
- }
86
- };
87
-
88
- // Compute button text based on buttonForm
89
- const getButtonText = () => {
90
- switch (buttonForm) {
91
- case 'connect':
92
- return 'Connect Onairos';
93
- case 'login':
94
- return 'Sign in with Onairos';
95
- case 'signup':
96
- return 'Sign up with Onairos';
97
- default:
98
- return 'Connect Onairos';
99
- }
100
- };
101
-
102
- // Handle onboarding completion
103
- const handleOnboardingComplete = (0, _react.useCallback)((token, email) => {
104
- console.log('[OnairosButton] handleOnboardingComplete: Setting showOnboarding to false.');
105
- setShowOnboarding(false);
106
- if (onResolved) {
107
- // Call onResolved with the token and email
108
- onResolved(token, email);
109
- }
110
- if (onPress) {
111
- onPress();
112
- }
113
- }, [onResolved, onPress]);
114
-
115
- // Handle onboarding close
116
- const handleOnboardingClose = (0, _react.useCallback)(() => {
117
- console.log('[OnairosButton] handleOnboardingClose: Setting showOnboarding to false.');
118
- setShowOnboarding(false);
119
- if (onRejection) {
120
- onRejection('User closed onboarding');
121
- }
122
- }, [onRejection]);
123
- console.log('[OnairosButton] Rendering JSX with props:', {
124
- AppName,
125
- buttonType,
126
- buttonWidth,
127
- buttonHeight,
128
- hasStroke,
129
- enabled,
130
- buttonForm,
131
- onResolved,
132
- onRejection,
133
- preCheck,
134
- color,
135
- swerv,
136
- darkMode,
137
- returnLink,
138
- preferredPlatform,
139
- autoFetch,
140
- inferenceData,
141
- textLayout,
142
- textColor,
143
- proofMode,
144
- webpageName,
145
- debug,
146
- testMode,
147
- requestData,
148
- onPress,
149
- primaryAuthOnly,
150
- useNewWelcomeFlow
151
- });
152
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
153
- style: [styles.button, buttonType === 'pill' && styles.pillButton, hasStroke && styles.strokedButton, {
154
- width: buttonWidth,
155
- height: buttonHeight
156
- }, swerv && styles.swervButton, !enabled && styles.disabledButton],
157
- onPress: handlePress,
158
- disabled: !enabled || isLoading,
159
- onPressIn: () => setIsPressed(true),
160
- onPressOut: () => setIsPressed(false)
161
- }, /*#__PURE__*/_react.default.createElement(_reactNativeLinearGradient.default, {
162
- colors: ['#f5e7c1', '#C7A047', '#8B6914'],
163
- start: {
164
- x: 0,
165
- y: 0
166
- },
167
- end: {
168
- x: 1,
169
- y: 0
170
- },
171
- style: {
172
- position: 'absolute',
173
- left: 0,
174
- right: 0,
175
- top: 0,
176
- bottom: 0,
177
- borderRadius: buttonType === 'pill' ? 24 : 8
178
- }
179
- }), isLoading ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
180
- size: "small",
181
- color: "#FFFFFF"
182
- }) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
183
- style: styles.buttonContent
184
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
185
- style: styles.logoContainer
186
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
187
- source: require('../assets/images/onairos_logo.png'),
188
- style: styles.logoImage,
189
- resizeMode: "contain"
190
- })), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
191
- style: [styles.buttonText, {
192
- color: '#FFFFFF'
193
- }]
194
- }, getButtonText())))), useNewWelcomeFlow ? /*#__PURE__*/_react.default.createElement(_WelcomeScreen.default, {
195
- visible: showOnboarding,
196
- onClose: handleOnboardingClose,
197
- onComplete: handleOnboardingComplete
198
- }) : /*#__PURE__*/_react.default.createElement(_UniversalOnboarding.UniversalOnboarding, {
199
- visible: showOnboarding,
200
- onClose: handleOnboardingClose,
201
- AppName: AppName,
202
- requestData: requestData || {
203
- Small: {
204
- type: 'Small',
205
- descriptions: 'Basic tier',
206
- reward: 'Free access'
207
- },
208
- Medium: {
209
- type: 'Medium',
210
- descriptions: 'Standard tier',
211
- reward: 'Premium features'
212
- },
213
- Large: {
214
- type: 'Large',
215
- descriptions: 'Premium tier',
216
- reward: 'Full personalization'
217
- }
218
- },
219
- returnLink: returnLink || 'onairosevents://auth/callback',
220
- onComplete: handleOnboardingComplete,
221
- debug: debug,
222
- test: testMode,
223
- preferredPlatform: preferredPlatform,
224
- primaryAuthOnly: primaryAuthOnly
225
- }));
226
- });
227
- const styles = _reactNative.StyleSheet.create({
228
- button: {
229
- flexDirection: 'row',
230
- alignItems: 'center',
231
- justifyContent: 'center',
232
- paddingVertical: 12,
233
- paddingHorizontal: 16,
234
- borderRadius: 8,
235
- shadowColor: '#000',
236
- shadowOffset: {
237
- width: 0,
238
- height: 2
239
- },
240
- shadowOpacity: 0.2,
241
- shadowRadius: 4,
242
- elevation: 3,
243
- overflow: 'hidden'
244
- },
245
- buttonContent: {
246
- flexDirection: 'row',
247
- alignItems: 'center',
248
- justifyContent: 'center'
249
- },
250
- logoContainer: {
251
- width: 24,
252
- height: 24,
253
- // borderRadius: 12, // Removed to eliminate circle shape
254
- // backgroundColor: '#FFFFFF', // Removed to eliminate white background
255
- alignItems: 'center',
256
- justifyContent: 'center',
257
- marginRight: 4
258
- },
259
- logoText: {
260
- color: '#C7A047',
261
- fontWeight: 'bold',
262
- fontSize: 14
263
- },
264
- logoImage: {
265
- width: 20,
266
- height: 20
267
- },
268
- pillButton: {
269
- borderRadius: 24
270
- },
271
- strokedButton: {
272
- backgroundColor: 'transparent',
273
- borderWidth: 1
274
- },
275
- swervButton: {
276
- transform: [{
277
- rotate: '-2deg'
278
- }]
279
- },
280
- disabledButton: {
281
- opacity: 0.6
282
- },
283
- buttonText: {
284
- fontSize: 16,
285
- fontWeight: '600',
286
- textAlign: 'center'
287
- }
288
- });
289
- var _default = exports.default = OnairosButton;
290
- //# sourceMappingURL=OnairosButton.js.map