onairos
Version:
The Onairos Library is a collection of functions that enable Applications to connect and communicate data with Onairos Identities via User Authorization. Integration for developers is seamless, simple and effective for all applications. LLM SDK capabiliti
139 lines (109 loc) • 5.59 kB
Markdown
# Changelog
## [2.1.5] - 2024-12-19
### 📱 Mobile Browser Compatibility & OAuth Enhancement
#### ✨ New Features
- **Mobile Browser Support**: Complete mobile browser compatibility with automatic device detection
- Auto-detects mobile devices (`/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i`)
- **Desktop**: Uses popup OAuth windows (`window.open`)
- **Mobile**: Uses redirect OAuth flow (`window.location.href`) to avoid popup blocking
- Mobile OAuth return handling with state cleanup
- Same React components work perfectly across all platforms
- **Enhanced OAuth Flow**: Robust OAuth implementation for all 9 platforms
- All connectors use correct `api2.onairos.uk/{platform}/authorize` endpoints
- Improved error handling and connection state management
- Added timeout handling (5-minute OAuth timeout)
- Better logging and debugging information
#### 🔧 Technical Improvements
- **Mobile Detection**: Added `isMobileDevice()` function with user agent + screen size detection
- **OAuth State Management**: Proper localStorage handling for mobile redirect flows
- **URL Parameter Cleanup**: Removes OAuth parameters after successful authentication
- **Cross-Platform Components**: Enhanced mobile components work in mobile browsers too
- **Touch Optimization**: Proper `touchAction` CSS and touch event handling
#### 📚 Documentation
- **Mobile Browser Compatibility Guide**: Comprehensive guide explaining what works and what doesn't
- **LLM Context File**: Added `llm.txt` with complete package overview and usage patterns
- **OAuth Testing**: Enhanced test files with mobile compatibility indicators
#### 🛠️ Bug Fixes
- **Popup Blocking**: Fixed OAuth popup blocking issues on mobile browsers
- **API Consistency**: All endpoints consistently use `api2.onairos.uk` domain
- **Mobile UX**: Improved touch targets and responsive design
## [2.0.0] - 2024-01-15
### 🚀 Major Release - Simplified Integration & Enhanced UX
#### ✨ New Features
- **Popup-based Data Requests**: Completely redesigned iframe implementation using popup windows
- Fixes display cutoff issues seen in previous versions
- Better positioning and sizing (450x700px)
- Proper focus management and cross-browser compatibility
- **AutoFetch by Default**: Automatic API calls after user approval
- No more manual event handling required
- API responses included directly in onComplete callback
- Configurable with `autoFetch` prop (default: true)
- **Simplified OnairosButton Component**: Much cleaner integration
```jsx
// Before v2.0 (complex)
<Onairos requestData={complexRequestObject} webpageName={webpageName} />
// + manual event listeners for API handling
// After v2.0 (simple)
<OnairosButton
requestData={['email', 'profile']}
webpageName="My App"
onComplete={(result) => console.log(result.apiResponse)}
/>
```
#### 🎨 Enhanced User Experience
- **Real-time Status Updates**: Loading states and progress indicators
- **Better Error Handling**: User-friendly error messages and retry logic
- **Visual Feedback**: Selection summaries and confirmation states
- **Smart Button Text**: Adapts based on autoFetch setting
#### 🔧 Technical Improvements
- **Robust Popup Communication**: Improved postMessage handling with retry logic
- **Memory Management**: Proper cleanup of event listeners and popup references
- **TypeScript Support**: Updated type definitions for new API
- **Cross-browser Compatibility**: Tested on Chrome 80+, Firefox 75+, Safari 13+, Edge 80+
#### 📚 Documentation
- **Comprehensive README**: Updated with simple usage examples
- **Migration Guide**: Clear path from v1.x to v2.0
- **Implementation Guide**: Detailed popup implementation documentation
- **Test Files**: Example implementations for testing
#### 🔄 API Changes
- **New Response Format**: Includes apiResponse and apiError fields when autoFetch is enabled
- **Simplified Props**: Array-based requestData instead of complex objects
- **Backward Compatibility**: Legacy format still documented for reference
#### 🐛 Bug Fixes
- Fixed iframe cutoff issues with popup implementation
- Improved error handling for blocked popups
- Better handling of API failures and network issues
- Fixed memory leaks with proper cleanup
### Migration from v1.x
**Installation remains the same:**
```bash
npm install onairos
```
**Simple migration example:**
```jsx
// v1.x (complex)
const requestData = {
Small: { type: "Personality", descriptions: "...", reward: "..." },
Medium: { type: "Personality", descriptions: "...", reward: "..." },
Large: { type: "Personality", descriptions: "...", reward: "..." }
};
// v2.0 (simple)
const requestData = ['email', 'profile', 'social'];
```
For detailed migration instructions, see the [README.md](./README.md#migration-from-v1x).
---
## [1.0.17] - Previous Release
### Features
- Initial iframe implementation
- Manual API handling with window.sendMessage
- Complex request object format
- Extension-based data requests
### Known Issues
- Iframe display cutoff problems
- Complex integration requiring manual event handling
- Limited error handling capabilities
---
## Development Notes
- **Breaking Changes**: v2.0.0 introduces significant API simplifications
- **Backward Compatibility**: Legacy documentation preserved for reference
- **Future Plans**: Enhanced mobile support, offline capabilities, custom API endpoints