despia-native 1.0.24 → 1.0.26
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 +35 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
JavaScript SDK for [Despia](https://despia.com). Build with any web framework, access 50+ native device capabilities through a single JavaScript function, and publish to iOS and Android from a browser. No Swift, no Kotlin, no terminal.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/despia-native)
|
|
6
|
-
[](LICENSE)
|
|
6
|
+
[](https://github.com/despia-native/despia-native/blob/main/LICENSE)
|
|
7
7
|
|
|
8
8
|
**[Documentation](https://setup.despia.com)** | **[AI Agent Index](https://setup.despia.com/llms.txt)** | **[iOS Deployment](https://setup.despia.com/deployment/apple-ios/automatic)** | **[Android Deployment](https://setup.despia.com/deployment/google-android/automatic)**
|
|
9
9
|
|
|
@@ -17,8 +17,11 @@ The runtime runs on WKWebView (iOS) and the Chromium-based WebView (Android) wit
|
|
|
17
17
|
|
|
18
18
|
Add the Despia MCP to give your AI assistant full knowledge of the `despia-native` API.
|
|
19
19
|
|
|
20
|
-
[
|
|
21
|
-
|
|
20
|
+
[**Install in Cursor**](cursor://anysphere.cursor-deeplink/mcp/install?name=Despia&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vc2V0dXAuZGVzcGlhLmNvbS9tY3AifQ==) · [**Install in VS Code**](vscode:mcp/install?%7B%22name%22%3A%22Despia%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fsetup.despia.com%2Fmcp%22%7D)
|
|
21
|
+
|
|
22
|
+
Full manual steps and other editors: [MCP Server setup guide](https://setup.despia.com/mcp-server).
|
|
23
|
+
|
|
24
|
+
**Web-based builders** (Lovable, Bolt, v0, etc.) — paste the MCP URL where your tool asks for it:
|
|
22
25
|
|
|
23
26
|
```
|
|
24
27
|
https://setup.despia.com/mcp
|
|
@@ -225,6 +228,8 @@ despia('warninghaptic://'); // Attention alert
|
|
|
225
228
|
despia('errorhaptic://'); // Negative feedback
|
|
226
229
|
```
|
|
227
230
|
|
|
231
|
+
[Read Full Documentation](https://setup.despia.com/native-features/haptic-feedback)
|
|
232
|
+
|
|
228
233
|
---
|
|
229
234
|
|
|
230
235
|
### Identity Vault
|
|
@@ -292,6 +297,8 @@ async function checkTrialEligibility() {
|
|
|
292
297
|
}
|
|
293
298
|
```
|
|
294
299
|
|
|
300
|
+
[Read Full Documentation](https://setup.despia.com/native-features/storage-vault) + [Read Full Documentation](https://setup.despia.com/native-features/biometrics)
|
|
301
|
+
|
|
295
302
|
---
|
|
296
303
|
|
|
297
304
|
### GPS Location
|
|
@@ -320,7 +327,7 @@ despia('location://?server=https://api.example.com/track?user=USER_ID&buffer=30&
|
|
|
320
327
|
|
|
321
328
|
Each POST body matches the location object shape returned by `stoplocation://`.
|
|
322
329
|
|
|
323
|
-
Full
|
|
330
|
+
[Read Full Documentation](https://setup.despia.com/native-features/gps-location)
|
|
324
331
|
|
|
325
332
|
---
|
|
326
333
|
|
|
@@ -390,7 +397,7 @@ if (isDespia) {
|
|
|
390
397
|
}
|
|
391
398
|
```
|
|
392
399
|
|
|
393
|
-
Full
|
|
400
|
+
[Read Full Documentation](https://setup.despia.com/native-features/revenuecat/introduction) + [API reference](https://setup.despia.com/native-features/revenuecat/reference)
|
|
394
401
|
|
|
395
402
|
---
|
|
396
403
|
|
|
@@ -446,7 +453,7 @@ despia('appsflyer://log_event?event_name=onboarding_step&event_values=' + encode
|
|
|
446
453
|
|
|
447
454
|
`event_values` must always be `JSON.stringify()`ed and `encodeURIComponent()`ed. Event names are case-sensitive, lowercase alphanumeric and underscores only, max 300 unique names per day.
|
|
448
455
|
|
|
449
|
-
Full
|
|
456
|
+
[Read Full Documentation](https://setup.despia.com/analytics/appsflyer/introduction) + [Read Full Documentation](https://setup.despia.com/analytics/appsflyer/attribution)
|
|
450
457
|
|
|
451
458
|
---
|
|
452
459
|
|
|
@@ -488,7 +495,7 @@ await fetch('https://onesignal.com/api/v1/notifications', {
|
|
|
488
495
|
});
|
|
489
496
|
```
|
|
490
497
|
|
|
491
|
-
When configuring OneSignal, select **Native iOS** and **Native Android** as the platforms.
|
|
498
|
+
When configuring OneSignal, select **Native iOS** and **Native Android** as the platforms. See [Read Full Documentation](https://setup.despia.com/native-features/onesignal/introduction) + [API reference](https://setup.despia.com/native-features/onesignal/reference) for setup, critical alerts (including Time Sensitive / Do Not Disturb), schemes, backend delivery, and targeting.
|
|
492
499
|
|
|
493
500
|
---
|
|
494
501
|
|
|
@@ -565,7 +572,7 @@ When Despia navigates the WebView to `/auth`, if that route is already active yo
|
|
|
565
572
|
- Vue: use `watch: { '$route.query': { immediate: true, handler } }` instead of reading params in `mounted()`
|
|
566
573
|
- Vanilla JS: call your handler on load and add `window.addEventListener('popstate', handler)`
|
|
567
574
|
|
|
568
|
-
Full
|
|
575
|
+
[Read Full Documentation](https://setup.despia.com/native-features/oauth/introduction)
|
|
569
576
|
|
|
570
577
|
---
|
|
571
578
|
|
|
@@ -575,6 +582,8 @@ Full docs: [https://setup.despia.com/native-features/o-auth-2-0](https://setup.d
|
|
|
575
582
|
const { clipboarddata } = await despia('getclipboard://', ['clipboarddata']);
|
|
576
583
|
```
|
|
577
584
|
|
|
585
|
+
[Read Full Documentation](https://setup.despia.com/native-features/clipboard)
|
|
586
|
+
|
|
578
587
|
---
|
|
579
588
|
|
|
580
589
|
### Contacts
|
|
@@ -583,6 +592,8 @@ const { clipboarddata } = await despia('getclipboard://', ['clipboarddata']);
|
|
|
583
592
|
const { contacts } = await despia('readcontacts://', ['contacts']);
|
|
584
593
|
```
|
|
585
594
|
|
|
595
|
+
[Read Full Documentation](https://setup.despia.com/native-features/contact-access)
|
|
596
|
+
|
|
586
597
|
---
|
|
587
598
|
|
|
588
599
|
### App Information and Device Data
|
|
@@ -594,6 +605,8 @@ const { storeLocation } = await despia('getstorelocation://', ['storeLoc
|
|
|
594
605
|
const { trackingDisabled } = await despia('user-disable-tracking://', ['trackingDisabled']);
|
|
595
606
|
```
|
|
596
607
|
|
|
608
|
+
[Read Full Documentation](https://setup.despia.com/native-features/device-indexing) + [Read Full Documentation](https://setup.despia.com/native-features/store-location) + [Read Full Documentation](https://setup.despia.com/native-features/app-privacy)
|
|
609
|
+
|
|
597
610
|
---
|
|
598
611
|
|
|
599
612
|
### UI Controls and Styling
|
|
@@ -609,6 +622,8 @@ despia('settingsapp://'); // Open native app settings
|
|
|
609
622
|
despia('reset://'); // Reset the app
|
|
610
623
|
```
|
|
611
624
|
|
|
625
|
+
[Read Full Documentation](https://setup.despia.com/native-features/safe-areas) + [Read Full Documentation](https://setup.despia.com/native-features/app-settings)
|
|
626
|
+
|
|
612
627
|
---
|
|
613
628
|
|
|
614
629
|
### File and Media Operations
|
|
@@ -639,6 +654,8 @@ despia('shareapp://message?=Check%20out%20this%20app&url=https://myapp.com');
|
|
|
639
654
|
despia('scanningmode://auto'); // auto | on | off
|
|
640
655
|
```
|
|
641
656
|
|
|
657
|
+
[Read Full Documentation](https://setup.despia.com/native-features/file-sharing) + [Read Full Documentation](https://setup.despia.com/native-features/camera-roll)
|
|
658
|
+
|
|
642
659
|
---
|
|
643
660
|
|
|
644
661
|
### Apple Health (HealthKit)
|
|
@@ -658,7 +675,7 @@ despia('writehealthkit://HKQuantityTypeIdentifierBodyMass//74.5');
|
|
|
658
675
|
despia('healthkit://observe?types=HKQuantityTypeIdentifierStepCount&frequency=hourly&server=https://api.example.com/webhook?user=USER_ID');
|
|
659
676
|
```
|
|
660
677
|
|
|
661
|
-
Pass any valid `HKQuantityTypeIdentifier`, `HKCategoryTypeIdentifier`, `HKWorkoutTypeIdentifier`, or `HKCharacteristicTypeIdentifier` directly. Sleep, workouts, heart rate, body mass, and all other HealthKit types are supported. Full
|
|
678
|
+
Pass any valid `HKQuantityTypeIdentifier`, `HKCategoryTypeIdentifier`, `HKWorkoutTypeIdentifier`, or `HKCharacteristicTypeIdentifier` directly. Sleep, workouts, heart rate, body mass, and all other HealthKit types are supported. [Read Full Documentation](https://setup.despia.com/health-data/apple-health).
|
|
662
679
|
|
|
663
680
|
---
|
|
664
681
|
|
|
@@ -683,7 +700,7 @@ Once enabled, serve ads using standard AdSense, Google Publisher Tag, or IMA for
|
|
|
683
700
|
|
|
684
701
|
Because ads are real DOM elements, placements that are impossible with native overlay ads — banners between feed cards, mid-article units, rewarded content gates, pre-roll video — are straightforward CSS and JavaScript.
|
|
685
702
|
|
|
686
|
-
Google WebView API for Ads references: [iOS](https://developers.google.com/admob/ios/browser/webview/api-for-ads) | [Android](https://developers.google.com/admob/android/browser/webview/api-for-ads) | Full
|
|
703
|
+
Google WebView API for Ads references: [iOS](https://developers.google.com/admob/ios/browser/webview/api-for-ads) | [Android](https://developers.google.com/admob/android/browser/webview/api-for-ads) | [Read Full Documentation](https://setup.despia.com/native-features/admob/inline-ads) + [Read Full Documentation](https://setup.despia.com/native-features/admob/rewarded-ads)
|
|
687
704
|
|
|
688
705
|
---
|
|
689
706
|
|
|
@@ -704,7 +721,7 @@ const result = await request.show();
|
|
|
704
721
|
await result.complete('success');
|
|
705
722
|
```
|
|
706
723
|
|
|
707
|
-
Apple Pay on iOS and Google Pay on Android both work via the standard Web Payment Request API. No Despia-specific calls required.
|
|
724
|
+
Apple Pay on iOS and Google Pay on Android both work via the standard Web Payment Request API. No Despia-specific calls required. [Read Full Documentation](https://setup.despia.com/native-features/external-links) + [Google Pay in Android WebView](https://developers.google.com/pay/api/android/guides/recipes/using-android-webview)
|
|
708
725
|
|
|
709
726
|
---
|
|
710
727
|
|
|
@@ -730,6 +747,8 @@ const key = await crypto.subtle.generateKey(
|
|
|
730
747
|
|
|
731
748
|
For data that needs to survive uninstall and reinstall, or be locked behind Face ID, use [Identity Vault](#identity-vault) instead.
|
|
732
749
|
|
|
750
|
+
[Read Full Documentation](https://setup.despia.com/local-server/introduction) + [Read Full Documentation](https://setup.despia.com/native-features/simple-storage)
|
|
751
|
+
|
|
733
752
|
---
|
|
734
753
|
|
|
735
754
|
### Local Server
|
|
@@ -781,7 +800,7 @@ The plugin generates `despia/local.json` in your output directory alongside your
|
|
|
781
800
|
}
|
|
782
801
|
```
|
|
783
802
|
|
|
784
|
-
Full
|
|
803
|
+
[Read Full Documentation](https://setup.despia.com/local-server/introduction) + [API reference](https://setup.despia.com/local-server/reference)
|
|
785
804
|
|
|
786
805
|
---
|
|
787
806
|
|
|
@@ -845,7 +864,7 @@ const data = await res.json();
|
|
|
845
864
|
| `/api/upload` | `/files/` | `localhost:{PORT}/files/{filename}` |
|
|
846
865
|
|
|
847
866
|
|
|
848
|
-
Full
|
|
867
|
+
[Read Full Documentation](https://setup.despia.com/local-cdn/introduction) + [API reference](https://setup.despia.com/local-cdn/reference)
|
|
849
868
|
|
|
850
869
|
---
|
|
851
870
|
|
|
@@ -883,6 +902,8 @@ Despia exposes top and bottom safe area insets as CSS custom properties set by t
|
|
|
883
902
|
|
|
884
903
|
Note: left and right safe area variables are not available.
|
|
885
904
|
|
|
905
|
+
[Read Full Documentation](https://setup.despia.com/native-features/safe-areas)
|
|
906
|
+
|
|
886
907
|
---
|
|
887
908
|
|
|
888
909
|
## Extending the Runtime
|
|
@@ -951,7 +972,7 @@ It is not for React Native, Expo, or native mobile development.
|
|
|
951
972
|
|
|
952
973
|
Despia provides fully automated iOS and Android store deployment from the web editor. No Mac required. One-click deployment spins up Mac Mini build infrastructure in the cloud, handles code signing, provisioning, and submits to both the App Store and Google Play — entirely from a browser.
|
|
953
974
|
|
|
954
|
-
Full
|
|
975
|
+
[Read Full Documentation](https://setup.despia.com/deployment/apple-ios/automatic) + [Read Full Documentation](https://setup.despia.com/deployment/google-android/automatic)
|
|
955
976
|
|
|
956
977
|
---
|
|
957
978
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "despia-native",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "Web-native iOS and Android SDK. Biometrics, GPS, in-app purchases, push notifications, and 50+ native APIs - no Swift, no Kotlin.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|