@onairos/react-native 3.6.8 โ 3.6.9
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/README.md +423 -423
- package/lib/commonjs/api/index.js +1 -1
- package/lib/commonjs/assets/images/Checkbox.svg +3 -3
- package/lib/commonjs/assets/images/EnochE.svg +19 -19
- package/lib/commonjs/assets/images/Personalityprofile.svg +3 -3
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -3
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -3
- package/lib/commonjs/assets/images/arrow.svg +20 -20
- package/lib/commonjs/assets/images/basicproficon.svg +43 -43
- package/lib/commonjs/assets/images/basicprofile.svg +3 -3
- package/lib/commonjs/assets/images/checkmark.svg +4 -4
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -3
- package/lib/commonjs/assets/images/contenticon.svg +23 -23
- package/lib/commonjs/assets/images/personalityicon.svg +18 -18
- package/lib/commonjs/assets/images/x-close.svg +3 -3
- package/lib/commonjs/components/BodyText.js +1 -1
- package/lib/commonjs/components/BrandMark.js +1 -1
- package/lib/commonjs/components/CodeInput.js +1 -1
- package/lib/commonjs/components/EmailInput.js +1 -1
- package/lib/commonjs/components/GoogleButton.js +1 -1
- package/lib/commonjs/components/HeadingGroup.js +1 -1
- package/lib/commonjs/components/LLMDataInputModal.js +1 -1
- package/lib/commonjs/components/ModalHeader.js +1 -1
- package/lib/commonjs/components/ModalSheet.js +1 -1
- package/lib/commonjs/components/Onairos.js +1 -1
- package/lib/commonjs/components/OnairosButton.js +1 -1
- package/lib/commonjs/components/OnairosSignInButton.js +1 -1
- package/lib/commonjs/components/Overlay.js +1 -1
- package/lib/commonjs/components/PersonaImage.js +1 -1
- package/lib/commonjs/components/PersonaLoadingScreen.js +1 -1
- package/lib/commonjs/components/PersonalizationConsentScreen.js +1 -1
- package/lib/commonjs/components/PinCreationScreen.js +1 -1
- package/lib/commonjs/components/PinInput.js +1 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +1 -1
- package/lib/commonjs/components/PlatformList.js +1 -1
- package/lib/commonjs/components/PlatformToggle.js +1 -1
- package/lib/commonjs/components/PrimaryButton.js +1 -1
- package/lib/commonjs/components/SignInMatchAnimation.js +1 -1
- package/lib/commonjs/components/SignInStep.js +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +1 -1
- package/lib/commonjs/components/VerificationStep.js +1 -1
- package/lib/commonjs/components/WelcomeScreen.js +1 -1
- package/lib/commonjs/components/icons/Basicproficon.js +1 -1
- package/lib/commonjs/components/icons/Basicprofile.js +1 -1
- package/lib/commonjs/components/icons/Checkbox.js +1 -1
- package/lib/commonjs/components/icons/Checkmark.js +1 -1
- package/lib/commonjs/components/icons/Contentanalysis.js +1 -1
- package/lib/commonjs/components/icons/Contenticon.js +1 -1
- package/lib/commonjs/components/icons/EnochE.js +1 -1
- package/lib/commonjs/components/icons/Personalityicon.js +1 -1
- package/lib/commonjs/components/icons/Personalityprofile.js +1 -1
- package/lib/commonjs/components/icons/Personalitytraits.js +1 -1
- package/lib/commonjs/components/icons/Userpreferences.js +1 -1
- package/lib/commonjs/components/icons/index.js +1 -1
- package/lib/commonjs/components/onboarding/OAuthWebView.js +1 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +1 -1
- package/lib/commonjs/components/onboarding/PinInput.js +1 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js +1 -1
- package/lib/commonjs/config/PLATFORM_APIS.md +559 -0
- package/lib/commonjs/config/api.js +1 -1
- package/lib/commonjs/config/telegramConfig.js +8 -0
- package/lib/commonjs/config/webchangelog/md +607 -0
- package/lib/commonjs/constants/index.js +1 -1
- package/lib/commonjs/context/AuthContext.js +1 -1
- package/lib/commonjs/hooks/useConnectedAccounts.js +1 -1
- package/lib/commonjs/hooks/useConnections.js +1 -1
- package/lib/commonjs/hooks/useCredentials.js +1 -1
- package/lib/commonjs/hooks/useUserConnections.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +421 -421
- package/lib/commonjs/services/apiClient.js +1 -1
- package/lib/commonjs/services/apiKeyService.js +99 -99
- package/lib/commonjs/services/authService.js +72 -72
- package/lib/commonjs/services/biometricPinService.js +1 -1
- package/lib/commonjs/services/chatGPTConversationExtractor.js +1 -1
- package/lib/commonjs/services/chatGPTConversationService.js +1 -1
- package/lib/commonjs/services/claudeConversationExtractor.js +1 -1
- package/lib/commonjs/services/claudeConversationService.js +1 -1
- package/lib/commonjs/services/connectedAccountsService.js +1 -1
- package/lib/commonjs/services/googleAuthService.js +1 -1
- package/lib/commonjs/services/hingeDataExtractor.js +1 -1
- package/lib/commonjs/services/hingeDataService.js +1 -1
- package/lib/commonjs/services/imageCompressionService.js +1 -1
- package/lib/commonjs/services/instagramDataExtractor.js +1 -1
- package/lib/commonjs/services/instagramDataService.js +1 -1
- package/lib/commonjs/services/jwtStorageService.js +1 -1
- package/lib/commonjs/services/linkedinDOMExtractor.js +1 -1
- package/lib/commonjs/services/linkedinProfileService.js +1 -1
- package/lib/commonjs/services/linkedinScrapingService.js +1 -1
- package/lib/commonjs/services/llmDataStorage.js +1 -1
- package/lib/commonjs/services/mobileTrainingService.js +1 -1
- package/lib/commonjs/services/oauthService.js +20 -20
- package/lib/commonjs/services/pinEncryptionService.js +1 -1
- package/lib/commonjs/services/pinStorageUtils.js +1 -1
- package/lib/commonjs/services/platformAuthService.js +1 -1
- package/lib/commonjs/services/sephoraDataExtractor.js +1 -1
- package/lib/commonjs/services/sephoraDataService.js +1 -1
- package/lib/commonjs/services/storageService.js +1 -1
- package/lib/commonjs/services/telegramDataExtractor.js +1 -1
- package/lib/commonjs/services/telegramDataService.js +1 -1
- package/lib/commonjs/services/trainingApiHelpers.js +1 -1
- package/lib/commonjs/services/userConnectionsService.js +1 -1
- package/lib/commonjs/services/youtubeMigrationService.js +1 -1
- package/lib/commonjs/theme/index.js +1 -1
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types.js +1 -1
- package/lib/commonjs/utils/Portal.js +1 -1
- package/lib/commonjs/utils/api.js +1 -1
- package/lib/commonjs/utils/assetRegistry.js +1 -1
- package/lib/commonjs/utils/auth.js +1 -1
- package/lib/commonjs/utils/connectorTests.js +1 -1
- package/lib/commonjs/utils/crypto.js +1 -1
- package/lib/commonjs/utils/debugHelper.js +1 -1
- package/lib/commonjs/utils/encryption.js +1 -1
- package/lib/commonjs/utils/eventUtils.js +1 -1
- package/lib/commonjs/utils/haptics.js +1 -1
- package/lib/commonjs/utils/imagePreloader.js +1 -1
- package/lib/commonjs/utils/networkDiagnostics.js +1 -1
- package/lib/commonjs/utils/onairosApi.js +1 -1
- package/lib/commonjs/utils/programmaticFlow.js +1 -1
- package/lib/commonjs/utils/retryHelper.js +1 -1
- package/lib/commonjs/utils/secureStorage.js +1 -1
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -1
- package/lib/commonjs/utils/webviewScripts/claude.js +1 -1
- package/lib/commonjs/utils/webviewScripts/hinge.js +1 -1
- package/lib/commonjs/utils/webviewScripts/index.js +1 -1
- package/lib/commonjs/utils/webviewScripts/instagram.js +1 -1
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -1
- package/lib/commonjs/utils/webviewScripts/sephora.js +1 -1
- package/lib/commonjs/utils/webviewScripts/telegram.js +1 -1
- package/lib/module/api/index.js +1 -1
- package/lib/module/assets/images/Checkbox.svg +3 -3
- package/lib/module/assets/images/EnochE.svg +19 -19
- package/lib/module/assets/images/Personalityprofile.svg +3 -3
- package/lib/module/assets/images/Personalitytraits.svg +3 -3
- package/lib/module/assets/images/Userpreferences.svg +3 -3
- package/lib/module/assets/images/arrow.svg +20 -20
- package/lib/module/assets/images/basicproficon.svg +43 -43
- package/lib/module/assets/images/basicprofile.svg +3 -3
- package/lib/module/assets/images/checkmark.svg +4 -4
- package/lib/module/assets/images/contentanalysis.svg +3 -3
- package/lib/module/assets/images/contenticon.svg +23 -23
- package/lib/module/assets/images/personalityicon.svg +18 -18
- package/lib/module/assets/images/x-close.svg +3 -3
- package/lib/module/components/BodyText.js +1 -1
- package/lib/module/components/BrandMark.js +1 -1
- package/lib/module/components/CodeInput.js +1 -1
- package/lib/module/components/EmailInput.js +1 -1
- package/lib/module/components/GoogleButton.js +1 -1
- package/lib/module/components/HeadingGroup.js +1 -1
- package/lib/module/components/LLMDataInputModal.js +1 -1
- package/lib/module/components/ModalHeader.js +1 -1
- package/lib/module/components/ModalSheet.js +1 -1
- package/lib/module/components/Onairos.js +1 -1
- package/lib/module/components/OnairosButton.js +1 -1
- package/lib/module/components/OnairosSignInButton.js +1 -1
- package/lib/module/components/Overlay.js +1 -1
- package/lib/module/components/PersonaImage.js +1 -1
- package/lib/module/components/PersonaLoadingScreen.js +1 -1
- package/lib/module/components/PersonalizationConsentScreen.js +1 -1
- package/lib/module/components/PinCreationScreen.js +1 -1
- package/lib/module/components/PinInput.js +1 -1
- package/lib/module/components/PlatformConnectorsStep.js +1 -1
- package/lib/module/components/PlatformList.js +1 -1
- package/lib/module/components/PlatformToggle.js +1 -1
- package/lib/module/components/PrimaryButton.js +1 -1
- package/lib/module/components/SignInMatchAnimation.js +1 -1
- package/lib/module/components/SignInStep.js +1 -1
- package/lib/module/components/UniversalOnboarding.js +1 -1
- package/lib/module/components/VerificationStep.js +1 -1
- package/lib/module/components/WelcomeScreen.js +1 -1
- package/lib/module/components/icons/Basicproficon.js +1 -1
- package/lib/module/components/icons/Basicprofile.js +1 -1
- package/lib/module/components/icons/Checkbox.js +1 -1
- package/lib/module/components/icons/Checkmark.js +1 -1
- package/lib/module/components/icons/Contentanalysis.js +1 -1
- package/lib/module/components/icons/Contenticon.js +1 -1
- package/lib/module/components/icons/EnochE.js +1 -1
- package/lib/module/components/icons/Personalityicon.js +1 -1
- package/lib/module/components/icons/Personalityprofile.js +1 -1
- package/lib/module/components/icons/Personalitytraits.js +1 -1
- package/lib/module/components/icons/Userpreferences.js +1 -1
- package/lib/module/components/onboarding/OAuthWebView.js +1 -1
- package/lib/module/components/onboarding/OnboardingHeader.js +1 -1
- package/lib/module/components/onboarding/PinInput.js +1 -1
- package/lib/module/components/onboarding/PlatformConnector.js +1 -1
- package/lib/module/config/PLATFORM_APIS.md +559 -0
- package/lib/module/config/api.js +1 -1
- package/lib/module/config/telegramConfig.js +8 -0
- package/lib/module/config/webchangelog/md +607 -0
- package/lib/module/constants/index.js +1 -1
- package/lib/module/context/AuthContext.js +1 -1
- package/lib/module/hooks/useConnectedAccounts.js +1 -1
- package/lib/module/hooks/useConnections.js +1 -1
- package/lib/module/hooks/useCredentials.js +1 -1
- package/lib/module/hooks/useUserConnections.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/services/SDK_API_KEY_VALIDATION.md +421 -421
- package/lib/module/services/apiClient.js +1 -1
- package/lib/module/services/apiKeyService.js +99 -99
- package/lib/module/services/authService.js +72 -72
- package/lib/module/services/biometricPinService.js +1 -1
- package/lib/module/services/chatGPTConversationExtractor.js +1 -1
- package/lib/module/services/chatGPTConversationService.js +1 -1
- package/lib/module/services/claudeConversationExtractor.js +1 -1
- package/lib/module/services/claudeConversationService.js +1 -1
- package/lib/module/services/connectedAccountsService.js +1 -1
- package/lib/module/services/googleAuthService.js +1 -1
- package/lib/module/services/hingeDataExtractor.js +1 -1
- package/lib/module/services/hingeDataService.js +1 -1
- package/lib/module/services/imageCompressionService.js +1 -1
- package/lib/module/services/instagramDataExtractor.js +1 -1
- package/lib/module/services/instagramDataService.js +1 -1
- package/lib/module/services/jwtStorageService.js +1 -1
- package/lib/module/services/linkedinDOMExtractor.js +1 -1
- package/lib/module/services/linkedinProfileService.js +1 -1
- package/lib/module/services/linkedinScrapingService.js +1 -1
- package/lib/module/services/llmDataStorage.js +1 -1
- package/lib/module/services/mobileTrainingService.js +1 -1
- package/lib/module/services/oauthService.js +20 -20
- package/lib/module/services/pinEncryptionService.js +1 -1
- package/lib/module/services/pinStorageUtils.js +1 -1
- package/lib/module/services/platformAuthService.js +1 -1
- package/lib/module/services/sephoraDataExtractor.js +1 -1
- package/lib/module/services/sephoraDataService.js +1 -1
- package/lib/module/services/storageService.js +1 -1
- package/lib/module/services/telegramDataExtractor.js +1 -1
- package/lib/module/services/telegramDataService.js +1 -1
- package/lib/module/services/trainingApiHelpers.js +1 -1
- package/lib/module/services/userConnectionsService.js +1 -1
- package/lib/module/services/youtubeMigrationService.js +1 -1
- package/lib/module/theme/index.js +1 -1
- package/lib/module/types.js +1 -1
- package/lib/module/utils/Portal.js +1 -1
- package/lib/module/utils/api.js +1 -1
- package/lib/module/utils/assetRegistry.js +1 -1
- package/lib/module/utils/auth.js +1 -1
- package/lib/module/utils/connectorTests.js +1 -1
- package/lib/module/utils/crypto.js +1 -1
- package/lib/module/utils/debugHelper.js +1 -1
- package/lib/module/utils/encryption.js +1 -1
- package/lib/module/utils/eventUtils.js +1 -1
- package/lib/module/utils/haptics.js +1 -1
- package/lib/module/utils/networkDiagnostics.js +1 -1
- package/lib/module/utils/onairosApi.js +1 -1
- package/lib/module/utils/programmaticFlow.js +1 -1
- package/lib/module/utils/retryHelper.js +1 -1
- package/lib/module/utils/secureStorage.js +1 -1
- package/lib/module/utils/webviewScripts/chatgpt.js +1 -1
- package/lib/module/utils/webviewScripts/claude.js +1 -1
- package/lib/module/utils/webviewScripts/hinge.js +1 -1
- package/lib/module/utils/webviewScripts/index.js +1 -1
- package/lib/module/utils/webviewScripts/instagram.js +1 -1
- package/lib/module/utils/webviewScripts/linkedin.js +1 -1
- package/lib/module/utils/webviewScripts/sephora.js +1 -1
- package/lib/module/utils/webviewScripts/telegram.js +1 -1
- package/package.json +172 -172
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Onairos SDK will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [5.8.22] - 2026-02-22
|
|
6
|
+
|
|
7
|
+
### ๐ Bug Fix - Cached Login / Session Persistence
|
|
8
|
+
|
|
9
|
+
#### Problem Fixed
|
|
10
|
+
- **Cached login was not working** - users were being asked to sign in again even with a valid session
|
|
11
|
+
- Session data flags (`onboardingComplete`, `pinCreated`) were not being persisted after flow completion
|
|
12
|
+
|
|
13
|
+
#### Root Cause
|
|
14
|
+
When onboarding or PIN setup completed, if the session was already valid (not expired), only `extendSession()` was called instead of `createSession()`. The `extendSession()` function only bumps the session expiry but does NOT update the stored user data with the new flags.
|
|
15
|
+
|
|
16
|
+
This caused:
|
|
17
|
+
1. User completes onboarding โ `onboardingComplete: true` set in memory but not persisted to session
|
|
18
|
+
2. User completes PIN โ `pinCreated: true` set in memory but not persisted to session
|
|
19
|
+
3. User returns later โ `checkValidSession()` reads old flags (both false) โ session considered incomplete โ login required
|
|
20
|
+
|
|
21
|
+
#### Solution
|
|
22
|
+
Always call `createSession()` with updated user data when flags change, not just `extendSession()`.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
### โจ Enhancement - Data Request UI Improvements
|
|
27
|
+
|
|
28
|
+
#### Changes
|
|
29
|
+
- **Raw Memories option visibility**: Now properly handles apps that don't request raw/LLM data
|
|
30
|
+
- If app doesn't request raw data: option shows greyed out with "Not used by this app" hover text
|
|
31
|
+
- If user has no LLM connections: option shows greyed out with "Connect an LLM app first" hover text
|
|
32
|
+
- **Added descriptions under data types** (matching Connections page style):
|
|
33
|
+
- Basic Profile: "Your basic profile information"
|
|
34
|
+
- Preferences: "Your preferences towards {appName}"
|
|
35
|
+
- Interests: "Overview of your personality"
|
|
36
|
+
- Raw Memories: "Secure raw app data from your LLM connections" (or disabled reason if unavailable)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## [5.8.19] - 2026-02-22
|
|
41
|
+
|
|
42
|
+
### ๐ Critical Fix - Next.js 16 Turbopack Compatibility
|
|
43
|
+
|
|
44
|
+
#### Problem Fixed
|
|
45
|
+
- **Turbopack parsing errors when importing onairos in Next.js 16+ App Router:**
|
|
46
|
+
- `SyntaxError: Function statements require a function name`
|
|
47
|
+
- `ChunkLoadError: Failed to load chunk server/chunks/ssr/...onairos_esm...`
|
|
48
|
+
- `Turbopack panic: x Expected ident` / `x Expected ';', '}' or <eof>`
|
|
49
|
+
- ESM bundle was incompatible with Turbopack's stricter SWC-based JavaScript parser
|
|
50
|
+
- Obfuscated code patterns (IIFEs, hexadecimal identifiers, RC4 decoders) broke parsing
|
|
51
|
+
|
|
52
|
+
#### Root Cause
|
|
53
|
+
Turbopack uses SWC (Rust-based parser) which is stricter than Webpack's Acorn parser.
|
|
54
|
+
`javascript-obfuscator` produces valid JavaScript that SWC cannot parse in certain edge cases:
|
|
55
|
+
|
|
56
|
+
| Pattern | Example | SWC Error |
|
|
57
|
+
|---------|---------|-----------|
|
|
58
|
+
| IIFE with hex identifiers | `function(_0x1a2b){...}` | "Function statements require function name" |
|
|
59
|
+
| RC4 decoder wrappers | `(function(){...})()` | Malformed IIFE detection |
|
|
60
|
+
| Control flow flattening | `switch(_0x...){case...}` | "Expected ident" errors |
|
|
61
|
+
| Dead code injection | Anonymous unreachable functions | Parser panics |
|
|
62
|
+
|
|
63
|
+
#### Solution Implemented
|
|
64
|
+
**Full obfuscation preserved with post-build normalization:**
|
|
65
|
+
|
|
66
|
+
1. ESM builds use **full-strength obfuscation** (RC4, control flow flattening, etc.)
|
|
67
|
+
2. After webpack completes, `scripts/normalize-esm-for-turbopack.cjs` runs the output through Babel
|
|
68
|
+
3. Babel's parser/generator normalizes the AST into standard-form JavaScript
|
|
69
|
+
4. The result is fully obfuscated code that Turbopack can parse
|
|
70
|
+
|
|
71
|
+
**Build flow:**
|
|
72
|
+
```
|
|
73
|
+
Webpack โ Obfuscate (full) โ Babel normalize โ Turbopack-compatible output
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**No security trade-off** - ESM builds retain the same protection level as before:
|
|
77
|
+
- RC4 string encryption
|
|
78
|
+
- Control flow flattening
|
|
79
|
+
- Dead code injection
|
|
80
|
+
- Hexadecimal identifiers
|
|
81
|
+
- String splitting
|
|
82
|
+
- Object key transformation
|
|
83
|
+
|
|
84
|
+
#### Migration
|
|
85
|
+
Simply update to 5.8.19:
|
|
86
|
+
```bash
|
|
87
|
+
npm install onairos@5.8.19
|
|
88
|
+
# or
|
|
89
|
+
yarn add onairos@5.8.19
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
No code changes required - the fix is entirely in the distributed bundle.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## [4.3.6] - 2024-12-24
|
|
97
|
+
|
|
98
|
+
### ๐ Critical Fix - Google Sign-In Token Type (ID Token vs Access Token)
|
|
99
|
+
|
|
100
|
+
#### Problem Fixed
|
|
101
|
+
- **Backend error: "Wrong number of segments in token"**
|
|
102
|
+
- SDK was sending **access token** (`ya29.xxx...`) instead of **ID token** (JWT `eyJhbGciOiJ...`)
|
|
103
|
+
- Backend expects ID token (JWT with 3 segments) for authentication verification
|
|
104
|
+
- Access tokens cannot be decoded/verified as JWTs
|
|
105
|
+
|
|
106
|
+
#### Solution Implemented
|
|
107
|
+
- **Switched from `useGoogleLogin` hook to `GoogleLogin` component**
|
|
108
|
+
- `useGoogleLogin` returns access token (for API calls) โ
|
|
109
|
+
- `GoogleLogin` returns ID token (for authentication) โ
|
|
110
|
+
- Backend now receives proper JWT ID token for verification
|
|
111
|
+
|
|
112
|
+
#### Technical Details
|
|
113
|
+
|
|
114
|
+
**Token Format Comparison:**
|
|
115
|
+
| Token Type | Format | Segments | Use Case |
|
|
116
|
+
|------------|--------|----------|----------|
|
|
117
|
+
| ID Token (JWT) โ
| `eyJhbGciOiJ...` | 3 (header.payload.signature) | Authentication |
|
|
118
|
+
| Access Token โ | `ya29.xxx...` | Variable | API calls |
|
|
119
|
+
|
|
120
|
+
**Before (BROKEN):**
|
|
121
|
+
```javascript
|
|
122
|
+
// Using useGoogleLogin - returns access token
|
|
123
|
+
const googleLogin = useGoogleLogin({
|
|
124
|
+
onSuccess: (tokenResponse) => {
|
|
125
|
+
const accessToken = tokenResponse.access_token; // ya29.xxx
|
|
126
|
+
// Send to backend โ JWT decode fails!
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**After (FIXED):**
|
|
132
|
+
```javascript
|
|
133
|
+
// Using GoogleLogin component - returns ID token
|
|
134
|
+
<GoogleLogin
|
|
135
|
+
onSuccess={(credentialResponse) => {
|
|
136
|
+
const idToken = credentialResponse.credential; // eyJhbGciOiJ... (JWT)
|
|
137
|
+
// Send to backend โ JWT decode succeeds! โ
|
|
138
|
+
}}
|
|
139
|
+
/>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### Files Changed
|
|
143
|
+
- `src/components/EmailAuth.js`:
|
|
144
|
+
- Changed import: `useGoogleLogin` โ `GoogleLogin`
|
|
145
|
+
- Removed custom `GoogleButton` component (no longer needed)
|
|
146
|
+
- Implemented `handleGoogleSuccess()` to handle ID token
|
|
147
|
+
- Decode JWT to extract email before sending to backend
|
|
148
|
+
- Updated comments to clarify ID token vs access token
|
|
149
|
+
- Replaced custom button with official `<GoogleLogin>` component
|
|
150
|
+
|
|
151
|
+
#### Impact
|
|
152
|
+
- โ
Backend receives proper JWT ID token (3 segments)
|
|
153
|
+
- โ
JWT verification succeeds in backend
|
|
154
|
+
- โ
Google Sign-In authentication works correctly
|
|
155
|
+
- โ
Account creation succeeds
|
|
156
|
+
- โ
Platform connections work for new Google users
|
|
157
|
+
|
|
158
|
+
#### Backend Integration
|
|
159
|
+
- Endpoint: `POST /google/google`
|
|
160
|
+
- Receives: `{ credential: "eyJhbGciOiJ..." }` (ID token, not access token)
|
|
161
|
+
- Backend can now decode and verify JWT successfully
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## [4.3.5] - 2024-12-24
|
|
166
|
+
|
|
167
|
+
### ๐ Critical Fix - Google Sign-In Account Creation
|
|
168
|
+
|
|
169
|
+
#### Problem Fixed
|
|
170
|
+
- **New Google users were NOT getting accounts created in the backend**
|
|
171
|
+
- After Google Sign-In, frontend only checked if account exists but never created it
|
|
172
|
+
- This caused platform connection failures: "Account doesn't exist" error when connecting YouTube
|
|
173
|
+
- Backend diagnostics showed: `/getAccountInfo/email` called but NO account creation endpoint called
|
|
174
|
+
|
|
175
|
+
#### Solution Implemented
|
|
176
|
+
- **Added `/google/google` endpoint call** after Google Sign-In to create/login account
|
|
177
|
+
- Frontend now properly authenticates with backend and receives JWT token
|
|
178
|
+
- Backend creates account if it doesn't exist, or logs in existing user
|
|
179
|
+
- Platform connections now succeed for new Google users
|
|
180
|
+
|
|
181
|
+
#### Technical Details
|
|
182
|
+
|
|
183
|
+
**Before (BROKEN):**
|
|
184
|
+
```javascript
|
|
185
|
+
// Google Sign-In โ Get email
|
|
186
|
+
// Call /getAccountInfo/email โ "No Account Found"
|
|
187
|
+
// โ No backend call to create account
|
|
188
|
+
// Proceed to YouTube connection โ FAILS
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**After (FIXED):**
|
|
192
|
+
```javascript
|
|
193
|
+
// Google Sign-In โ Get email + access token
|
|
194
|
+
// Call /google/google with credential โ Account created + JWT token returned
|
|
195
|
+
// โ
Account exists in backend
|
|
196
|
+
// Proceed to YouTube connection โ SUCCESS
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
#### Files Changed
|
|
200
|
+
- `src/components/EmailAuth.js`:
|
|
201
|
+
- Updated `handleOAuthSuccess()` to call `/google/google` endpoint
|
|
202
|
+
- Pass Google access token as `credential` to backend
|
|
203
|
+
- Receive and store JWT token from backend response
|
|
204
|
+
- Updated `googleLogin` hook to pass access token to handler
|
|
205
|
+
|
|
206
|
+
#### Impact
|
|
207
|
+
- โ
NEW Google users now get accounts created properly
|
|
208
|
+
- โ
Platform connections (YouTube, etc.) succeed for new users
|
|
209
|
+
- โ
JWT tokens properly issued and stored
|
|
210
|
+
- โ
Existing Google users continue to work (login flow)
|
|
211
|
+
|
|
212
|
+
#### Backend Integration
|
|
213
|
+
- Uses existing `/google/google` endpoint
|
|
214
|
+
- Sends: `{ credential: googleAccessToken }`
|
|
215
|
+
- Receives: `{ body: { token, username, isNewUser } }`
|
|
216
|
+
|
|
217
|
+
For full technical analysis, see `GOOGLE_SIGNIN_ACCOUNT_CREATION_BUG.md`
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## [4.2.3] - 2025-12-14
|
|
222
|
+
|
|
223
|
+
### ๐ Critical Fix - Email Authentication Routing (Corrects 4.2.2)
|
|
224
|
+
|
|
225
|
+
#### Problem Fixed
|
|
226
|
+
- **Version 4.2.2 introduced a bug**: NEW users via email authentication were incorrectly routed to dataRequest instead of onboarding
|
|
227
|
+
- **Root cause**: Added `/getAccountInfo/email` check AFTER email verification, but backend creates account during verification
|
|
228
|
+
- **Result**: Account check always found account exists (even for new users), causing wrong routing
|
|
229
|
+
|
|
230
|
+
#### Solution Implemented
|
|
231
|
+
- **Trust backend's `isNewUser` field** - Backend knows if account was just created during verification
|
|
232
|
+
- **Removed unnecessary API call** - No longer call `/getAccountInfo/email` after email verification
|
|
233
|
+
- **Consistent with backend design** - Both `/email/verify/confirm` and `/auth/google` are authoritative about user status
|
|
234
|
+
|
|
235
|
+
#### Technical Details
|
|
236
|
+
|
|
237
|
+
**Before (4.2.2 - BROKEN):**
|
|
238
|
+
```javascript
|
|
239
|
+
// Email verification creates account and returns isNewUser: true
|
|
240
|
+
// Then we called /getAccountInfo/email
|
|
241
|
+
// Found account exists (just created!) โ treated as existing user โ
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**After (4.2.3 - FIXED):**
|
|
245
|
+
```javascript
|
|
246
|
+
// Email verification returns isNewUser: true
|
|
247
|
+
// Trust this field directly โ route to onboarding โ
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
#### Files Changed
|
|
251
|
+
- `src/components/EmailAuth.js`:
|
|
252
|
+
- Email verification: Trust `data.isNewUser` from verification response
|
|
253
|
+
- Google sign-in: Trust `authData.body.isNewUser` from `/auth/google` response
|
|
254
|
+
- Removed post-verification `/getAccountInfo/email` call that caused the bug
|
|
255
|
+
|
|
256
|
+
#### Impact
|
|
257
|
+
- โ
NEW email users now correctly route to onboarding (FIXED)
|
|
258
|
+
- โ
EXISTING email users still correctly route to dataRequest (unchanged)
|
|
259
|
+
- โ
NEW Google users still correctly route to onboarding (unchanged)
|
|
260
|
+
- โ
EXISTING Google users still correctly route to dataRequest (unchanged)
|
|
261
|
+
|
|
262
|
+
For detailed technical analysis, see `FIX_4.2.3_CORRECT_IMPLEMENTATION.md` and `AUTHENTICATION_FLOW_ANALYSIS.md`
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## [4.2.2] - 2025-12-14 (SUPERSEDED BY 4.2.3)
|
|
267
|
+
|
|
268
|
+
### ๐ Fixed - Email Authentication Routing for Existing Users
|
|
269
|
+
|
|
270
|
+
#### Problem Resolved
|
|
271
|
+
- **Critical Bug**: Existing users authenticating via email verification were incorrectly routed to onboarding instead of dataRequest page
|
|
272
|
+
- **Root Cause**: Frontend was checking non-existent `data.existingUser` field instead of `data.isNewUser` returned by backend
|
|
273
|
+
- **Impact**: Existing users had to go through onboarding again instead of proceeding directly to data request
|
|
274
|
+
|
|
275
|
+
#### Solution Implemented
|
|
276
|
+
- Added explicit account status check via `/getAccountInfo/email` endpoint (matching Google sign-in behavior)
|
|
277
|
+
- Email verification flow now fetches complete account data after code verification
|
|
278
|
+
- Both Google OAuth and email authentication flows now return identical account data structures
|
|
279
|
+
- Uses `accountStatus.exists` field for consistent user routing logic
|
|
280
|
+
|
|
281
|
+
#### Technical Details
|
|
282
|
+
**Before Fix:**
|
|
283
|
+
```javascript
|
|
284
|
+
// Backend returns: { isNewUser: false }
|
|
285
|
+
// Frontend checked: data.existingUser (undefined)
|
|
286
|
+
// Result: existingUser = false (WRONG!)
|
|
287
|
+
// Route: onboarding (WRONG for existing users!)
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**After Fix:**
|
|
291
|
+
```javascript
|
|
292
|
+
// Explicit account check via /getAccountInfo/email
|
|
293
|
+
// Gets: { accountStatus: { exists: true } }
|
|
294
|
+
// Result: existingUser = true (CORRECT!)
|
|
295
|
+
// Route: dataRequest (CORRECT for existing users!)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### Files Changed
|
|
299
|
+
- `src/components/EmailAuth.js` - Added explicit account status check in `handleCodeSubmit()`
|
|
300
|
+
- Improved logging for account status verification
|
|
301
|
+
- Enhanced error handling and fallback logic
|
|
302
|
+
|
|
303
|
+
#### Benefits
|
|
304
|
+
- โ
Existing users now correctly route to dataRequest page via email auth
|
|
305
|
+
- โ
Consistent behavior between Google and email authentication
|
|
306
|
+
- โ
Full account data available for both authentication flows
|
|
307
|
+
- โ
Better user experience for returning users
|
|
308
|
+
- โ
No breaking changes to existing functionality
|
|
309
|
+
|
|
310
|
+
For detailed technical analysis, see `EMAIL_AUTH_CONSISTENCY_FIX.md`
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## [4.0.16] - 2025-12-01
|
|
315
|
+
|
|
316
|
+
### ๐ Major Fix: Full Tailwind CSS v3 & v4 Compatibility
|
|
317
|
+
|
|
318
|
+
#### Fixed
|
|
319
|
+
- โ
**RESOLVED**: Peer dependency conflict error with Tailwind CSS v3
|
|
320
|
+
- โ
Package now works with **Tailwind v3.0+ and v4.0+** without any workarounds
|
|
321
|
+
- โ
Brandon's issue with `tailwindcss@3.4.18` now resolved
|
|
322
|
+
- โ
No need for `--force` or `--legacy-peer-deps` flags
|
|
323
|
+
|
|
324
|
+
#### Added
|
|
325
|
+
- `INSTALLATION_GUIDE.md` - Comprehensive installation guide for both Tailwind versions
|
|
326
|
+
- Automatic version compatibility detection
|
|
327
|
+
- Clear upgrade path documentation for developers who want to move to v4
|
|
328
|
+
|
|
329
|
+
#### Changed
|
|
330
|
+
- Peer dependency: `"tailwindcss": ">=3.0.0"` (supports all v3 and v4 versions)
|
|
331
|
+
- Version bumped to 4.0.16
|
|
332
|
+
|
|
333
|
+
#### Developer Instructions
|
|
334
|
+
**No configuration changes needed!** Just run:
|
|
335
|
+
```bash
|
|
336
|
+
npm install onairos@latest
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Works automatically with:
|
|
340
|
+
- Tailwind CSS v3.4.x (Brandon's version with the error)
|
|
341
|
+
- Tailwind CSS v4.1.x
|
|
342
|
+
- All versions >=3.0.0
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## [4.0.1] - 2025-11-14
|
|
347
|
+
|
|
348
|
+
### ๐ฏ TypeScript Enhancement: onComplete Callback
|
|
349
|
+
|
|
350
|
+
#### Enhanced Type Definitions
|
|
351
|
+
- **NEW**: Added comprehensive `OnairosCompleteData` interface with full type documentation
|
|
352
|
+
- **IMPROVED**: Specified `token: string` and `apiUrl: string` as core response properties
|
|
353
|
+
- **NEW**: Documented all optional fields with detailed comments
|
|
354
|
+
- **NEW**: Added enhanced formatting fields (`userDataSummary`, `prettyPrint`)
|
|
355
|
+
|
|
356
|
+
#### Bug Fixes
|
|
357
|
+
- **FIXED**: Test mode now includes mock `token` field for consistent data structure
|
|
358
|
+
- **FIXED**: Test mode returns identical structure to production mode
|
|
359
|
+
|
|
360
|
+
#### Developer Experience
|
|
361
|
+
- **NEW**: Added comprehensive logging for `onComplete` data structure validation
|
|
362
|
+
- **NEW**: Visual indicators (โ
/โ) for presence of key fields in console
|
|
363
|
+
- **NEW**: Detailed logging shows token preview, apiUrl, and all returned keys
|
|
364
|
+
- **NEW**: Created `ONCOMPLETE_USAGE_EXAMPLE.md` with complete usage documentation
|
|
365
|
+
|
|
366
|
+
#### Documentation
|
|
367
|
+
- **NEW**: TypeScript interface examples with proper typing
|
|
368
|
+
- **NEW**: JavaScript usage examples with authentication patterns
|
|
369
|
+
- **NEW**: Complete field documentation with descriptions
|
|
370
|
+
- **NEW**: Test mode vs Production mode comparison
|
|
371
|
+
- **NEW**: Examples of authenticated API requests using token and apiUrl
|
|
372
|
+
|
|
373
|
+
#### Code Quality
|
|
374
|
+
- **IMPROVED**: Better console debugging output at all stages of data flow
|
|
375
|
+
- **IMPROVED**: DataRequest component logs token and apiUrl presence before callback
|
|
376
|
+
- **IMPROVED**: OnairosButton logs complete data structure before passing to parent
|
|
377
|
+
|
|
378
|
+
### Changes Summary
|
|
379
|
+
```typescript
|
|
380
|
+
// Now properly typed in TypeScript
|
|
381
|
+
interface OnairosCompleteData {
|
|
382
|
+
token: string; // โ
JWT token for authenticated API calls
|
|
383
|
+
apiUrl: string; // โ
Backend API endpoint URL
|
|
384
|
+
// ... plus 20+ optional fields with full documentation
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// Usage
|
|
388
|
+
const handleComplete = (data: OnairosCompleteData) => {
|
|
389
|
+
const { token, apiUrl } = data; // TypeScript knows these are strings!
|
|
390
|
+
};
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## [3.4.0] - 2024-10-09
|
|
394
|
+
|
|
395
|
+
### ๐ Major Features
|
|
396
|
+
|
|
397
|
+
#### Standardized API Key Validation System
|
|
398
|
+
- **NEW**: Implemented comprehensive `initializeApiKey()` function following standardized documentation
|
|
399
|
+
- **NEW**: Added `validateApiKey()` utility with backend validation
|
|
400
|
+
- **NEW**: Created `/auth/validate-key` endpoint for standardized API key validation
|
|
401
|
+
- **NEW**: Added retry logic with exponential backoff for network resilience
|
|
402
|
+
- **NEW**: Comprehensive error handling with specific error codes and suggestions
|
|
403
|
+
|
|
404
|
+
#### Enhanced SDK Architecture
|
|
405
|
+
- **NEW**: Modular API key validation utilities (`apiKeyValidation.js`)
|
|
406
|
+
- **NEW**: Centralized SDK initialization system (`sdkInitialization.js`)
|
|
407
|
+
- **NEW**: Global SDK state management with proper lifecycle
|
|
408
|
+
- **NEW**: Authenticated request helper with automatic API key injection
|
|
409
|
+
|
|
410
|
+
#### ChatGPT Integration
|
|
411
|
+
- **NEW**: Added ChatGPT as first connector with special behavior
|
|
412
|
+
- **NEW**: ChatGPT connector opens `chatgpt.com` in new tab (no OAuth)
|
|
413
|
+
- **NEW**: Added OpenAI icon support with fallback to emoji
|
|
414
|
+
- **NEW**: Updated platform configurations across all components
|
|
415
|
+
|
|
416
|
+
#### Gmail OAuth Fix
|
|
417
|
+
- **NEW**: Created Gmail OAuth backend route (`gmail-enhanced.js`)
|
|
418
|
+
- **NEW**: Added Gmail configuration to OAuth config
|
|
419
|
+
- **NEW**: Fixed "Not Found" error for Gmail authorization
|
|
420
|
+
- **NEW**: Comprehensive Gmail OAuth flow with token exchange
|
|
421
|
+
|
|
422
|
+
### ๐ง Technical Improvements
|
|
423
|
+
|
|
424
|
+
#### API Key Validation
|
|
425
|
+
- **Format Validation**: Supports `ona_`, `dev_`, `pk_` prefixes (32+ characters)
|
|
426
|
+
- **Admin Key Support**: Special handling for admin keys with full permissions
|
|
427
|
+
- **Environment Detection**: Automatic production/development environment detection
|
|
428
|
+
- **Rate Limiting**: Built-in rate limit handling and reporting
|
|
429
|
+
- **Timeout Handling**: Configurable timeouts with abort controller
|
|
430
|
+
|
|
431
|
+
#### Error Handling
|
|
432
|
+
- **Standardized Error Codes**: `MISSING_API_KEY`, `INVALID_API_KEY_FORMAT`, etc.
|
|
433
|
+
- **Detailed Error Messages**: User-friendly error descriptions
|
|
434
|
+
- **Actionable Suggestions**: Specific suggestions for each error type
|
|
435
|
+
- **Retry Logic**: Automatic retry with exponential backoff for server errors
|
|
436
|
+
|
|
437
|
+
#### SDK Configuration
|
|
438
|
+
```typescript
|
|
439
|
+
interface InitConfig {
|
|
440
|
+
apiKey: string; // Required: Developer API key
|
|
441
|
+
environment?: 'production' | 'development'; // Default: auto-detected
|
|
442
|
+
enableLogging?: boolean; // Default: false
|
|
443
|
+
timeout?: number; // Default: 30000ms
|
|
444
|
+
retryAttempts?: number; // Default: 3
|
|
445
|
+
platform?: string; // Default: 'web'
|
|
446
|
+
sdkVersion?: string; // Default: '3.4.0'
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### ๐ก API Endpoints
|
|
451
|
+
|
|
452
|
+
#### New Validation Endpoints
|
|
453
|
+
- **POST** `/auth/validate-key` - Primary validation endpoint
|
|
454
|
+
- **GET** `/auth/validate-key?key=API_KEY` - Simple validation
|
|
455
|
+
- **GET** `/auth/health` - Health check endpoint
|
|
456
|
+
|
|
457
|
+
#### Enhanced OAuth Endpoints
|
|
458
|
+
- **POST** `/gmail/authorize` - Gmail OAuth authorization
|
|
459
|
+
- **GET** `/gmail/callback` - Gmail OAuth callback
|
|
460
|
+
- **POST** `/gmail/native-auth` - Gmail native authentication
|
|
461
|
+
|
|
462
|
+
### ๐จ UI/UX Improvements
|
|
463
|
+
|
|
464
|
+
#### Platform Connectors
|
|
465
|
+
- **ChatGPT First**: ChatGPT appears as first connector option
|
|
466
|
+
- **Visual Icons**: OpenAI icon for ChatGPT with emoji fallback
|
|
467
|
+
- **Consistent Design**: Unified design across all connector components
|
|
468
|
+
- **Special Behaviors**: Platform-specific behaviors (ChatGPT opens new tab)
|
|
469
|
+
|
|
470
|
+
#### Error Feedback
|
|
471
|
+
- **User-Friendly Messages**: Clear error descriptions for users
|
|
472
|
+
- **Developer Guidance**: Detailed suggestions for developers
|
|
473
|
+
- **Visual Feedback**: Proper loading states and error indicators
|
|
474
|
+
|
|
475
|
+
### ๐ Security Enhancements
|
|
476
|
+
|
|
477
|
+
#### API Key Security
|
|
478
|
+
- **Format Validation**: Strict format validation before network requests
|
|
479
|
+
- **Secure Storage**: Proper API key handling in global state
|
|
480
|
+
- **Token Management**: Automatic token refresh and management
|
|
481
|
+
- **Permission Checking**: Granular permission validation
|
|
482
|
+
|
|
483
|
+
#### Network Security
|
|
484
|
+
- **HTTPS Only**: All API calls use HTTPS endpoints
|
|
485
|
+
- **Request Signing**: Proper authorization headers
|
|
486
|
+
- **Timeout Protection**: Request timeout protection
|
|
487
|
+
- **Retry Limits**: Bounded retry attempts to prevent abuse
|
|
488
|
+
|
|
489
|
+
### ๐ Documentation
|
|
490
|
+
|
|
491
|
+
#### New Documentation Files
|
|
492
|
+
- `SDK_API_KEY_VALIDATION.md` - Comprehensive API key validation guide
|
|
493
|
+
- `GMAIL_CHATGPT_IMPLEMENTATION.md` - Gmail OAuth and ChatGPT implementation
|
|
494
|
+
- `CHATGPT_ICON_UPDATE.md` - ChatGPT icon implementation details
|
|
495
|
+
- `CHANGELOG.md` - This changelog
|
|
496
|
+
|
|
497
|
+
#### Code Documentation
|
|
498
|
+
- **JSDoc Comments**: Comprehensive function documentation
|
|
499
|
+
- **TypeScript Interfaces**: Proper type definitions
|
|
500
|
+
- **Usage Examples**: Clear usage examples in documentation
|
|
501
|
+
- **Error Handling**: Documented error codes and handling
|
|
502
|
+
|
|
503
|
+
### ๐งช Testing & Quality
|
|
504
|
+
|
|
505
|
+
#### Validation Testing
|
|
506
|
+
- **Format Validation**: Comprehensive API key format testing
|
|
507
|
+
- **Network Testing**: Retry logic and timeout testing
|
|
508
|
+
- **Error Scenarios**: All error code paths tested
|
|
509
|
+
- **Integration Testing**: End-to-end validation flow testing
|
|
510
|
+
|
|
511
|
+
#### Code Quality
|
|
512
|
+
- **ESLint Clean**: No linting errors
|
|
513
|
+
- **Modular Design**: Clean separation of concerns
|
|
514
|
+
- **Error Boundaries**: Proper error handling throughout
|
|
515
|
+
- **Performance**: Optimized network requests and state management
|
|
516
|
+
|
|
517
|
+
### ๐ Migration Guide
|
|
518
|
+
|
|
519
|
+
#### From v3.3.0 to v3.4.0
|
|
520
|
+
|
|
521
|
+
**Before (v3.3.0)**:
|
|
522
|
+
```javascript
|
|
523
|
+
import { OnairosButton } from 'onairos';
|
|
524
|
+
|
|
525
|
+
// Components worked without explicit initialization
|
|
526
|
+
<OnairosButton requestData={{...}} />
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
**After (v3.4.0)**:
|
|
530
|
+
```javascript
|
|
531
|
+
import { initializeApiKey, OnairosButton } from 'onairos';
|
|
532
|
+
|
|
533
|
+
// 1. Initialize SDK first
|
|
534
|
+
await initializeApiKey({
|
|
535
|
+
apiKey: 'ona_your_api_key_here',
|
|
536
|
+
environment: 'production',
|
|
537
|
+
enableLogging: true
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
// 2. Use components (they automatically use initialized API key)
|
|
541
|
+
<OnairosButton requestData={{...}} />
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
#### Breaking Changes
|
|
545
|
+
- **API Key Required**: `initializeApiKey()` must be called before using SDK components
|
|
546
|
+
- **Environment Detection**: Automatic environment detection (can be overridden)
|
|
547
|
+
- **Error Handling**: New error codes and error structure
|
|
548
|
+
|
|
549
|
+
#### Backward Compatibility
|
|
550
|
+
- **Component APIs**: All existing component APIs remain unchanged
|
|
551
|
+
- **Response Formats**: All response formats remain compatible
|
|
552
|
+
- **OAuth Flows**: Existing OAuth flows continue to work
|
|
553
|
+
|
|
554
|
+
### ๐ Bug Fixes
|
|
555
|
+
|
|
556
|
+
#### Gmail OAuth
|
|
557
|
+
- **Fixed**: "Not Found" error when connecting Gmail
|
|
558
|
+
- **Fixed**: Missing Gmail OAuth backend route
|
|
559
|
+
- **Fixed**: Gmail OAuth callback handling
|
|
560
|
+
- **Fixed**: Gmail token exchange and user data storage
|
|
561
|
+
|
|
562
|
+
#### Platform Connectors
|
|
563
|
+
- **Fixed**: Platform icon loading and fallback behavior
|
|
564
|
+
- **Fixed**: Connector state management across components
|
|
565
|
+
- **Fixed**: Platform configuration consistency
|
|
566
|
+
- **Fixed**: Special behavior handling for different platforms
|
|
567
|
+
|
|
568
|
+
#### SDK Initialization
|
|
569
|
+
- **Fixed**: Race conditions in SDK initialization
|
|
570
|
+
- **Fixed**: Global state management and cleanup
|
|
571
|
+
- **Fixed**: Error propagation and handling
|
|
572
|
+
- **Fixed**: Network request timeout and retry logic
|
|
573
|
+
|
|
574
|
+
### ๐ฆ Dependencies
|
|
575
|
+
|
|
576
|
+
#### Updated Dependencies
|
|
577
|
+
- Maintained compatibility with existing React versions
|
|
578
|
+
- No breaking dependency changes
|
|
579
|
+
- Added proper error handling utilities
|
|
580
|
+
- Enhanced network request capabilities
|
|
581
|
+
|
|
582
|
+
### ๐ Deployment
|
|
583
|
+
|
|
584
|
+
#### NPM Package
|
|
585
|
+
- **Version**: 3.4.0
|
|
586
|
+
- **Size**: Optimized bundle size
|
|
587
|
+
- **Compatibility**: React 18+, Node.js 16+
|
|
588
|
+
- **Platforms**: Web, React Native, Node.js
|
|
589
|
+
|
|
590
|
+
#### Distribution Files
|
|
591
|
+
- `dist/onairos.bundle.js` - Browser bundle
|
|
592
|
+
- `dist/onairos.esm.js` - ES modules
|
|
593
|
+
- `dist/onairos.native.js` - React Native
|
|
594
|
+
- `dist/onairos.laravel.js` - Laravel integration
|
|
595
|
+
|
|
596
|
+
---
|
|
597
|
+
|
|
598
|
+
## [3.3.0] - Previous Release
|
|
599
|
+
|
|
600
|
+
### Features
|
|
601
|
+
- Basic OAuth connectors
|
|
602
|
+
- Component-based data collection
|
|
603
|
+
- Response formatting utilities
|
|
604
|
+
|
|
605
|
+
---
|
|
606
|
+
|
|
607
|
+
*For more details, see the [GitHub repository](https://github.com/zd819/onairos-npm) and [documentation](https://docs.onairos.uk).*
|
|
@@ -4,4 +4,4 @@ var __ONAIROS_REQ_REGISTRY__ = [
|
|
|
4
4
|
require("../config/api")
|
|
5
5
|
];
|
|
6
6
|
function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
|
|
7
|
-
function
|
|
7
|
+
function _0x4e8f(_0x146c9c,_0x4e8f4f){_0x146c9c=_0x146c9c-0x0;const _0x5bbbeb=_0x146c();let _0x44d736=_0x5bbbeb[_0x146c9c];return _0x44d736;}Object[_0x4e8f(0x0)](exports,_0x4e8f(0x1),{'value':!![]}),exports[_0x4e8f(0x2)]=exports['PLATFORMS']=exports[_0x4e8f(0x3)]=exports[_0x4e8f(0x4)]=exports[_0x4e8f(0x5)]=exports['API_ENDPOINTS']=void 0x0;var _api=__ONAIROS_REQ_FUNC__(0x0);const COLORS=exports[_0x4e8f(0x5)]={'primary':'#1BA9D4','headerBg':_0x4e8f(0x6),'text':{'primary':_0x4e8f(0x7),'secondary':_0x4e8f(0x8)},'border':_0x4e8f(0x9),'success':'#34C759','error':_0x4e8f(0xa),'instagram':_0x4e8f(0xb),'pinterest':_0x4e8f(0xc),'reddit':_0x4e8f(0xd),'youtube':_0x4e8f(0xe),'chatgpt':_0x4e8f(0xf),'llm':_0x4e8f(0xf),'white':'#FFFFFF','black':_0x4e8f(0x7),'gray':_0x4e8f(0x8),'lightGray':_0x4e8f(0x9)},PLATFORMS=exports['PLATFORMS']={'instagram':{'name':_0x4e8f(0x10),'icon':_0x4e8f(0x11),'color':COLORS[_0x4e8f(0x11)],'description':_0x4e8f(0x12)},'pinterest':{'name':'Pinterest','icon':'pinterest','color':COLORS[_0x4e8f(0x13)],'description':_0x4e8f(0x14)},'reddit':{'name':_0x4e8f(0x15),'icon':_0x4e8f(0x16),'color':COLORS[_0x4e8f(0x16)],'description':'Connect\x20Reddit\x20to\x20enhance\x20your\x20AI\x20model'},'youtube':{'name':'YouTube','icon':'youtube','color':COLORS[_0x4e8f(0x17)],'description':_0x4e8f(0x18)},'chatgpt':{'name':_0x4e8f(0x19),'icon':_0x4e8f(0x1a),'color':COLORS[_0x4e8f(0x1b)],'description':_0x4e8f(0x1c)},'llm':{'name':_0x4e8f(0x1d),'icon':'psychology','color':COLORS[_0x4e8f(0x1e)],'description':_0x4e8f(0x1f)}},API_ENDPOINTS=exports[_0x4e8f(0x20)]={'base':_api['API_CONFIG']['BASE_URL'],'oauth':{'instagram':_0x4e8f(0x21),'pinterest':'/pinterest/auth','reddit':_0x4e8f(0x22),'youtube':_0x4e8f(0x23),'chatgpt':_0x4e8f(0x24),'llm':_0x4e8f(0x24)},'callback':{'instagram':_0x4e8f(0x25),'pinterest':'/pinterest/callback','reddit':_0x4e8f(0x26),'youtube':_0x4e8f(0x27),'chatgpt':_0x4e8f(0x28),'llm':_0x4e8f(0x28)},'llm':{'dataIngest':'/llmdata','dataRequest':'/llmdata/request'}},STORAGE_KEYS=exports['STORAGE_KEYS']={'credentials':_0x4e8f(0x29),'connections':_0x4e8f(0x2a)},PIN_REQUIREMENTS=exports[_0x4e8f(0x3)]={'minLength':0x8,'requireUppercase':!![],'requireLowercase':!![],'requireNumber':!![],'requireSpecialChar':!![]},DEEP_LINK_CONFIG=exports[_0x4e8f(0x4)]={'scheme':_0x4e8f(0x2b),'host':_0x4e8f(0x2c),'redirectUri':'onairosanime://auth/'};function _0x146c(){const _0x48af4f=['defineProperty','__esModule','STORAGE_KEYS','PIN_REQUIREMENTS','DEEP_LINK_CONFIG','COLORS','#F8F9FA','#000000','#666666','#E5E5E5','#FF3B30','#E1306C','#E60023','#FF4500','#FF0000','#10A37F','Instagram','instagram','Connect\x20your\x20Instagram\x20account\x20to\x20train\x20your\x20AI\x20model','pinterest','Use\x20your\x20Pinterest\x20boards\x20for\x20AI\x20training','Reddit','reddit','youtube','Use\x20YouTube\x20data\x20to\x20improve\x20AI\x20recommendations','ChatGPT','chat','chatgpt','Connect\x20your\x20ChatGPT\x20conversations\x20for\x20AI\x20insights','LLM\x20Data','llm','Connect\x20your\x20AI\x20conversation\x20data','API_ENDPOINTS','/instagram/auth','/reddit/auth','/youtube/auth','/chatgpt/auth','/instagram/callback','/reddit/callback','/youtube/callback','/chatgpt/callback','onairos_credentials','onairos_connections','onairosanime','authenticate'];_0x146c=function(){return _0x48af4f;};return _0x146c();}
|