Onairos Package v1.33.0
A Flutter package for AI data collection and OAuth connections. Scrape and analyze user conversations from ChatGPT, Claude, Gemini, and Grok with a beautiful Flutter UI.
✨ Features
🤖 LLM Data Scraping (NEW)
- Extract user messages from ChatGPT, Claude, Gemini, Grok
- Native iOS scraping with WebView integration
- Beautiful UI for data visualization
- Privacy-focused: Only extracts user's own messages
- JSON export: Full conversation history with metadata
🔐 OAuth Connections
- YouTube, Instagram, Pinterest, Reddit, Twitter/X
- Native SDK integration (Google Sign-In for YouTube)
- Fallback web OAuth flows
- Secure credential storage with Keychain
🎨 UI Components
- Custom overlay with deep links
- Bottom modal design system
- Universal onboarding flow
- Data visualization modals
⚠️ iOS Native Code Required
Important: The LLM scraping functionality (ChatGPT, LinkedIn) is now included in the package! You just need to register the plugins in your app's AppDelegate.swift.
Quick Setup
Add this to your AppDelegate.swift:
import onairos
// In didFinishLaunchingWithOptions:
OnairosConnectorPlugins.registerPlugins(with: registrar)
The package now includes:
- ✅ ChatGPT connector (conversations + memories)
- ✅ LinkedIn connector (profile URL extraction)
- ✅ All native iOS scraping logic
📖 See LLM_INTEGRATION_GUIDE.md for complete setup instructions.
Getting Started
To use the Onairos package, include it in your pubspec.yaml file:
dependencies:
onairos: ^0.1.0
🚨 CRITICAL: Required Setup for YouTube/Google Integration
Before using YouTube integration, you MUST configure your own Google credentials. The package uses demo credentials that will not work in production.
Quick Setup:
- Create Google Cloud project
- Enable YouTube Data API v3
- Create OAuth 2.0 credentials for your bundle ID/package name
- Download
GoogleService-Info.plist(iOS) andgoogle-services.json(Android) - Provide your client ID to the Onairos widget
See CONSUMING_APP_SETUP_GUIDE.md for detailed instructions.
iOS Integration
To handle onairos biometric key store access (necessary) and other functionality on iOS with the Onairos package, you need to add the following configuration to your Info.plist file:
1st configurations
<key>NSFaceIDUsageDescription</key>
<string>Authenticate to access secure storage</string>
<key>NSBiometryUsageDescription</key>
<string>This app requires access to your biometric information for authentication purposes.</string>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.example.yourappbundleid</string>
</array>
2nd
Secure Enclave Access:
In your app's target settings, under the "Signing & Capabilities" tab, add the "Secure Enclave" capability.
Then add the following Deep Link Permissions
Configuring Your App for Deep Links
iOS Configuration
-
Update Info.plist:
- To handle deep links, you must declare your URL schemes in your
Info.plistunderCFBundleURLTypes. Here's how you can add a custom URL scheme:<key>LSApplicationQueriesSchemes</key> <array> <string>onairos</string> </array> <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>your-custom-scheme</string> </array> </dict> </array> - This configuration allows iOS to direct URLs with
your-custom-schemeto your app.
- To handle deep links, you must declare your URL schemes in your
-
Handle Incoming URLs:
- Implement the
application(_:open:options:)method in yourAppDelegate:func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { return true }
- Implement the
Android Configuration
-
Update AndroidManifest.xml:
- Declare your URL schemes within an
<intent-filter>in yourAndroidManifest.xml:<activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="your-custom-scheme" /> </intent-filter> </activity> - This configuration directs URLs with
your-custom-schemeto your app.
- Declare your URL schemes within an
-
Handle Intent in Activity:
- Manage the Intent in your
onCreateoronNewIntentmethod:@Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); // Process the intent to extract data }
- Manage the Intent in your
Testing Your Setup
- iOS: Use Xcode or Safari to test your URL scheme by typing it into the address bar.
- Android: Use ADB to test your URL scheme:
adb shell am start -W -a android.intent.action.VIEW -d "your-custom-scheme://test" com.example.yourapp
Additionally make sure to have the following AppDelegate.swift file included in your project
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Usage
Onairos Button Integration
Adding the Onairos button integration
Inputs:
- requestData (Object): Request data to display to user, what user data you want access to
- returnLink (String): The registered CFBundleURL of your app, so the onairos app can redirect back on first authorization
- logoAssetPath (String): String path of the logo you want to display when requesting access
Here is a simple example of using the OnairosButton widget in your app:
import 'package:flutter/material.dart';
import 'package:onairos/onairos.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
// Use the OnairosButton widget
child: OnairosButton(
requestData: {
'type': 'Personality',
'descriptions': 'Find out Your Anime Interests',
'reward': "\$0.30 - Test Money",
},
returnLink: 'yourapp://returnlink',
logoAssetPath: 'onairos_logo.png',
),
),
),
);
}
}
Replace 'yourapp://returnlink' with the actual return link for your application, and ensure the logoAssetPath points to a valid asset in your project.
Customization
The OnairosButton widget allows for customization of the request data and return link. Make sure to provide a valid asset path to display the Onairos logo on the button.
OAuth Integration
Using the Universal Onboarding Component
The Universal Onboarding component provides a complete solution for connecting to multiple platforms:
import 'package:flutter/material.dart';
import 'package:onairos/onairos.dart';
// Inside your widget
void showOnboarding() {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (context) => UniversalOnboarding(
platforms: ['youtube', 'instagram', 'pinterest', 'reddit'],
onComplete: (connectedPlatforms) {
// Handle connected platforms
print('Connected platforms: $connectedPlatforms');
},
),
);
}
Direct OAuth Service Usage
For more control, you can use the OAuthService directly:
import 'package:flutter/material.dart';
import 'package:onairos/services/oauth_service.dart';
// Inside your widget
final oauthService = OAuthService();
Future<void> connectToYouTube() async {
final connected = await oauthService.connectYouTube(context);
if (connected) {
// Successfully connected
} else {
// Connection failed
}
}
For more detailed information on OAuth integration, please refer to the OAuth Integration Guide.
Contributing
Feel free to contribute to the Onairos package. If you have suggestions or find bugs, please open an issue or create a pull request.
Libraries
- biometricKey
- components/email_registration
- components/onboarding/enhanced_oauth_webview
- components/onboarding/oauth_webview
- components/onboarding/onboarding_header
- components/onboarding/pin_input
- components/onboarding/platform_connector
- components/success_overlay
- components/ui/body_text
- components/ui/brand_mark
- components/ui/heading_group
- components/ui/modal_header
- components/ui/modal_sheet
- connections/connectPlatform
- connections/instagram
- connections/instagramOld
- connections/pinterest
- connections/reddit
- connections/youtube
- connections/youtube_enhanced
- embeddConnect
- functions/debug_helper
- functions/onairosapi
- functions/secure_storage
- functions/secure_storage copy
- initialize_api_key
- models/onairos_config
- NoOnairos
- onairos
- onairos_utils
- onairosapi
- overlay
- screens/code_verification_screen
- screens/connector_screen
- screens/email_verification_screen
- screens/enhanced_platform_connectors_step
- screens/enhanced_sign_in_step
- screens/enhanced_verification_step
- screens/enhanced_welcome_screen
- screens/final_step_screen
- screens/loading_screen
- screens/loading_screen_fixed
- screens/npm_data_request
- screens/npm_email_auth
- screens/npm_loading_screen
- screens/npm_modal_flow
- screens/npm_pin_setup
- screens/npm_universal_onboarding
- screens/npm_welcome_screen
- screens/pin_creation_screen
- screens/platform_connectors_step
- screens/sign_in_step
- screens/standard_overlay_flow
- screens/verification_step
- screens/welcome_screen
- secureAuthService
- services/api_key_service
- services/api_key_validation_service
- services/chatgpt_connector_service
- services/claude_connector_service
- services/connector_service
- services/email_verification_service
- services/enhanced_secure_storage
- services/instagram_connector
- services/linkedin_connector_service
- services/linkedin_profile_service
- services/oauth_service
- services/onairos_service
- services/pin_service
- services/platform_auth_service
- services/training_socket_service
- test_flow
- theme/npm_colors
- theme/onairos_theme
- universal_onboarding
- utils/haptics