despia-native 1.0.24 → 1.0.25
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 +36 -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,12 @@ 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
|
+
<a href="cursor://anysphere.cursor-deeplink/mcp/install?name=Despia&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vc2V0dXAuZGVzcGlhLmNvbS9tY3AifQ==">
|
|
21
|
+
<img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor" />
|
|
22
|
+
</a>
|
|
23
|
+
<a href="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">
|
|
24
|
+
<img src="https://img.shields.io/badge/Install_in_VS_Code-007ACC?logo=visualstudiocode&logoColor=white" alt="Install in VS Code" />
|
|
25
|
+
</a>
|
|
22
26
|
|
|
23
27
|
```
|
|
24
28
|
https://setup.despia.com/mcp
|
|
@@ -225,6 +229,8 @@ despia('warninghaptic://'); // Attention alert
|
|
|
225
229
|
despia('errorhaptic://'); // Negative feedback
|
|
226
230
|
```
|
|
227
231
|
|
|
232
|
+
[Read Full Documentation](https://setup.despia.com/native-features/haptic-feedback)
|
|
233
|
+
|
|
228
234
|
---
|
|
229
235
|
|
|
230
236
|
### Identity Vault
|
|
@@ -292,6 +298,8 @@ async function checkTrialEligibility() {
|
|
|
292
298
|
}
|
|
293
299
|
```
|
|
294
300
|
|
|
301
|
+
[Read Full Documentation](https://setup.despia.com/native-features/storage-vault) + [Read Full Documentation](https://setup.despia.com/native-features/biometrics)
|
|
302
|
+
|
|
295
303
|
---
|
|
296
304
|
|
|
297
305
|
### GPS Location
|
|
@@ -320,7 +328,7 @@ despia('location://?server=https://api.example.com/track?user=USER_ID&buffer=30&
|
|
|
320
328
|
|
|
321
329
|
Each POST body matches the location object shape returned by `stoplocation://`.
|
|
322
330
|
|
|
323
|
-
Full
|
|
331
|
+
[Read Full Documentation](https://setup.despia.com/native-features/gps-location)
|
|
324
332
|
|
|
325
333
|
---
|
|
326
334
|
|
|
@@ -390,7 +398,7 @@ if (isDespia) {
|
|
|
390
398
|
}
|
|
391
399
|
```
|
|
392
400
|
|
|
393
|
-
Full
|
|
401
|
+
[Read Full Documentation](https://setup.despia.com/native-features/revenuecat/introduction) + [API reference](https://setup.despia.com/native-features/revenuecat/reference)
|
|
394
402
|
|
|
395
403
|
---
|
|
396
404
|
|
|
@@ -446,7 +454,7 @@ despia('appsflyer://log_event?event_name=onboarding_step&event_values=' + encode
|
|
|
446
454
|
|
|
447
455
|
`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
456
|
|
|
449
|
-
Full
|
|
457
|
+
[Read Full Documentation](https://setup.despia.com/analytics/appsflyer/introduction) + [Read Full Documentation](https://setup.despia.com/analytics/appsflyer/attribution)
|
|
450
458
|
|
|
451
459
|
---
|
|
452
460
|
|
|
@@ -488,7 +496,7 @@ await fetch('https://onesignal.com/api/v1/notifications', {
|
|
|
488
496
|
});
|
|
489
497
|
```
|
|
490
498
|
|
|
491
|
-
When configuring OneSignal, select **Native iOS** and **Native Android** as the platforms.
|
|
499
|
+
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
500
|
|
|
493
501
|
---
|
|
494
502
|
|
|
@@ -565,7 +573,7 @@ When Despia navigates the WebView to `/auth`, if that route is already active yo
|
|
|
565
573
|
- Vue: use `watch: { '$route.query': { immediate: true, handler } }` instead of reading params in `mounted()`
|
|
566
574
|
- Vanilla JS: call your handler on load and add `window.addEventListener('popstate', handler)`
|
|
567
575
|
|
|
568
|
-
Full
|
|
576
|
+
[Read Full Documentation](https://setup.despia.com/native-features/oauth/introduction)
|
|
569
577
|
|
|
570
578
|
---
|
|
571
579
|
|
|
@@ -575,6 +583,8 @@ Full docs: [https://setup.despia.com/native-features/o-auth-2-0](https://setup.d
|
|
|
575
583
|
const { clipboarddata } = await despia('getclipboard://', ['clipboarddata']);
|
|
576
584
|
```
|
|
577
585
|
|
|
586
|
+
[Read Full Documentation](https://setup.despia.com/native-features/clipboard)
|
|
587
|
+
|
|
578
588
|
---
|
|
579
589
|
|
|
580
590
|
### Contacts
|
|
@@ -583,6 +593,8 @@ const { clipboarddata } = await despia('getclipboard://', ['clipboarddata']);
|
|
|
583
593
|
const { contacts } = await despia('readcontacts://', ['contacts']);
|
|
584
594
|
```
|
|
585
595
|
|
|
596
|
+
[Read Full Documentation](https://setup.despia.com/native-features/contact-access)
|
|
597
|
+
|
|
586
598
|
---
|
|
587
599
|
|
|
588
600
|
### App Information and Device Data
|
|
@@ -594,6 +606,8 @@ const { storeLocation } = await despia('getstorelocation://', ['storeLoc
|
|
|
594
606
|
const { trackingDisabled } = await despia('user-disable-tracking://', ['trackingDisabled']);
|
|
595
607
|
```
|
|
596
608
|
|
|
609
|
+
[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)
|
|
610
|
+
|
|
597
611
|
---
|
|
598
612
|
|
|
599
613
|
### UI Controls and Styling
|
|
@@ -609,6 +623,8 @@ despia('settingsapp://'); // Open native app settings
|
|
|
609
623
|
despia('reset://'); // Reset the app
|
|
610
624
|
```
|
|
611
625
|
|
|
626
|
+
[Read Full Documentation](https://setup.despia.com/native-features/safe-areas) + [Read Full Documentation](https://setup.despia.com/native-features/app-settings)
|
|
627
|
+
|
|
612
628
|
---
|
|
613
629
|
|
|
614
630
|
### File and Media Operations
|
|
@@ -639,6 +655,8 @@ despia('shareapp://message?=Check%20out%20this%20app&url=https://myapp.com');
|
|
|
639
655
|
despia('scanningmode://auto'); // auto | on | off
|
|
640
656
|
```
|
|
641
657
|
|
|
658
|
+
[Read Full Documentation](https://setup.despia.com/native-features/file-sharing) + [Read Full Documentation](https://setup.despia.com/native-features/camera-roll)
|
|
659
|
+
|
|
642
660
|
---
|
|
643
661
|
|
|
644
662
|
### Apple Health (HealthKit)
|
|
@@ -658,7 +676,7 @@ despia('writehealthkit://HKQuantityTypeIdentifierBodyMass//74.5');
|
|
|
658
676
|
despia('healthkit://observe?types=HKQuantityTypeIdentifierStepCount&frequency=hourly&server=https://api.example.com/webhook?user=USER_ID');
|
|
659
677
|
```
|
|
660
678
|
|
|
661
|
-
Pass any valid `HKQuantityTypeIdentifier`, `HKCategoryTypeIdentifier`, `HKWorkoutTypeIdentifier`, or `HKCharacteristicTypeIdentifier` directly. Sleep, workouts, heart rate, body mass, and all other HealthKit types are supported. Full
|
|
679
|
+
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
680
|
|
|
663
681
|
---
|
|
664
682
|
|
|
@@ -683,7 +701,7 @@ Once enabled, serve ads using standard AdSense, Google Publisher Tag, or IMA for
|
|
|
683
701
|
|
|
684
702
|
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
703
|
|
|
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
|
|
704
|
+
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
705
|
|
|
688
706
|
---
|
|
689
707
|
|
|
@@ -704,7 +722,7 @@ const result = await request.show();
|
|
|
704
722
|
await result.complete('success');
|
|
705
723
|
```
|
|
706
724
|
|
|
707
|
-
Apple Pay on iOS and Google Pay on Android both work via the standard Web Payment Request API. No Despia-specific calls required.
|
|
725
|
+
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
726
|
|
|
709
727
|
---
|
|
710
728
|
|
|
@@ -730,6 +748,8 @@ const key = await crypto.subtle.generateKey(
|
|
|
730
748
|
|
|
731
749
|
For data that needs to survive uninstall and reinstall, or be locked behind Face ID, use [Identity Vault](#identity-vault) instead.
|
|
732
750
|
|
|
751
|
+
[Read Full Documentation](https://setup.despia.com/local-server/introduction) + [Read Full Documentation](https://setup.despia.com/native-features/simple-storage)
|
|
752
|
+
|
|
733
753
|
---
|
|
734
754
|
|
|
735
755
|
### Local Server
|
|
@@ -781,7 +801,7 @@ The plugin generates `despia/local.json` in your output directory alongside your
|
|
|
781
801
|
}
|
|
782
802
|
```
|
|
783
803
|
|
|
784
|
-
Full
|
|
804
|
+
[Read Full Documentation](https://setup.despia.com/local-server/introduction) + [API reference](https://setup.despia.com/local-server/reference)
|
|
785
805
|
|
|
786
806
|
---
|
|
787
807
|
|
|
@@ -845,7 +865,7 @@ const data = await res.json();
|
|
|
845
865
|
| `/api/upload` | `/files/` | `localhost:{PORT}/files/{filename}` |
|
|
846
866
|
|
|
847
867
|
|
|
848
|
-
Full
|
|
868
|
+
[Read Full Documentation](https://setup.despia.com/local-cdn/introduction) + [API reference](https://setup.despia.com/local-cdn/reference)
|
|
849
869
|
|
|
850
870
|
---
|
|
851
871
|
|
|
@@ -883,6 +903,8 @@ Despia exposes top and bottom safe area insets as CSS custom properties set by t
|
|
|
883
903
|
|
|
884
904
|
Note: left and right safe area variables are not available.
|
|
885
905
|
|
|
906
|
+
[Read Full Documentation](https://setup.despia.com/native-features/safe-areas)
|
|
907
|
+
|
|
886
908
|
---
|
|
887
909
|
|
|
888
910
|
## Extending the Runtime
|
|
@@ -951,7 +973,7 @@ It is not for React Native, Expo, or native mobile development.
|
|
|
951
973
|
|
|
952
974
|
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
975
|
|
|
954
|
-
Full
|
|
976
|
+
[Read Full Documentation](https://setup.despia.com/deployment/apple-ios/automatic) + [Read Full Documentation](https://setup.despia.com/deployment/google-android/automatic)
|
|
955
977
|
|
|
956
978
|
---
|
|
957
979
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "despia-native",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
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",
|