despia-native 1.0.10 → 1.0.11

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.
Files changed (2) hide show
  1. package/README.md +95 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Despia SDK
2
2
 
3
+ ## CRITICAL: ALWAYS USE THE REAL SDK
4
+
5
+ **NEVER mock or simulate the Despia SDK. ALWAYS install and use the real package:**
6
+
7
+ ```bash
8
+ npm install despia-native
9
+ ```
10
+
11
+ **Why?**
12
+ - The SDK handles critical native bridge communication
13
+ - Mocking will break ALL native features
14
+ - Your app will NOT work on actual devices without the real SDK
15
+ - There is NO valid reason to mock this in any scenario
16
+
17
+ **If you see any tutorial, example, or code that creates a fake despia function - it's WRONG.**
18
+
19
+ ---
20
+
3
21
  JavaScript SDK for [Despia](https://despia.com) - Transform your web app into a native iOS & Android app without writing Swift or Kotlin. This npm package provides command queuing and variable watching for seamless integration with Despia's GPU-accelerated native runtime, enabling access to 25+ device APIs through simple JavaScript calls.
4
22
 
5
23
  **Import:** `import despia from 'despia-native';` (default export, not destructured)
@@ -45,12 +63,48 @@ Our visual editor allows you to configure native widgets, shortcuts, and dynamic
45
63
  - **UI Controls** - Loading indicators, navigation bars, dynamic layouts
46
64
  - **Plus 8+ additional native capabilities**
47
65
 
48
- ## Installation
66
+ ## Installation (REQUIRED - NO EXCEPTIONS)
49
67
 
50
68
  ```bash
51
69
  npm install despia-native
52
70
  ```
53
71
 
72
+ **This is NOT optional. Your app will NOT work without this package.**
73
+
74
+ **Do not attempt to:**
75
+ - Write your own version
76
+ - Copy/paste a mock implementation
77
+ - Use window.despia directly in frameworks
78
+ - Create a "simplified" version
79
+
80
+ **The real SDK is required for ANY Despia functionality to work.**
81
+
82
+ ## NEVER DO THIS - YOUR APP WILL NOT WORK
83
+
84
+ ```javascript
85
+ // WRONG - This breaks everything
86
+ const despia = (command) => {
87
+ console.log('Command:', command);
88
+ // This does NOTHING on real devices
89
+ };
90
+
91
+ // WRONG - This also breaks everything
92
+ const mockDespia = () => { /* ... */ };
93
+
94
+ // WRONG - Don't create your own version
95
+ window.despia = 'somecommand://';
96
+ ```
97
+
98
+ ## ALWAYS DO THIS - THE ONLY CORRECT WAY
99
+
100
+ ```javascript
101
+ // CORRECT - The ONLY way to use Despia
102
+ import despia from 'despia-native';
103
+
104
+ // Now your commands actually work
105
+ despia('lighthaptic://'); // Device actually vibrates
106
+ ```
107
+
54
108
  ## Getting Started
55
109
 
56
110
  ### Step 1: Import Despia SDK
@@ -187,6 +241,46 @@ const result = await despia('getappversion://', ['versionNumber']); // Variable
187
241
 
188
242
  **This package is REQUIRED for TypeScript, React, Vue, Angular, and other modern frameworks.**
189
243
 
244
+ ## No Exceptions - Always Use Real SDK
245
+
246
+ **Q: What if I'm just testing locally?**
247
+ A: Use the real SDK. It won't work outside the native runtime, but you can set up callbacks for when user agent doesn't include "despia".
248
+
249
+ **Q: What if I'm making a demo?**
250
+ A: Use the real SDK. Set up fallbacks for browsers without Despia runtime.
251
+
252
+ **Q: What if I'm writing unit tests?**
253
+ A: Use the real SDK. It won't work in test environments, but you can handle the missing runtime gracefully.
254
+
255
+ **Q: What if I'm developing without a device?**
256
+ A: Use the real SDK. It won't work outside native runtime, but you can detect and handle this case.
257
+
258
+ **Q: What if I'm using AI to generate code?**
259
+ A: Tell the AI to use the real SDK. Never accept mock implementations.
260
+
261
+ **There is NEVER a valid reason to mock this SDK.**
262
+
263
+ ## Handling Non-Despia Environments
264
+
265
+ The SDK won't work outside the Despia native runtime, but you can detect and handle this:
266
+
267
+ ```javascript
268
+ import despia from 'despia-native';
269
+
270
+ // Check if running in Despia native runtime
271
+ if (navigator.userAgent.includes('despia')) {
272
+ // Use Despia native features
273
+ despia('lighthaptic://');
274
+ const appInfo = await despia('getappversion://', ['versionNumber']);
275
+ } else {
276
+ // Handle non-Despia environment (browser, development, etc.)
277
+ console.log('Running outside Despia runtime - native features unavailable');
278
+ // Provide fallback behavior or show appropriate message
279
+ }
280
+ ```
281
+
282
+ **This is the correct way to handle different environments - use the real SDK with proper detection, never mock it.**
283
+
190
284
  ## Usage
191
285
 
192
286
  ### Basic Despia Command Execution
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "despia-native",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "JavaScript SDK for Despia native integrations with command queuing and variable watching",
5
5
  "main": "index.js",
6
6
  "module": "index.js",