onairos 1.0.13 → 2.0.1
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/CHANGELOG.md +104 -0
- package/GITBOOK_OVERVIEW.md +123 -0
- package/POPUP_IMPLEMENTATION_README.md +252 -0
- package/README.md +187 -196
- package/dist/data_request_popup.html +321 -0
- package/dist/iframe.bundle.js +1 -1
- package/dist/iframe.bundle.js.map +1 -1
- package/dist/onairos.bundle.js +7 -1
- package/dist/onairos.bundle.js.map +1 -1
- package/dist/onairos.esm.js +7 -1
- package/dist/onairos.esm.js.map +1 -1
- package/onairos.d.ts +31 -2
- package/package.json +17 -8
- package/public/data_request_popup.html +321 -0
- package/src/components/DataRequest.js +205 -120
- package/src/components/PinSetup.js +90 -160
- package/src/components/UniversalOnboarding.js +128 -358
- package/src/iframe/dataRequestHandler.js +352 -73
- package/src/onairos.jsx +16 -0
- package/src/onairosButton.jsx +138 -40
- package/test-entry-points.html +64 -0
- package/test-fixed-flow.html +86 -0
- package/test-popup-implementation.html +167 -0
- package/webpack.config.js +25 -0
- package/dist/main.bundle.js +0 -2
- package/dist/main.bundle.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2.0.0] - 2024-01-15
|
|
4
|
+
|
|
5
|
+
### 🚀 Major Release - Simplified Integration & Enhanced UX
|
|
6
|
+
|
|
7
|
+
#### ✨ New Features
|
|
8
|
+
- **Popup-based Data Requests**: Completely redesigned iframe implementation using popup windows
|
|
9
|
+
- Fixes display cutoff issues seen in previous versions
|
|
10
|
+
- Better positioning and sizing (450x700px)
|
|
11
|
+
- Proper focus management and cross-browser compatibility
|
|
12
|
+
|
|
13
|
+
- **AutoFetch by Default**: Automatic API calls after user approval
|
|
14
|
+
- No more manual event handling required
|
|
15
|
+
- API responses included directly in onComplete callback
|
|
16
|
+
- Configurable with `autoFetch` prop (default: true)
|
|
17
|
+
|
|
18
|
+
- **Simplified OnairosButton Component**: Much cleaner integration
|
|
19
|
+
```jsx
|
|
20
|
+
// Before v2.0 (complex)
|
|
21
|
+
<Onairos requestData={complexRequestObject} webpageName={webpageName} />
|
|
22
|
+
// + manual event listeners for API handling
|
|
23
|
+
|
|
24
|
+
// After v2.0 (simple)
|
|
25
|
+
<OnairosButton
|
|
26
|
+
requestData={['email', 'profile']}
|
|
27
|
+
webpageName="My App"
|
|
28
|
+
onComplete={(result) => console.log(result.apiResponse)}
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### 🎨 Enhanced User Experience
|
|
33
|
+
- **Real-time Status Updates**: Loading states and progress indicators
|
|
34
|
+
- **Better Error Handling**: User-friendly error messages and retry logic
|
|
35
|
+
- **Visual Feedback**: Selection summaries and confirmation states
|
|
36
|
+
- **Smart Button Text**: Adapts based on autoFetch setting
|
|
37
|
+
|
|
38
|
+
#### 🔧 Technical Improvements
|
|
39
|
+
- **Robust Popup Communication**: Improved postMessage handling with retry logic
|
|
40
|
+
- **Memory Management**: Proper cleanup of event listeners and popup references
|
|
41
|
+
- **TypeScript Support**: Updated type definitions for new API
|
|
42
|
+
- **Cross-browser Compatibility**: Tested on Chrome 80+, Firefox 75+, Safari 13+, Edge 80+
|
|
43
|
+
|
|
44
|
+
#### 📚 Documentation
|
|
45
|
+
- **Comprehensive README**: Updated with simple usage examples
|
|
46
|
+
- **Migration Guide**: Clear path from v1.x to v2.0
|
|
47
|
+
- **Implementation Guide**: Detailed popup implementation documentation
|
|
48
|
+
- **Test Files**: Example implementations for testing
|
|
49
|
+
|
|
50
|
+
#### 🔄 API Changes
|
|
51
|
+
- **New Response Format**: Includes apiResponse and apiError fields when autoFetch is enabled
|
|
52
|
+
- **Simplified Props**: Array-based requestData instead of complex objects
|
|
53
|
+
- **Backward Compatibility**: Legacy format still documented for reference
|
|
54
|
+
|
|
55
|
+
#### 🐛 Bug Fixes
|
|
56
|
+
- Fixed iframe cutoff issues with popup implementation
|
|
57
|
+
- Improved error handling for blocked popups
|
|
58
|
+
- Better handling of API failures and network issues
|
|
59
|
+
- Fixed memory leaks with proper cleanup
|
|
60
|
+
|
|
61
|
+
### Migration from v1.x
|
|
62
|
+
|
|
63
|
+
**Installation remains the same:**
|
|
64
|
+
```bash
|
|
65
|
+
npm install onairos
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Simple migration example:**
|
|
69
|
+
```jsx
|
|
70
|
+
// v1.x (complex)
|
|
71
|
+
const requestData = {
|
|
72
|
+
Small: { type: "Personality", descriptions: "...", reward: "..." },
|
|
73
|
+
Medium: { type: "Personality", descriptions: "...", reward: "..." },
|
|
74
|
+
Large: { type: "Personality", descriptions: "...", reward: "..." }
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// v2.0 (simple)
|
|
78
|
+
const requestData = ['email', 'profile', 'social'];
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
For detailed migration instructions, see the [README.md](./README.md#migration-from-v1x).
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## [1.0.17] - Previous Release
|
|
86
|
+
|
|
87
|
+
### Features
|
|
88
|
+
- Initial iframe implementation
|
|
89
|
+
- Manual API handling with window.sendMessage
|
|
90
|
+
- Complex request object format
|
|
91
|
+
- Extension-based data requests
|
|
92
|
+
|
|
93
|
+
### Known Issues
|
|
94
|
+
- Iframe display cutoff problems
|
|
95
|
+
- Complex integration requiring manual event handling
|
|
96
|
+
- Limited error handling capabilities
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Development Notes
|
|
101
|
+
|
|
102
|
+
- **Breaking Changes**: v2.0.0 introduces significant API simplifications
|
|
103
|
+
- **Backward Compatibility**: Legacy documentation preserved for reference
|
|
104
|
+
- **Future Plans**: Enhanced mobile support, offline capabilities, custom API endpoints
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# LLM Memory SDK
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Onairos LLM Memory SDK provides a unified interface for OpenAI, Anthropic Claude, and Google Gemini APIs with built-in **Retrieval-Augmented Generation (RAG)** capabilities. This enables AI models to remember and personalize interactions across sessions while maintaining user privacy.
|
|
6
|
+
|
|
7
|
+
## Key Features
|
|
8
|
+
|
|
9
|
+
### 🔗 **Unified API**
|
|
10
|
+
- Single interface for multiple LLM providers (OpenAI, Anthropic, Google)
|
|
11
|
+
- Drop-in replacement for existing OpenAI implementations
|
|
12
|
+
- Seamless model switching between providers
|
|
13
|
+
|
|
14
|
+
### 🧠 **Memory Enhancement**
|
|
15
|
+
- Automatic extraction and storage of meaningful user context
|
|
16
|
+
- RAG-powered personalization for more relevant responses
|
|
17
|
+
- Privacy-focused memory storage (insights, not raw conversations)
|
|
18
|
+
|
|
19
|
+
### 🔐 **Session Management**
|
|
20
|
+
- JWT-based user authentication and isolation
|
|
21
|
+
- Secure session tokens with configurable expiration
|
|
22
|
+
- Guest and authenticated user support
|
|
23
|
+
|
|
24
|
+
### 📊 **Vector Storage**
|
|
25
|
+
- Pinecone integration for semantic memory search
|
|
26
|
+
- Intelligent context retrieval based on query similarity
|
|
27
|
+
- Scalable memory management with user isolation
|
|
28
|
+
|
|
29
|
+
## How It Works
|
|
30
|
+
|
|
31
|
+
```mermaid
|
|
32
|
+
graph LR
|
|
33
|
+
A[User Query] --> B[Session Validation]
|
|
34
|
+
B --> C[Memory Retrieval]
|
|
35
|
+
C --> D[Context Injection]
|
|
36
|
+
D --> E[LLM API Call]
|
|
37
|
+
E --> F[Response Generation]
|
|
38
|
+
F --> G[Memory Extraction]
|
|
39
|
+
G --> H[Vector Storage]
|
|
40
|
+
H --> I[Enhanced Response]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
1. **Authentication**: Validate user session with JWT tokens
|
|
44
|
+
2. **Memory Retrieval**: Search vector database for relevant user context
|
|
45
|
+
3. **Context Enhancement**: Inject retrieved memories into the prompt
|
|
46
|
+
4. **LLM Processing**: Send enhanced prompt to chosen LLM provider
|
|
47
|
+
5. **Memory Storage**: Extract and store meaningful insights for future use
|
|
48
|
+
|
|
49
|
+
## Quick Start
|
|
50
|
+
|
|
51
|
+
### Installation
|
|
52
|
+
```bash
|
|
53
|
+
npm install onairos
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Basic Usage
|
|
57
|
+
```javascript
|
|
58
|
+
import { OnairosClient } from 'onairos';
|
|
59
|
+
|
|
60
|
+
const onairos = new OnairosClient({
|
|
61
|
+
openaiApiKey: process.env.OPENAI_API_KEY,
|
|
62
|
+
pineconeApiKey: process.env.PINECONE_API_KEY,
|
|
63
|
+
pineconeEnvironment: process.env.PINECONE_ENVIRONMENT,
|
|
64
|
+
jwtSecret: process.env.JWT_SECRET
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
await onairos.initialize();
|
|
68
|
+
|
|
69
|
+
const userId = 'user-123';
|
|
70
|
+
const sessionToken = onairos.generateSessionToken(userId);
|
|
71
|
+
|
|
72
|
+
const response = await onairos.completions({
|
|
73
|
+
model: 'gpt-4',
|
|
74
|
+
messages: [{ role: 'user', content: 'What should I learn next?' }],
|
|
75
|
+
userId,
|
|
76
|
+
sessionToken
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Use Cases
|
|
81
|
+
|
|
82
|
+
### **Personalized AI Assistants**
|
|
83
|
+
- Remember user preferences and communication style
|
|
84
|
+
- Provide contextually relevant recommendations
|
|
85
|
+
- Maintain conversation continuity across sessions
|
|
86
|
+
|
|
87
|
+
### **Educational Platforms**
|
|
88
|
+
- Track learning progress and knowledge gaps
|
|
89
|
+
- Personalize curriculum based on user background
|
|
90
|
+
- Remember previous explanations and adjust complexity
|
|
91
|
+
|
|
92
|
+
### **Customer Support**
|
|
93
|
+
- Recall customer history and preferences
|
|
94
|
+
- Provide consistent experience across interactions
|
|
95
|
+
- Reduce repetitive information gathering
|
|
96
|
+
|
|
97
|
+
### **Content Creation**
|
|
98
|
+
- Remember brand voice and style preferences
|
|
99
|
+
- Maintain consistency in generated content
|
|
100
|
+
- Learn from user feedback and corrections
|
|
101
|
+
|
|
102
|
+
## Benefits
|
|
103
|
+
|
|
104
|
+
✅ **Enhanced User Experience** - Personalized, context-aware responses
|
|
105
|
+
✅ **Privacy Protection** - Stores insights, not raw conversations
|
|
106
|
+
✅ **Easy Integration** - Drop-in replacement for existing OpenAI code
|
|
107
|
+
✅ **Multi-Provider Support** - Choose the best model for each task
|
|
108
|
+
✅ **Scalable Architecture** - Built for production environments
|
|
109
|
+
✅ **Session Security** - JWT-based authentication and user isolation
|
|
110
|
+
|
|
111
|
+
## Components
|
|
112
|
+
|
|
113
|
+
- **OnairosClient** - Main SDK interface with RAG capabilities
|
|
114
|
+
- **LLMWrapper** - Unified API for multiple LLM providers
|
|
115
|
+
- **MemoryManager** - Vector storage and retrieval system
|
|
116
|
+
- **SessionManager** - JWT authentication and user management
|
|
117
|
+
- **extractMemory** - Intelligent memory extraction utilities
|
|
118
|
+
|
|
119
|
+
## Getting Started
|
|
120
|
+
|
|
121
|
+
Ready to add memory to your AI applications? Check out our [complete documentation](https://docs.onairos.uk) and [API reference](https://docs.onairos.uk/api) to get started.
|
|
122
|
+
|
|
123
|
+
For support, visit [support@onairos.uk](mailto:support@onairos.uk) or our [GitHub repository](https://github.com/zd819/onairos-npm).
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# Onairos Popup Implementation & AutoFetch
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This document describes the redesigned iframe implementation that now uses a popup window approach to fix display cutoff issues and introduces automatic API fetching functionality.
|
|
6
|
+
|
|
7
|
+
## Problem Solved
|
|
8
|
+
|
|
9
|
+
**Previous Issue**: The iframe modal overlay was being cut off and not displaying properly, as shown in user feedback.
|
|
10
|
+
|
|
11
|
+
**Solution**: Replaced the modal overlay with a properly positioned popup window that:
|
|
12
|
+
- Opens in a separate window with optimal positioning
|
|
13
|
+
- Avoids being cut off by parent container constraints
|
|
14
|
+
- Provides better user experience with dedicated window space
|
|
15
|
+
- Automatically handles API calls when data is approved
|
|
16
|
+
|
|
17
|
+
## Key Features
|
|
18
|
+
|
|
19
|
+
### 1. Popup Window Implementation
|
|
20
|
+
- **Proper Positioning**: Centers popup on screen while ensuring it fits within screen bounds
|
|
21
|
+
- **Optimal Sizing**: 450x700px window size for comfortable data selection
|
|
22
|
+
- **Focus Management**: Automatically brings popup to focus when opened
|
|
23
|
+
- **Cross-browser Compatibility**: Works across different browsers and contexts
|
|
24
|
+
|
|
25
|
+
### 2. AutoFetch Functionality (Default: Enabled)
|
|
26
|
+
- **Automatic API Calls**: When `autoFetch` is `true` (default), API calls are made automatically after user approves data
|
|
27
|
+
- **Real-time Status**: Shows loading states and API response status
|
|
28
|
+
- **Error Handling**: Gracefully handles API failures with user-friendly messages
|
|
29
|
+
- **Configurable**: Can be disabled by setting `autoFetch: false`
|
|
30
|
+
|
|
31
|
+
### 3. Enhanced User Experience
|
|
32
|
+
- **Visual Feedback**: Loading spinners and status indicators
|
|
33
|
+
- **Selection Summary**: Shows count of selected data types
|
|
34
|
+
- **Smart Buttons**: Buttons adapt based on autoFetch setting
|
|
35
|
+
- **Responsive Design**: Works well on different screen sizes
|
|
36
|
+
|
|
37
|
+
## Implementation Details
|
|
38
|
+
|
|
39
|
+
### Files Modified/Created
|
|
40
|
+
|
|
41
|
+
1. **`src/iframe/dataRequestHandler.js`** - Updated popup handler with autoFetch support
|
|
42
|
+
2. **`src/onairosButton.jsx`** - Modified to use popup instead of modal overlay
|
|
43
|
+
3. **`src/components/DataRequest.js`** - Enhanced with autoFetch functionality
|
|
44
|
+
4. **`public/data_request_popup.html`** - New standalone popup HTML file
|
|
45
|
+
5. **`onairos.d.ts`** - Updated TypeScript definitions
|
|
46
|
+
|
|
47
|
+
### Key Functions
|
|
48
|
+
|
|
49
|
+
#### `openDataRequestPopup(data)`
|
|
50
|
+
```javascript
|
|
51
|
+
const popup = openDataRequestPopup({
|
|
52
|
+
requestData: ['email', 'profile'],
|
|
53
|
+
webpageName: 'My App',
|
|
54
|
+
userData: { email: 'user@example.com' },
|
|
55
|
+
autoFetch: true,
|
|
56
|
+
proofMode: false
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### `listenForPopupMessages(callback, options)`
|
|
61
|
+
```javascript
|
|
62
|
+
const cleanup = listenForPopupMessages(
|
|
63
|
+
handlePopupMessage,
|
|
64
|
+
{
|
|
65
|
+
autoFetch: true,
|
|
66
|
+
onApiResponse: handleApiResponse
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Usage Examples
|
|
72
|
+
|
|
73
|
+
### Basic Usage (AutoFetch Enabled)
|
|
74
|
+
```jsx
|
|
75
|
+
<OnairosButton
|
|
76
|
+
requestData={['email', 'profile', 'social']}
|
|
77
|
+
webpageName="My Application"
|
|
78
|
+
autoFetch={true} // Default
|
|
79
|
+
onComplete={(result) => {
|
|
80
|
+
console.log('Data approved:', result.approved);
|
|
81
|
+
console.log('API Response:', result.apiResponse);
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Manual API Handling (AutoFetch Disabled)
|
|
87
|
+
```jsx
|
|
88
|
+
<OnairosButton
|
|
89
|
+
requestData={['email', 'profile']}
|
|
90
|
+
webpageName="My Application"
|
|
91
|
+
autoFetch={false}
|
|
92
|
+
onComplete={(result) => {
|
|
93
|
+
if (result.approved) {
|
|
94
|
+
// Handle approved data manually
|
|
95
|
+
makeCustomApiCall(result.dataTypes);
|
|
96
|
+
}
|
|
97
|
+
}}
|
|
98
|
+
/>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## API Response Format
|
|
102
|
+
|
|
103
|
+
When `autoFetch` is enabled, the `onComplete` callback receives:
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
{
|
|
107
|
+
approved: ['email', 'profile'], // Array of approved data types
|
|
108
|
+
timestamp: "2024-01-15T10:30:00.000Z",
|
|
109
|
+
userEmail: "user@example.com",
|
|
110
|
+
appName: "My Application",
|
|
111
|
+
apiResponse: { /* API response data */ }, // Present on success
|
|
112
|
+
apiError: "Error message", // Present on API failure
|
|
113
|
+
apiUrl: "https://api2.onairos.uk/inferenceTest"
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Configuration Options
|
|
118
|
+
|
|
119
|
+
### OnairosButton Props
|
|
120
|
+
- `autoFetch` (boolean, default: `true`) - Enable automatic API calls
|
|
121
|
+
- `requestData` (array) - Specific data types to request
|
|
122
|
+
- `webpageName` (string) - Application name shown to user
|
|
123
|
+
- `onComplete` (function) - Callback when data request completes
|
|
124
|
+
- `proofMode` (boolean) - Enable proof mode for verification
|
|
125
|
+
|
|
126
|
+
### Popup Handler Options
|
|
127
|
+
- `autoFetch` (boolean) - Whether to make automatic API calls
|
|
128
|
+
- `onApiResponse` (function) - Callback for API responses
|
|
129
|
+
|
|
130
|
+
## Error Handling
|
|
131
|
+
|
|
132
|
+
The implementation includes comprehensive error handling:
|
|
133
|
+
|
|
134
|
+
1. **Popup Blocked**: Shows user-friendly message about enabling popups
|
|
135
|
+
2. **API Failures**: Displays error messages in the UI
|
|
136
|
+
3. **Network Issues**: Graceful degradation with retry logic
|
|
137
|
+
4. **Invalid Data**: Validation before API calls
|
|
138
|
+
|
|
139
|
+
## Testing
|
|
140
|
+
|
|
141
|
+
Use the provided test file to verify the implementation:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Open the test file in a browser
|
|
145
|
+
open test-popup-implementation.html
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The test demonstrates:
|
|
149
|
+
- Popup opening and positioning
|
|
150
|
+
- Data selection interface
|
|
151
|
+
- AutoFetch functionality
|
|
152
|
+
- API response handling
|
|
153
|
+
- Error scenarios
|
|
154
|
+
|
|
155
|
+
## Migration Guide
|
|
156
|
+
|
|
157
|
+
### From Modal to Popup
|
|
158
|
+
|
|
159
|
+
**Before (Modal)**:
|
|
160
|
+
```javascript
|
|
161
|
+
// Modal was embedded in page
|
|
162
|
+
setShowOverlay(true);
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**After (Popup)**:
|
|
166
|
+
```javascript
|
|
167
|
+
// Popup opens in separate window
|
|
168
|
+
const popup = openDataRequestPopup(data);
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### AutoFetch Integration
|
|
172
|
+
|
|
173
|
+
**Before (Manual API)**:
|
|
174
|
+
```javascript
|
|
175
|
+
onComplete={(result) => {
|
|
176
|
+
if (result.approved) {
|
|
177
|
+
fetch('/api/process', {
|
|
178
|
+
method: 'POST',
|
|
179
|
+
body: JSON.stringify(result.dataTypes)
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**After (AutoFetch)**:
|
|
186
|
+
```javascript
|
|
187
|
+
onComplete={(result) => {
|
|
188
|
+
// API call already made automatically
|
|
189
|
+
console.log('API Response:', result.apiResponse);
|
|
190
|
+
}}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Browser Compatibility
|
|
194
|
+
|
|
195
|
+
- ✅ Chrome 80+
|
|
196
|
+
- ✅ Firefox 75+
|
|
197
|
+
- ✅ Safari 13+
|
|
198
|
+
- ✅ Edge 80+
|
|
199
|
+
|
|
200
|
+
## Security Considerations
|
|
201
|
+
|
|
202
|
+
1. **Cross-Origin Messaging**: Uses `postMessage` with origin validation
|
|
203
|
+
2. **Popup Blocking**: Graceful handling of popup blockers
|
|
204
|
+
3. **Data Validation**: Validates all data before API calls
|
|
205
|
+
4. **HTTPS Required**: API calls require secure connections
|
|
206
|
+
|
|
207
|
+
## Performance
|
|
208
|
+
|
|
209
|
+
- **Lazy Loading**: Popup HTML loaded only when needed
|
|
210
|
+
- **Efficient Messaging**: Minimal data transfer between windows
|
|
211
|
+
- **Memory Management**: Proper cleanup of event listeners
|
|
212
|
+
- **API Optimization**: Single API call per approval
|
|
213
|
+
|
|
214
|
+
## Troubleshooting
|
|
215
|
+
|
|
216
|
+
### Common Issues
|
|
217
|
+
|
|
218
|
+
1. **Popup Blocked**
|
|
219
|
+
- Solution: Ensure popups are allowed for the domain
|
|
220
|
+
- Check browser popup blocker settings
|
|
221
|
+
|
|
222
|
+
2. **API Calls Failing**
|
|
223
|
+
- Verify network connectivity
|
|
224
|
+
- Check API endpoint availability
|
|
225
|
+
- Review CORS settings
|
|
226
|
+
|
|
227
|
+
3. **Data Not Passing**
|
|
228
|
+
- Ensure popup loads completely before sending data
|
|
229
|
+
- Check browser console for errors
|
|
230
|
+
|
|
231
|
+
### Debug Mode
|
|
232
|
+
|
|
233
|
+
Enable debug logging:
|
|
234
|
+
```javascript
|
|
235
|
+
localStorage.setItem('onairos-debug', 'true');
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Future Enhancements
|
|
239
|
+
|
|
240
|
+
- [ ] Offline support with request queuing
|
|
241
|
+
- [ ] Custom API endpoint configuration
|
|
242
|
+
- [ ] Batch API requests for multiple approvals
|
|
243
|
+
- [ ] Enhanced analytics and tracking
|
|
244
|
+
- [ ] Mobile-optimized popup sizing
|
|
245
|
+
|
|
246
|
+
## Support
|
|
247
|
+
|
|
248
|
+
For issues or questions:
|
|
249
|
+
1. Check the troubleshooting section
|
|
250
|
+
2. Review browser console for errors
|
|
251
|
+
3. Test with the provided test file
|
|
252
|
+
4. Contact support with detailed error information
|