@onairosofficial/onairos-capacitor 0.1.0 → 0.1.2

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 (202) hide show
  1. package/CAPACITOR_QUICK_START.md +379 -0
  2. package/CONNECTORS.md +122 -0
  3. package/LICENSE +194 -10
  4. package/OnairosofficialOnairosCapacitor.podspec +13 -0
  5. package/Package.swift +26 -0
  6. package/README.md +176 -25
  7. package/dist/onairos.capacitor.esm.js +1 -0
  8. package/dist/onairos.capacitor.esm.turbopack.js +1 -0
  9. package/docs/CAPACITOR_INTEGRATION_GUIDE.md +159 -0
  10. package/docs/CAPACITOR_MOCK_APP_TESTING.md +213 -0
  11. package/docs/CAPACITOR_SDK_FIXES_SUMMARY.md +65 -0
  12. package/docs/CROSS_SDK_PARITY.md +239 -0
  13. package/docs/DATA_FREQUENCY.md +57 -0
  14. package/docs/DEVELOPER_SDK_CHANGES.md +532 -0
  15. package/docs/INCIDENT_ENABLETRAINING_PIN_WEB_8.1.9.md +82 -0
  16. package/docs/ONAIROS_BUTTON_PROPS.md +152 -0
  17. package/docs/PLATFORM_APIS.md +559 -0
  18. package/docs/RAW_MEMORIES_API.md +305 -0
  19. package/docs/RAW_MEMORIES_SDK_UPDATE.md +54 -0
  20. package/docs/SDK_PARITY_ROLLUP_2026_04_24_to_05_02.md +96 -0
  21. package/docs/oldFixes.md +216 -0
  22. package/ios/Sources/OnairosNativeConnectorsPlugin/OnairosChatGPTNativePlugin.swift +993 -0
  23. package/ios/Sources/OnairosNativeConnectorsPlugin/OnairosNetflixNativePlugin.swift +33 -0
  24. package/ios/Sources/OnairosNativeConnectorsPlugin/OnairosSpotifyNativePlugin.swift +1082 -0
  25. package/onairos.d.ts +656 -0
  26. package/package.json +188 -37
  27. package/src/OnairosReconnectButton.jsx +272 -0
  28. package/src/RSA.jsx +57 -0
  29. package/src/assets/NewLogo.png +0 -0
  30. package/src/assets/OnairosNewLogo.png +0 -0
  31. package/src/assets/chatgpt-icon.png +0 -0
  32. package/src/assets/fire-horse.png +0 -0
  33. package/src/assets/fire-horse.transparent.png +0 -0
  34. package/src/assets/latest-firehorse.png +0 -0
  35. package/src/assets/perplexity.png +0 -0
  36. package/src/assets/persona.png +0 -0
  37. package/src/assets/persona1.png +0 -0
  38. package/src/assets/persona2.png +0 -0
  39. package/src/assets/persona3.png +0 -0
  40. package/src/assets/persona4.png +0 -0
  41. package/src/assets/persona5.png +0 -0
  42. package/src/capacitorConnectorCatalog.js +38 -0
  43. package/src/capacitorOAuthConfig.js +52 -0
  44. package/src/chatgptHostedImport/index.js +303 -0
  45. package/src/components/AuthButtons.jsx +48 -0
  46. package/src/components/ConnectChatGPTModal.jsx +666 -0
  47. package/src/components/ConnectClaudeModal.jsx +610 -0
  48. package/src/components/ConnectGeminiModal.jsx +639 -0
  49. package/src/components/ConnectGrokModal.jsx +701 -0
  50. package/src/components/ConnectPerplexityModal.jsx +726 -0
  51. package/src/components/DataExplainerScreen.jsx +349 -0
  52. package/src/components/DataRequest.js +885 -0
  53. package/src/components/DataRequest.jsx +1055 -0
  54. package/src/components/EmailAuth.js +1871 -0
  55. package/src/components/EmailAuth.jsx +2062 -0
  56. package/src/components/ExtensionInstallPrompt.jsx +142 -0
  57. package/src/components/GoogleButton.js +133 -0
  58. package/src/components/LLMConnectorManager.jsx +201 -0
  59. package/src/components/LoadingPage.jsx +19 -0
  60. package/src/components/LoadingScreen.jsx +81 -0
  61. package/src/components/LunarBirthdate.jsx +96 -0
  62. package/src/components/LunarLoadingPage.jsx +251 -0
  63. package/src/components/Notification.jsx +21 -0
  64. package/src/components/OnairosAppButton.jsx +85 -0
  65. package/src/components/OnairosSSO.jsx +645 -0
  66. package/src/components/OnairosTrigger.jsx +61 -0
  67. package/src/components/PerplexityLogo.jsx +43 -0
  68. package/src/components/PinSetup.js +200 -0
  69. package/src/components/PinSetup.jsx +228 -0
  70. package/src/components/SDK_PIN_INTEGRATION_REQUIRED_CHANGES.md +526 -0
  71. package/src/components/SdkErrorBoundary.jsx +36 -0
  72. package/src/components/SecuritySetup.js +81 -0
  73. package/src/components/SessionUserBar.jsx +83 -0
  74. package/src/components/SignUp.js +123 -0
  75. package/src/components/TestTelegramButton.js +53 -0
  76. package/src/components/TrainingComponent.jsx +200 -0
  77. package/src/components/TrainingScreen.jsx +897 -0
  78. package/src/components/UniversalOnboarding.js +306 -0
  79. package/src/components/UniversalOnboarding.jsx +4837 -0
  80. package/src/components/ValentineLoadingPage.jsx +502 -0
  81. package/src/components/ValentineModeSelector.jsx +162 -0
  82. package/src/components/WelcomeScreen.jsx +435 -0
  83. package/src/components/WrappedLoadingPage.jsx +205 -0
  84. package/src/components/connectors/ChatGPTConnector.js +348 -0
  85. package/src/components/connectors/ChatGPTConnector.jsx +348 -0
  86. package/src/components/connectors/ClaudeConnector.js +44 -0
  87. package/src/components/connectors/ClaudeConnector.jsx +44 -0
  88. package/src/components/connectors/GeminiConnector.js +170 -0
  89. package/src/components/connectors/GeminiConnector.jsx +170 -0
  90. package/src/components/connectors/GmailConnector.js +148 -0
  91. package/src/components/connectors/GmailConnector.jsx +148 -0
  92. package/src/components/connectors/GrokConnector.js +16 -0
  93. package/src/components/connectors/GrokConnector.jsx +16 -0
  94. package/src/components/connectors/HingeConnector.js +419 -0
  95. package/src/components/connectors/HingeConnector.jsx +419 -0
  96. package/src/components/connectors/InstagramDataConnector.js +726 -0
  97. package/src/components/connectors/InstagramDataConnector.jsx +726 -0
  98. package/src/components/connectors/LinkedInConnector.js +4 -0
  99. package/src/components/connectors/LinkedInConnector.jsx +296 -0
  100. package/src/components/connectors/PerplexityConnector.jsx +16 -0
  101. package/src/components/connectors/PinterestConnector.js +208 -0
  102. package/src/components/connectors/PinterestConnector.jsx +208 -0
  103. package/src/components/connectors/README.md +292 -0
  104. package/src/components/connectors/RedditConnector.js +229 -0
  105. package/src/components/connectors/RedditConnector.jsx +229 -0
  106. package/src/components/connectors/SephoraConnector.js +482 -0
  107. package/src/components/connectors/SephoraConnector.jsx +482 -0
  108. package/src/components/connectors/TikTokConnector.jsx +430 -0
  109. package/src/components/connectors/YoutubeConnector.js +361 -0
  110. package/src/components/connectors/YoutubeConnector.jsx +361 -0
  111. package/src/components/connectors/index.js +50 -0
  112. package/src/components/icons.jsx +46 -0
  113. package/src/components/icons.tsx +21 -0
  114. package/src/components/ui/PageLayout.jsx +1255 -0
  115. package/src/components/ui/PrimaryButton.jsx +162 -0
  116. package/src/components/ui/button.jsx +49 -0
  117. package/src/components/ui/card.jsx +61 -0
  118. package/src/components/ui/checkbox.jsx +33 -0
  119. package/src/components/ui/label.jsx +29 -0
  120. package/src/components/utils/UpdateConnections.js +45 -0
  121. package/src/components/utils/oauthHelper.js +97 -0
  122. package/src/config/api-config.js +138 -0
  123. package/src/deepLink.jsx +38 -0
  124. package/src/getPin.js +26 -0
  125. package/src/icons/Avatar.png +0 -0
  126. package/src/icons/Sentiment.png +0 -0
  127. package/src/icons/Trait.png +0 -0
  128. package/src/iframe/DataRequestPage.jsx +285 -0
  129. package/src/iframe/OnairosButtonIntegration.md +148 -0
  130. package/src/iframe/components/Box.jsx +56 -0
  131. package/src/iframe/components/IndividualConnection.jsx +88 -0
  132. package/src/iframe/dataRequestHandler.js +714 -0
  133. package/src/iframe/data_request_iframe.html +27 -0
  134. package/src/iframe/data_request_page.js +47 -0
  135. package/src/iframe/icons/Avatar.png +1 -0
  136. package/src/iframe/icons/Avatar2.png +1 -0
  137. package/src/iframe/icons/Sentiment.png +1 -0
  138. package/src/iframe/icons/Trait.png +1 -0
  139. package/src/iframe/icons/onairos_logo.png +0 -0
  140. package/src/iframe/utils/api.js +57 -0
  141. package/src/index.js +274 -0
  142. package/src/laravel/OnairosVue.vue +410 -0
  143. package/src/laravel/blade-helpers.js +320 -0
  144. package/src/laravel/vite-plugin.js +179 -0
  145. package/src/mobile/MobileDataRequestPage.jsx +233 -0
  146. package/src/mobile/components/MobileBox.jsx +71 -0
  147. package/src/mobile/components/MobileIndividualConnection.jsx +51 -0
  148. package/src/mobile/shims/browser-apis.js +78 -0
  149. package/src/mobile/shims/lucide-shim.js +85 -0
  150. package/src/nativeConnectors.js +5 -0
  151. package/src/newUI/EMAIL_VERIFICATION_API_SCHEMA.md +268 -0
  152. package/src/newUI/PlatformConnectorsStep.tsx +435 -0
  153. package/src/newUI/PrimaryButton.tsx +213 -0
  154. package/src/newUI/SignInStep.tsx +194 -0
  155. package/src/newUI/VerificationStep.tsx +133 -0
  156. package/src/newUI/WelcomeScreen.tsx +311 -0
  157. package/src/newUI/services/connectedAccountsService.js +129 -0
  158. package/src/onairos.capacitor.jsx +15 -0
  159. package/src/onairos.core.jsx +133 -0
  160. package/src/onairos.jsx +14 -0
  161. package/src/onairos.native.jsx +15 -0
  162. package/src/onairosButton.jsx +9000 -0
  163. package/src/overlay/CheckBox.jsx +114 -0
  164. package/src/overlay/IndividualConnection copy.js +86 -0
  165. package/src/overlay/IndividualConnection.js +191 -0
  166. package/src/overlay/IndividualConnectionNew.jsx +157 -0
  167. package/src/overlay/box.js +84 -0
  168. package/src/overlay/overlay.js +437 -0
  169. package/src/styles/onairos-scoped-preflight.css +97 -0
  170. package/src/styles/sdkCssRegistry.js +20 -0
  171. package/src/styles/styleLoaderInsertShadow.js +69 -0
  172. package/src/styles/tailwind.capacitor.css +395 -0
  173. package/src/styles/tailwind.css +395 -0
  174. package/src/theme/colors.js +40 -0
  175. package/src/utils/apiKeyValidation.js +341 -0
  176. package/src/utils/apiResponseLogger.js +316 -0
  177. package/src/utils/authHeaders.js +275 -0
  178. package/src/utils/biometrics.js +26 -0
  179. package/src/utils/bookmarkletUtils.js +28 -0
  180. package/src/utils/capacitorDetection.js +278 -0
  181. package/src/utils/capacitorLLMHelper.js +352 -0
  182. package/src/utils/capacitorPlugins.js +366 -0
  183. package/src/utils/crossDomainSSO.js +587 -0
  184. package/src/utils/deepLinking.js +27 -0
  185. package/src/utils/devLogger.js +46 -0
  186. package/src/utils/extensionDetection.js +418 -0
  187. package/src/utils/extractMemory.js +277 -0
  188. package/src/utils/framerBrandingOverrides.js +40 -0
  189. package/src/utils/googleWebClientId.js +55 -0
  190. package/src/utils/overlayHandler.js +224 -0
  191. package/src/utils/platformDisconnect.js +309 -0
  192. package/src/utils/pollTrainingStatus.js +200 -0
  193. package/src/utils/rawMemoriesAccess.js +211 -0
  194. package/src/utils/resolveBackendAppId.js +47 -0
  195. package/src/utils/responseFormatter.js +140 -0
  196. package/src/utils/sdkDebugStorage.js +113 -0
  197. package/src/utils/sdkInitialization.js +645 -0
  198. package/src/utils/sessionManager.js +1258 -0
  199. package/src/utils/startBackgroundTraining.js +100 -0
  200. package/src/utils/userDataFormatter.js +222 -0
  201. package/index.d.ts +0 -1
  202. package/index.js +0 -1
package/LICENSE CHANGED
@@ -2,16 +2,200 @@
2
2
  Version 2.0, January 2004
3
3
  http://www.apache.org/licenses/
4
4
 
5
- Copyright 2026 Zion Darko
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
6
 
7
- Licensed under the Apache License, Version 2.0 (the "License");
8
- you may not use this file except in compliance with the License.
9
- You may obtain a copy of the License at
7
+ 1. Definitions.
10
8
 
11
- http://www.apache.org/licenses/LICENSE-2.0
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
12
11
 
13
- Unless required by applicable law or agreed to in writing, software
14
- distributed under the License is distributed on an "AS IS" BASIS,
15
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- See the License for the specific language governing permissions and
17
- limitations under the License.
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,13 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'OnairosofficialOnairosCapacitor'
3
+ s.version = '0.1.2'
4
+ s.summary = 'Capacitor SDK and native WKWebView connectors for Onairos apps.'
5
+ s.license = { :type => 'Apache-2.0' }
6
+ s.homepage = 'https://onairos.io'
7
+ s.author = { 'Onairos' => 'team@onairos.io' }
8
+ s.source = { :git => 'https://github.com/zd819/onairos-capacitor.git', :tag => s.version.to_s }
9
+ s.source_files = 'ios/Sources/**/*.{swift,h,m}'
10
+ s.ios.deployment_target = '15.0'
11
+ s.swift_version = '5.9'
12
+ s.dependency 'Capacitor'
13
+ end
package/Package.swift ADDED
@@ -0,0 +1,26 @@
1
+ // swift-tools-version: 5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "OnairosofficialOnairosCapacitor",
6
+ platforms: [.iOS(.v15)],
7
+ products: [
8
+ .library(
9
+ name: "OnairosofficialOnairosCapacitor",
10
+ targets: ["OnairosNativeConnectorsPlugin"]
11
+ )
12
+ ],
13
+ dependencies: [
14
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
15
+ ],
16
+ targets: [
17
+ .target(
18
+ name: "OnairosNativeConnectorsPlugin",
19
+ dependencies: [
20
+ .product(name: "Capacitor", package: "capacitor-swift-pm"),
21
+ .product(name: "Cordova", package: "capacitor-swift-pm")
22
+ ],
23
+ path: "ios/Sources/OnairosNativeConnectorsPlugin"
24
+ )
25
+ ]
26
+ )
package/README.md CHANGED
@@ -1,44 +1,195 @@
1
- # Onairos Capacitor
1
+ # @onairosofficial/onairos-capacitor
2
2
 
3
- Dedicated Capacitor entry point for the Onairos SDK. This package delegates to
4
- the maintained `onairos/capacitor` implementation, giving Capacitor projects a
5
- clear package to install without duplicating the SDK.
3
+ Capacitor-first Onairos SDK package for React, Vite, iOS, and Android apps.
6
4
 
7
- ## Installation
5
+ The package root exports the Capacitor-safe SDK entry:
6
+
7
+ ```jsx
8
+ import { OnairosButton, SUPPORTED_PLATFORMS } from '@onairosofficial/onairos-capacitor';
9
+ ```
10
+
11
+ ## Install
8
12
 
9
13
  ```bash
10
- npm install onairos-capacitor onairos @capacitor/core
14
+ npm install @onairosofficial/onairos-capacitor
15
+ npm install @capacitor/core @capacitor/app @capacitor/browser @capgo/capacitor-social-login
16
+ npx cap sync ios
11
17
  ```
12
18
 
13
- Install the native integrations required by your application, then synchronize
14
- the Capacitor project:
19
+ The package includes the Capacitor iOS plugin files for native WKWebView connectors such as Spotify and ChatGPT. Consumers do not need to install a separate Onairos native connector package.
20
+
21
+ ## Build This Package
15
22
 
16
23
  ```bash
17
- npm install @capgo/capacitor-social-login @onairosofficial/capacitor-llm-onairos
18
- npx cap sync
24
+ npm install
25
+ npm run build
26
+ ```
27
+
28
+ The default build is Capacitor-only and produces:
29
+
30
+ ```text
31
+ dist/onairos.capacitor.esm.js
32
+ dist/onairos.capacitor.esm.turbopack.js
19
33
  ```
20
34
 
21
- ## Usage
35
+ Use `npm run build:protected` when you want the optional obfuscated production bundle.
22
36
 
23
- ```js
24
- import { initializeApiKey, OnairosButton } from "onairos-capacitor";
37
+ ## Vite Setup
25
38
 
26
- await initializeApiKey({
27
- apiKey: "YOUR_ONAIROS_KEY",
28
- environment: "production",
29
- platform: "capacitor-ios"
39
+ ```ts
40
+ // vite.config.ts
41
+ import path from 'node:path';
42
+ import { fileURLToPath } from 'node:url';
43
+ import { defineConfig } from 'vite';
44
+ import react from '@vitejs/plugin-react';
45
+
46
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
47
+ const appNodeModules = path.resolve(__dirname, 'node_modules');
48
+
49
+ export default defineConfig({
50
+ plugins: [react()],
51
+ resolve: {
52
+ dedupe: ['react', 'react-dom', 'react/jsx-runtime'],
53
+ alias: {
54
+ react: path.resolve(appNodeModules, 'react'),
55
+ 'react-dom': path.resolve(appNodeModules, 'react-dom'),
56
+ 'react/jsx-runtime': path.resolve(appNodeModules, 'react/jsx-runtime.js'),
57
+ },
58
+ },
59
+ optimizeDeps: {
60
+ include: ['react', 'react-dom', 'react/jsx-runtime'],
61
+ exclude: ['@onairosofficial/onairos-capacitor'],
62
+ },
30
63
  });
31
64
  ```
32
65
 
33
- See the [Onairos documentation](https://docs.onairos.io/) for the required iOS
34
- and Android native configuration.
66
+ When testing through a local `file:` link, the React dedupe block is important: it keeps the SDK and host app on the same React instance so hooks render correctly in WKWebView.
67
+
68
+ ## Capacitor Setup
69
+
70
+ ```bash
71
+ npm run build
72
+ npx cap sync ios
73
+ npx cap open ios
74
+ ```
75
+
76
+ Recommended iOS server scheme:
35
77
 
36
- ## Requirements
78
+ ```ts
79
+ // capacitor.config.ts
80
+ server: {
81
+ iosScheme: 'https',
82
+ }
83
+ ```
84
+
85
+ Register an app URL scheme for OAuth returns in `ios/App/App/Info.plist`, then pass the same scheme to the SDK as `returnLink`:
86
+
87
+ ```xml
88
+ <key>CFBundleURLTypes</key>
89
+ <array>
90
+ <dict>
91
+ <key>CFBundleTypeRole</key>
92
+ <string>Editor</string>
93
+ <key>CFBundleURLSchemes</key>
94
+ <array>
95
+ <string>myapp</string>
96
+ </array>
97
+ </dict>
98
+ </array>
99
+ ```
100
+
101
+ ```jsx
102
+ returnLink="myapp://oauth-callback"
103
+ ```
104
+
105
+ This is what brings users back from OAuth connectors like YouTube, TikTok, Pinterest, and Reddit into the UniversalOnboarding connector screen.
106
+
107
+ ## Google Sign-In
108
+
109
+ Capacitor apps must provide their own Google OAuth client IDs:
110
+
111
+ ```jsx
112
+ import { updateGoogleClientIds } from '@onairosofficial/onairos-capacitor';
113
+
114
+ updateGoogleClientIds({
115
+ webClientId: import.meta.env.VITE_ONAIROS_GOOGLE_WEB_CLIENT_ID,
116
+ iosClientId: import.meta.env.VITE_ONAIROS_GOOGLE_IOS_CLIENT_ID,
117
+ androidClientId: import.meta.env.VITE_ONAIROS_GOOGLE_ANDROID_CLIENT_ID,
118
+ serverClientId: import.meta.env.VITE_ONAIROS_GOOGLE_WEB_CLIENT_ID,
119
+ });
120
+ ```
37
121
 
38
- - Node.js 20–24
39
- - Capacitor 8
40
- - Onairos 8.4.8 or newer within major version 8
122
+ For iOS Google login, also add the reversed iOS client ID URL scheme that Google provides to `Info.plist`.
41
123
 
42
- ## License
124
+ ## Basic Usage
125
+
126
+ ```jsx
127
+ import { OnairosButton } from '@onairosofficial/onairos-capacitor';
128
+
129
+ export default function App() {
130
+ return (
131
+ <OnairosButton
132
+ webpageName="My Capacitor App"
133
+ requestData={['email', 'profile', 'preferences', 'personality']}
134
+ allowedPlatforms={null}
135
+ recommendedPlatforms={['Spotify', 'ChatGPT', 'YouTube', 'TikTok']}
136
+ apiKey={import.meta.env.VITE_ONAIROS_API_KEY}
137
+ returnLink="myapp://oauth-callback"
138
+ trainingScreenMode="fast"
139
+ onComplete={(result) => {
140
+ console.log('Onairos complete:', result);
141
+ }}
142
+ />
143
+ );
144
+ }
145
+ ```
146
+
147
+ ## Connectors Included
148
+
149
+ `ChatGPT`, `YouTube`, `LinkedIn`, `Pinterest`, `Reddit`, `Spotify`, and `TikTok`.
150
+
151
+ Temporarily paused behind `TEMP_DISABLED_CONNECTORS`: `Claude`, `Gemini`, `Grok`, `Perplexity`, `Sephora`, `InstagramData`, `Gmail`, `Hinge`, and `Netflix`. These implementations are still in the codebase and can be re-enabled once the mobile connector UX is ready.
152
+
153
+ Connector IDs are exported in `SUPPORTED_PLATFORMS`.
154
+
155
+ In native Capacitor builds, Spotify uses the React Native-style WKWebView scraping connector, not the web SDK Chromium hosted connector path. The SDK looks for `OnairosSpotifyNative.connectSpotifyNative()` and stores data through `/platform-data/store` as `mobile-spotify`. The local test plugin includes ChatGPT and Spotify native iOS implementations; Netflix remains in the native package as a clear stub but is temporarily hidden from the SDK picker.
156
+
157
+ Training uses the same backend pipeline as the web/RN SDK. `trainingScreenMode="fast"` shows the mobile-style loading screen and resolves when fast traits are ready; use `"real"` to wait for full model training or `"none"` with `backgroundLoadData` when the host app owns the loading state.
158
+
159
+ Use `requestData={['email', 'profile', 'preferences', 'personality']}` for the standard personalization/training flow. Add `rawMemories` only for apps approved for raw-memory export; otherwise raw-export connectors can be hidden by policy.
160
+
161
+ ## Publish
162
+
163
+ The package version is declared in `package.json`. Run the release checks before publishing:
164
+
165
+ ```bash
166
+ npm install
167
+ npm run build
168
+ npm run test:package
169
+ npm publish
170
+ ```
171
+
172
+ The package is currently prepared as `0.1.1`.
173
+
174
+ ## Local Test App
175
+
176
+ This repo includes `test-app`, a Vite + Capacitor app that links to this package by local file dependency:
177
+
178
+ ```bash
179
+ cd test-app
180
+ npm install
181
+ npm run ios:open
182
+ ```
183
+
184
+ `npm run ios:open` builds the Vite app, syncs Capacitor, and opens the iOS project in Xcode.
185
+
186
+ For local development, create `test-app/.env.local` with:
187
+
188
+ ```bash
189
+ VITE_ONAIROS_API_KEY=...
190
+ VITE_ONAIROS_GOOGLE_WEB_CLIENT_ID=...
191
+ VITE_ONAIROS_GOOGLE_IOS_CLIENT_ID=...
192
+ VITE_ONAIROS_GOOGLE_ANDROID_CLIENT_ID=...
193
+ ```
43
194
 
44
- Apache-2.0
195
+ `.env.local` and generated Capacitor web assets are intentionally ignored so secrets do not get committed.