@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.
- package/CAPACITOR_QUICK_START.md +379 -0
- package/CONNECTORS.md +122 -0
- package/LICENSE +194 -10
- package/OnairosofficialOnairosCapacitor.podspec +13 -0
- package/Package.swift +26 -0
- package/README.md +176 -25
- package/dist/onairos.capacitor.esm.js +1 -0
- package/dist/onairos.capacitor.esm.turbopack.js +1 -0
- package/docs/CAPACITOR_INTEGRATION_GUIDE.md +159 -0
- package/docs/CAPACITOR_MOCK_APP_TESTING.md +213 -0
- package/docs/CAPACITOR_SDK_FIXES_SUMMARY.md +65 -0
- package/docs/CROSS_SDK_PARITY.md +239 -0
- package/docs/DATA_FREQUENCY.md +57 -0
- package/docs/DEVELOPER_SDK_CHANGES.md +532 -0
- package/docs/INCIDENT_ENABLETRAINING_PIN_WEB_8.1.9.md +82 -0
- package/docs/ONAIROS_BUTTON_PROPS.md +152 -0
- package/docs/PLATFORM_APIS.md +559 -0
- package/docs/RAW_MEMORIES_API.md +305 -0
- package/docs/RAW_MEMORIES_SDK_UPDATE.md +54 -0
- package/docs/SDK_PARITY_ROLLUP_2026_04_24_to_05_02.md +96 -0
- package/docs/oldFixes.md +216 -0
- package/ios/Sources/OnairosNativeConnectorsPlugin/OnairosChatGPTNativePlugin.swift +993 -0
- package/ios/Sources/OnairosNativeConnectorsPlugin/OnairosNetflixNativePlugin.swift +33 -0
- package/ios/Sources/OnairosNativeConnectorsPlugin/OnairosSpotifyNativePlugin.swift +1082 -0
- package/onairos.d.ts +656 -0
- package/package.json +188 -37
- package/src/OnairosReconnectButton.jsx +272 -0
- package/src/RSA.jsx +57 -0
- package/src/assets/NewLogo.png +0 -0
- package/src/assets/OnairosNewLogo.png +0 -0
- package/src/assets/chatgpt-icon.png +0 -0
- package/src/assets/fire-horse.png +0 -0
- package/src/assets/fire-horse.transparent.png +0 -0
- package/src/assets/latest-firehorse.png +0 -0
- package/src/assets/perplexity.png +0 -0
- package/src/assets/persona.png +0 -0
- package/src/assets/persona1.png +0 -0
- package/src/assets/persona2.png +0 -0
- package/src/assets/persona3.png +0 -0
- package/src/assets/persona4.png +0 -0
- package/src/assets/persona5.png +0 -0
- package/src/capacitorConnectorCatalog.js +38 -0
- package/src/capacitorOAuthConfig.js +52 -0
- package/src/chatgptHostedImport/index.js +303 -0
- package/src/components/AuthButtons.jsx +48 -0
- package/src/components/ConnectChatGPTModal.jsx +666 -0
- package/src/components/ConnectClaudeModal.jsx +610 -0
- package/src/components/ConnectGeminiModal.jsx +639 -0
- package/src/components/ConnectGrokModal.jsx +701 -0
- package/src/components/ConnectPerplexityModal.jsx +726 -0
- package/src/components/DataExplainerScreen.jsx +349 -0
- package/src/components/DataRequest.js +885 -0
- package/src/components/DataRequest.jsx +1055 -0
- package/src/components/EmailAuth.js +1871 -0
- package/src/components/EmailAuth.jsx +2062 -0
- package/src/components/ExtensionInstallPrompt.jsx +142 -0
- package/src/components/GoogleButton.js +133 -0
- package/src/components/LLMConnectorManager.jsx +201 -0
- package/src/components/LoadingPage.jsx +19 -0
- package/src/components/LoadingScreen.jsx +81 -0
- package/src/components/LunarBirthdate.jsx +96 -0
- package/src/components/LunarLoadingPage.jsx +251 -0
- package/src/components/Notification.jsx +21 -0
- package/src/components/OnairosAppButton.jsx +85 -0
- package/src/components/OnairosSSO.jsx +645 -0
- package/src/components/OnairosTrigger.jsx +61 -0
- package/src/components/PerplexityLogo.jsx +43 -0
- package/src/components/PinSetup.js +200 -0
- package/src/components/PinSetup.jsx +228 -0
- package/src/components/SDK_PIN_INTEGRATION_REQUIRED_CHANGES.md +526 -0
- package/src/components/SdkErrorBoundary.jsx +36 -0
- package/src/components/SecuritySetup.js +81 -0
- package/src/components/SessionUserBar.jsx +83 -0
- package/src/components/SignUp.js +123 -0
- package/src/components/TestTelegramButton.js +53 -0
- package/src/components/TrainingComponent.jsx +200 -0
- package/src/components/TrainingScreen.jsx +897 -0
- package/src/components/UniversalOnboarding.js +306 -0
- package/src/components/UniversalOnboarding.jsx +4837 -0
- package/src/components/ValentineLoadingPage.jsx +502 -0
- package/src/components/ValentineModeSelector.jsx +162 -0
- package/src/components/WelcomeScreen.jsx +435 -0
- package/src/components/WrappedLoadingPage.jsx +205 -0
- package/src/components/connectors/ChatGPTConnector.js +348 -0
- package/src/components/connectors/ChatGPTConnector.jsx +348 -0
- package/src/components/connectors/ClaudeConnector.js +44 -0
- package/src/components/connectors/ClaudeConnector.jsx +44 -0
- package/src/components/connectors/GeminiConnector.js +170 -0
- package/src/components/connectors/GeminiConnector.jsx +170 -0
- package/src/components/connectors/GmailConnector.js +148 -0
- package/src/components/connectors/GmailConnector.jsx +148 -0
- package/src/components/connectors/GrokConnector.js +16 -0
- package/src/components/connectors/GrokConnector.jsx +16 -0
- package/src/components/connectors/HingeConnector.js +419 -0
- package/src/components/connectors/HingeConnector.jsx +419 -0
- package/src/components/connectors/InstagramDataConnector.js +726 -0
- package/src/components/connectors/InstagramDataConnector.jsx +726 -0
- package/src/components/connectors/LinkedInConnector.js +4 -0
- package/src/components/connectors/LinkedInConnector.jsx +296 -0
- package/src/components/connectors/PerplexityConnector.jsx +16 -0
- package/src/components/connectors/PinterestConnector.js +208 -0
- package/src/components/connectors/PinterestConnector.jsx +208 -0
- package/src/components/connectors/README.md +292 -0
- package/src/components/connectors/RedditConnector.js +229 -0
- package/src/components/connectors/RedditConnector.jsx +229 -0
- package/src/components/connectors/SephoraConnector.js +482 -0
- package/src/components/connectors/SephoraConnector.jsx +482 -0
- package/src/components/connectors/TikTokConnector.jsx +430 -0
- package/src/components/connectors/YoutubeConnector.js +361 -0
- package/src/components/connectors/YoutubeConnector.jsx +361 -0
- package/src/components/connectors/index.js +50 -0
- package/src/components/icons.jsx +46 -0
- package/src/components/icons.tsx +21 -0
- package/src/components/ui/PageLayout.jsx +1255 -0
- package/src/components/ui/PrimaryButton.jsx +162 -0
- package/src/components/ui/button.jsx +49 -0
- package/src/components/ui/card.jsx +61 -0
- package/src/components/ui/checkbox.jsx +33 -0
- package/src/components/ui/label.jsx +29 -0
- package/src/components/utils/UpdateConnections.js +45 -0
- package/src/components/utils/oauthHelper.js +97 -0
- package/src/config/api-config.js +138 -0
- package/src/deepLink.jsx +38 -0
- package/src/getPin.js +26 -0
- package/src/icons/Avatar.png +0 -0
- package/src/icons/Sentiment.png +0 -0
- package/src/icons/Trait.png +0 -0
- package/src/iframe/DataRequestPage.jsx +285 -0
- package/src/iframe/OnairosButtonIntegration.md +148 -0
- package/src/iframe/components/Box.jsx +56 -0
- package/src/iframe/components/IndividualConnection.jsx +88 -0
- package/src/iframe/dataRequestHandler.js +714 -0
- package/src/iframe/data_request_iframe.html +27 -0
- package/src/iframe/data_request_page.js +47 -0
- package/src/iframe/icons/Avatar.png +1 -0
- package/src/iframe/icons/Avatar2.png +1 -0
- package/src/iframe/icons/Sentiment.png +1 -0
- package/src/iframe/icons/Trait.png +1 -0
- package/src/iframe/icons/onairos_logo.png +0 -0
- package/src/iframe/utils/api.js +57 -0
- package/src/index.js +274 -0
- package/src/laravel/OnairosVue.vue +410 -0
- package/src/laravel/blade-helpers.js +320 -0
- package/src/laravel/vite-plugin.js +179 -0
- package/src/mobile/MobileDataRequestPage.jsx +233 -0
- package/src/mobile/components/MobileBox.jsx +71 -0
- package/src/mobile/components/MobileIndividualConnection.jsx +51 -0
- package/src/mobile/shims/browser-apis.js +78 -0
- package/src/mobile/shims/lucide-shim.js +85 -0
- package/src/nativeConnectors.js +5 -0
- package/src/newUI/EMAIL_VERIFICATION_API_SCHEMA.md +268 -0
- package/src/newUI/PlatformConnectorsStep.tsx +435 -0
- package/src/newUI/PrimaryButton.tsx +213 -0
- package/src/newUI/SignInStep.tsx +194 -0
- package/src/newUI/VerificationStep.tsx +133 -0
- package/src/newUI/WelcomeScreen.tsx +311 -0
- package/src/newUI/services/connectedAccountsService.js +129 -0
- package/src/onairos.capacitor.jsx +15 -0
- package/src/onairos.core.jsx +133 -0
- package/src/onairos.jsx +14 -0
- package/src/onairos.native.jsx +15 -0
- package/src/onairosButton.jsx +9000 -0
- package/src/overlay/CheckBox.jsx +114 -0
- package/src/overlay/IndividualConnection copy.js +86 -0
- package/src/overlay/IndividualConnection.js +191 -0
- package/src/overlay/IndividualConnectionNew.jsx +157 -0
- package/src/overlay/box.js +84 -0
- package/src/overlay/overlay.js +437 -0
- package/src/styles/onairos-scoped-preflight.css +97 -0
- package/src/styles/sdkCssRegistry.js +20 -0
- package/src/styles/styleLoaderInsertShadow.js +69 -0
- package/src/styles/tailwind.capacitor.css +395 -0
- package/src/styles/tailwind.css +395 -0
- package/src/theme/colors.js +40 -0
- package/src/utils/apiKeyValidation.js +341 -0
- package/src/utils/apiResponseLogger.js +316 -0
- package/src/utils/authHeaders.js +275 -0
- package/src/utils/biometrics.js +26 -0
- package/src/utils/bookmarkletUtils.js +28 -0
- package/src/utils/capacitorDetection.js +278 -0
- package/src/utils/capacitorLLMHelper.js +352 -0
- package/src/utils/capacitorPlugins.js +366 -0
- package/src/utils/crossDomainSSO.js +587 -0
- package/src/utils/deepLinking.js +27 -0
- package/src/utils/devLogger.js +46 -0
- package/src/utils/extensionDetection.js +418 -0
- package/src/utils/extractMemory.js +277 -0
- package/src/utils/framerBrandingOverrides.js +40 -0
- package/src/utils/googleWebClientId.js +55 -0
- package/src/utils/overlayHandler.js +224 -0
- package/src/utils/platformDisconnect.js +309 -0
- package/src/utils/pollTrainingStatus.js +200 -0
- package/src/utils/rawMemoriesAccess.js +211 -0
- package/src/utils/resolveBackendAppId.js +47 -0
- package/src/utils/responseFormatter.js +140 -0
- package/src/utils/sdkDebugStorage.js +113 -0
- package/src/utils/sdkInitialization.js +645 -0
- package/src/utils/sessionManager.js +1258 -0
- package/src/utils/startBackgroundTraining.js +100 -0
- package/src/utils/userDataFormatter.js +222 -0
- package/index.d.ts +0 -1
- package/index.js +0 -1
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
# Capacitor Quick Start Guide
|
|
2
|
+
|
|
3
|
+
## TL;DR - What You Need to Know
|
|
4
|
+
|
|
5
|
+
### ✅ **Core SDK works on iOS/Android via Capacitor**
|
|
6
|
+
|
|
7
|
+
The Onairos npm package works with React + Vite + Capacitor with **zero code changes** for core SDK flows (email auth, onboarding, data request).
|
|
8
|
+
|
|
9
|
+
**Note on Google login / Google-backed OAuth (YouTube/Gmail):**
|
|
10
|
+
- Embedded Google widgets can be blocked or fail to render in iOS WKWebView origins like `capacitor://localhost`.
|
|
11
|
+
- For the best experience, run your iOS WebView on `https://localhost` (`iosScheme: "https"`) and install `@capacitor/browser` so the SDK can open a secure browser when required by Google policy.
|
|
12
|
+
|
|
13
|
+
### 🆕 **NEW: LLM Data Collection Without Browser Extension**
|
|
14
|
+
|
|
15
|
+
Capacitor apps can now collect LLM conversation data using the native API method - no browser extension required!
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Quick Setup (5 minutes)
|
|
20
|
+
|
|
21
|
+
### 1. Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install onairos
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. Configure Vite
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// vite.config.ts
|
|
31
|
+
export default defineConfig({
|
|
32
|
+
optimizeDeps: {
|
|
33
|
+
exclude: ['onairos']
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 3. Use OnairosButton (Same as Web!)
|
|
39
|
+
|
|
40
|
+
```jsx
|
|
41
|
+
import { OnairosButton } from 'onairos';
|
|
42
|
+
|
|
43
|
+
function App() {
|
|
44
|
+
return (
|
|
45
|
+
<OnairosButton
|
|
46
|
+
requestData={["email", "profile"]}
|
|
47
|
+
webpageName="My iOS App"
|
|
48
|
+
onComplete={(result) => {
|
|
49
|
+
if (result.apiResponse) {
|
|
50
|
+
console.log('User data:', result.apiResponse);
|
|
51
|
+
}
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
That's it! You're done. 🎉
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## LLM Data Collection (NEW!)
|
|
63
|
+
|
|
64
|
+
### What's Changed?
|
|
65
|
+
|
|
66
|
+
**Before:** Browser extension required (didn't work in Capacitor)
|
|
67
|
+
**Now:** Direct API method available for Capacitor/mobile apps
|
|
68
|
+
|
|
69
|
+
### How to Use
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
import {
|
|
73
|
+
OnairosButton,
|
|
74
|
+
storeCapacitorLLMData,
|
|
75
|
+
isCapacitor
|
|
76
|
+
} from 'onairos';
|
|
77
|
+
|
|
78
|
+
function App() {
|
|
79
|
+
const [userInfo, setUserInfo] = useState(null);
|
|
80
|
+
|
|
81
|
+
// 1. Get user info from Onairos
|
|
82
|
+
const handleComplete = (result) => {
|
|
83
|
+
if (result.apiResponse) {
|
|
84
|
+
setUserInfo({
|
|
85
|
+
username: result.apiResponse.email,
|
|
86
|
+
userId: result.apiResponse.userId,
|
|
87
|
+
sessionToken: result.apiResponse.token
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// 2. Collect LLM conversation data
|
|
93
|
+
const collectLLMData = async (messages) => {
|
|
94
|
+
const result = await storeCapacitorLLMData(
|
|
95
|
+
{
|
|
96
|
+
messages: messages,
|
|
97
|
+
timestamp: new Date().toISOString()
|
|
98
|
+
},
|
|
99
|
+
userInfo,
|
|
100
|
+
'chatgpt' // or 'claude', 'gemini', 'grok'
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
if (result.success) {
|
|
104
|
+
console.log('✅ LLM data stored!');
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<div>
|
|
110
|
+
<OnairosButton
|
|
111
|
+
requestData={["email", "profile"]}
|
|
112
|
+
webpageName="My App"
|
|
113
|
+
onComplete={handleComplete}
|
|
114
|
+
/>
|
|
115
|
+
|
|
116
|
+
{userInfo && (
|
|
117
|
+
<button onClick={() => {
|
|
118
|
+
collectLLMData([
|
|
119
|
+
{ role: 'user', content: 'Hello' },
|
|
120
|
+
{ role: 'assistant', content: 'Hi!' }
|
|
121
|
+
]);
|
|
122
|
+
}}>
|
|
123
|
+
Store LLM Conversation
|
|
124
|
+
</button>
|
|
125
|
+
)}
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Available Functions
|
|
132
|
+
|
|
133
|
+
```jsx
|
|
134
|
+
import {
|
|
135
|
+
// Platform detection
|
|
136
|
+
isCapacitor,
|
|
137
|
+
isMobileApp,
|
|
138
|
+
getPlatformInfo,
|
|
139
|
+
|
|
140
|
+
// LLM data collection
|
|
141
|
+
storeCapacitorLLMData, // Store single conversation
|
|
142
|
+
storeBatchLLMData, // Store multiple conversations
|
|
143
|
+
getLLMHistory, // Retrieve history
|
|
144
|
+
getLLMStats, // Get usage stats
|
|
145
|
+
formatConversationData // Helper to format data
|
|
146
|
+
} from 'onairos';
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## What Works & What Doesn't
|
|
152
|
+
|
|
153
|
+
### ✅ Works Perfectly (No Changes Needed)
|
|
154
|
+
|
|
155
|
+
- All React components
|
|
156
|
+
- Data requests (email, profile, social, etc.)
|
|
157
|
+
- API calls and authentication
|
|
158
|
+
- OAuth flows (auto-converts popups to redirects)
|
|
159
|
+
- Touch interactions
|
|
160
|
+
- **NEW:** LLM data collection via native method
|
|
161
|
+
|
|
162
|
+
### ❌ Not Available in Capacitor
|
|
163
|
+
|
|
164
|
+
- Browser extension (web-only feature)
|
|
165
|
+
- Browser extension LLM monitoring (use native method instead)
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Changes Required
|
|
170
|
+
|
|
171
|
+
### For Core Functionality: **ZERO**
|
|
172
|
+
|
|
173
|
+
The same code works on web and Capacitor:
|
|
174
|
+
|
|
175
|
+
```jsx
|
|
176
|
+
// This exact code works on web AND Capacitor
|
|
177
|
+
<OnairosButton
|
|
178
|
+
requestData={["email", "profile"]}
|
|
179
|
+
webpageName="My App"
|
|
180
|
+
onComplete={(result) => console.log(result)}
|
|
181
|
+
/>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### For LLM Data Collection: **Add One Function Call**
|
|
185
|
+
|
|
186
|
+
Instead of relying on browser extension (doesn't work in Capacitor), use the native method:
|
|
187
|
+
|
|
188
|
+
```jsx
|
|
189
|
+
// Import the Capacitor-specific LLM function
|
|
190
|
+
import { storeCapacitorLLMData } from 'onairos';
|
|
191
|
+
|
|
192
|
+
// Use it to store LLM data
|
|
193
|
+
await storeCapacitorLLMData(conversationData, userInfo, platform);
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
That's the only change needed!
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Example: Full Capacitor App with LLM
|
|
201
|
+
|
|
202
|
+
```jsx
|
|
203
|
+
import React, { useState, useEffect } from 'react';
|
|
204
|
+
import {
|
|
205
|
+
OnairosButton,
|
|
206
|
+
storeCapacitorLLMData,
|
|
207
|
+
isCapacitor,
|
|
208
|
+
getPlatformInfo
|
|
209
|
+
} from 'onairos';
|
|
210
|
+
|
|
211
|
+
function MyCapacitorApp() {
|
|
212
|
+
const [userInfo, setUserInfo] = useState(null);
|
|
213
|
+
const [platform, setPlatform] = useState(null);
|
|
214
|
+
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
// Check platform
|
|
217
|
+
const info = getPlatformInfo();
|
|
218
|
+
setPlatform(info);
|
|
219
|
+
|
|
220
|
+
if (isCapacitor()) {
|
|
221
|
+
console.log('✅ Running in Capacitor on', info.platform);
|
|
222
|
+
}
|
|
223
|
+
}, []);
|
|
224
|
+
|
|
225
|
+
const handleOnairosComplete = (result) => {
|
|
226
|
+
if (result.apiResponse) {
|
|
227
|
+
// Save user info for later use
|
|
228
|
+
const user = {
|
|
229
|
+
username: result.apiResponse.email,
|
|
230
|
+
userId: result.apiResponse.userId,
|
|
231
|
+
sessionToken: result.apiResponse.token
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
setUserInfo(user);
|
|
235
|
+
localStorage.setItem('userInfo', JSON.stringify(user));
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const storeChatConversation = async (messages, llmPlatform) => {
|
|
240
|
+
if (!userInfo) {
|
|
241
|
+
alert('Please connect with Onairos first');
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const result = await storeCapacitorLLMData(
|
|
246
|
+
{
|
|
247
|
+
messages: messages,
|
|
248
|
+
timestamp: new Date().toISOString()
|
|
249
|
+
},
|
|
250
|
+
userInfo,
|
|
251
|
+
llmPlatform
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
if (result.success) {
|
|
255
|
+
alert('✅ Conversation saved!');
|
|
256
|
+
} else {
|
|
257
|
+
alert('❌ Error: ' + result.error);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<div className="app">
|
|
263
|
+
<h1>My Capacitor App</h1>
|
|
264
|
+
|
|
265
|
+
{platform && (
|
|
266
|
+
<p>Platform: {platform.platform} | Capacitor: {platform.isCapacitor ? 'Yes' : 'No'}</p>
|
|
267
|
+
)}
|
|
268
|
+
|
|
269
|
+
<OnairosButton
|
|
270
|
+
requestData={["email", "profile", "social"]}
|
|
271
|
+
webpageName="My Capacitor App"
|
|
272
|
+
autoFetch={true}
|
|
273
|
+
onComplete={handleOnairosComplete}
|
|
274
|
+
/>
|
|
275
|
+
|
|
276
|
+
{userInfo && (
|
|
277
|
+
<div className="llm-section">
|
|
278
|
+
<h2>LLM Data Collection</h2>
|
|
279
|
+
<p>✅ Connected as: {userInfo.username}</p>
|
|
280
|
+
|
|
281
|
+
<button onClick={() => {
|
|
282
|
+
storeChatConversation([
|
|
283
|
+
{ role: 'user', content: 'What is AI?' },
|
|
284
|
+
{ role: 'assistant', content: 'AI is artificial intelligence...' }
|
|
285
|
+
], 'chatgpt');
|
|
286
|
+
}}>
|
|
287
|
+
Save ChatGPT Conversation
|
|
288
|
+
</button>
|
|
289
|
+
|
|
290
|
+
<button onClick={() => {
|
|
291
|
+
storeChatConversation([
|
|
292
|
+
{ role: 'user', content: 'Hello Claude' },
|
|
293
|
+
{ role: 'assistant', content: 'Hello! How can I help?' }
|
|
294
|
+
], 'claude');
|
|
295
|
+
}}>
|
|
296
|
+
Save Claude Conversation
|
|
297
|
+
</button>
|
|
298
|
+
</div>
|
|
299
|
+
)}
|
|
300
|
+
</div>
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export default MyCapacitorApp;
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## iOS Configuration
|
|
310
|
+
|
|
311
|
+
Add to `ios/App/App/Info.plist`:
|
|
312
|
+
|
|
313
|
+
```xml
|
|
314
|
+
<key>NSAppTransportSecurity</key>
|
|
315
|
+
<dict>
|
|
316
|
+
<key>NSAllowsArbitraryLoads</key>
|
|
317
|
+
<true/>
|
|
318
|
+
</dict>
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## Testing
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# iOS
|
|
327
|
+
npm run build
|
|
328
|
+
npx cap sync ios
|
|
329
|
+
npx cap open ios
|
|
330
|
+
|
|
331
|
+
# Android
|
|
332
|
+
npm run build
|
|
333
|
+
npx cap sync android
|
|
334
|
+
npx cap open android
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Common Questions
|
|
340
|
+
|
|
341
|
+
### Q: Do I need to change my code for Capacitor?
|
|
342
|
+
**A:** No, for core functionality. Only add `storeCapacitorLLMData` if you want LLM data collection.
|
|
343
|
+
|
|
344
|
+
### Q: Does the browser extension work in Capacitor?
|
|
345
|
+
**A:** No, but you don't need it. Use `storeCapacitorLLMData` instead for LLM data.
|
|
346
|
+
|
|
347
|
+
### Q: Can I use the same code on web and Capacitor?
|
|
348
|
+
**A:** Yes! The package automatically detects the environment and adapts.
|
|
349
|
+
|
|
350
|
+
### Q: How do I collect ChatGPT/Claude conversations?
|
|
351
|
+
**A:** Use `storeCapacitorLLMData` - see examples above.
|
|
352
|
+
|
|
353
|
+
### Q: What about OAuth popups?
|
|
354
|
+
**A:** Automatically converted to redirects on mobile. No code changes needed.
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## What Your Developer Needs to Do
|
|
359
|
+
|
|
360
|
+
1. ✅ Install `onairos` via npm
|
|
361
|
+
2. ✅ Add Vite config (`exclude: ['onairos']`)
|
|
362
|
+
3. ✅ Use `OnairosButton` component (same as web)
|
|
363
|
+
4. ✅ **Optional:** Import `storeCapacitorLLMData` for LLM data collection
|
|
364
|
+
|
|
365
|
+
**Total changes:** ~5 lines of config + normal component usage
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## More Help
|
|
370
|
+
|
|
371
|
+
- **Full Guide:** [CAPACITOR_IOS_INTEGRATION.md](./CAPACITOR_IOS_INTEGRATION.md)
|
|
372
|
+
- **Mobile Compatibility:** [MOBILE_BROWSER_COMPATIBILITY.md](./MOBILE_BROWSER_COMPATIBILITY.md)
|
|
373
|
+
- **Main README:** [README.md](./README.md)
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
**Bottom Line:** Everything works. LLM data collection now available via native method. Your developer is good to go! 🚀
|
|
378
|
+
|
|
379
|
+
|
package/CONNECTORS.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Onairos Connectors Reference
|
|
2
|
+
|
|
3
|
+
## Available Connectors
|
|
4
|
+
|
|
5
|
+
| Connector | Type | ID | Description |
|
|
6
|
+
|-----------|------|-----|-------------|
|
|
7
|
+
| **ChatGPT** | LLM | `chatgpt` | OpenAI ChatGPT conversations |
|
|
8
|
+
| **Claude** | LLM | `claude` | Anthropic Claude conversations |
|
|
9
|
+
| **Gemini** | LLM | `gemini` | Google Gemini conversations |
|
|
10
|
+
| **Grok** | LLM | `grok` | X/Twitter Grok conversations |
|
|
11
|
+
| **YouTube** | OAuth | `youtube` | Watch history & subscriptions |
|
|
12
|
+
| **Gmail** | OAuth | `gmail` | Email metadata & patterns |
|
|
13
|
+
| **LinkedIn** | OAuth | `linkedin` | Professional profile & connections |
|
|
14
|
+
| **Pinterest** | OAuth | `pinterest` | Pins & boards |
|
|
15
|
+
| **Reddit** | OAuth | `reddit` | Posts, comments & subscriptions |
|
|
16
|
+
| **Instagram** | Data | `instagram-data` | Profile & interactions |
|
|
17
|
+
| **X (Twitter)** | OAuth | `x` | Posts & interactions |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### Show All Connectors (Default)
|
|
24
|
+
```jsx
|
|
25
|
+
<OnairosButton webpageName="MyApp" />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Show Only LLM Connectors
|
|
29
|
+
```jsx
|
|
30
|
+
<OnairosButton
|
|
31
|
+
webpageName="MyApp"
|
|
32
|
+
rawMemoriesOnly={true}
|
|
33
|
+
/>
|
|
34
|
+
// Shows: ChatGPT, Claude, Gemini, Grok
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Show Specific Connectors
|
|
38
|
+
```jsx
|
|
39
|
+
<OnairosButton
|
|
40
|
+
webpageName="MyApp"
|
|
41
|
+
allowedPlatforms={['ChatGPT', 'YouTube', 'Gmail']}
|
|
42
|
+
/>
|
|
43
|
+
// Shows only: ChatGPT, YouTube, Gmail
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Prioritize a Connector
|
|
47
|
+
```jsx
|
|
48
|
+
<OnairosButton
|
|
49
|
+
webpageName="MyApp"
|
|
50
|
+
priorityPlatform="gmail"
|
|
51
|
+
/>
|
|
52
|
+
// Shows all, but Gmail is highlighted first
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Props Reference
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Default | Description |
|
|
60
|
+
|------|------|---------|-------------|
|
|
61
|
+
| `allowedPlatforms` | `string[]` | `null` | List of connector names/IDs to show. `null` = all |
|
|
62
|
+
| `rawMemoriesOnly` | `boolean` | `false` | Show only LLM connectors |
|
|
63
|
+
| `priorityPlatform` | `string` | `null` | Connector to highlight/prioritize |
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Examples
|
|
68
|
+
|
|
69
|
+
### Social Media App
|
|
70
|
+
```jsx
|
|
71
|
+
<OnairosButton
|
|
72
|
+
webpageName="SocialApp"
|
|
73
|
+
allowedPlatforms={['Instagram', 'YouTube', 'X']}
|
|
74
|
+
/>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### AI/Chat App
|
|
78
|
+
```jsx
|
|
79
|
+
<OnairosButton
|
|
80
|
+
webpageName="AIApp"
|
|
81
|
+
rawMemoriesOnly={true}
|
|
82
|
+
/>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Professional App
|
|
86
|
+
```jsx
|
|
87
|
+
<OnairosButton
|
|
88
|
+
webpageName="ProApp"
|
|
89
|
+
allowedPlatforms={['LinkedIn', 'Gmail']}
|
|
90
|
+
priorityPlatform="linkedin"
|
|
91
|
+
/>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Shopping/Lifestyle App
|
|
95
|
+
```jsx
|
|
96
|
+
<OnairosButton
|
|
97
|
+
webpageName="LifestyleApp"
|
|
98
|
+
allowedPlatforms={['Pinterest', 'Instagram', 'YouTube']}
|
|
99
|
+
/>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Connector IDs (for allowedPlatforms)
|
|
105
|
+
|
|
106
|
+
Use any of these values in the `allowedPlatforms` array:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
chatgpt, claude, gemini, grok,
|
|
110
|
+
youtube, gmail, linkedin, pinterest,
|
|
111
|
+
reddit, instagram, x
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Note:** Both the display name (`ChatGPT`) and connector ID (`chatgpt`) work.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Need Help?
|
|
119
|
+
|
|
120
|
+
- Documentation: https://docs.onairos.uk
|
|
121
|
+
- Support: support@onairos.uk
|
|
122
|
+
|