This feature is still in the final beta round. To request access as a beta tester, send an email to offlinemode@despia.com
http://localhost. This eliminates network latency on boot, enables full offline operation, and keeps your existing hosting infrastructure intact.
Instant boot
Zero network latency on launch. Your app loads in milliseconds because all assets are served from on-device storage.
Real offline support
Not “works offline sometimes” but actually works without any connectivity, indefinitely. The last cached version is always available.
Live OTA updates
Push web UI changes instantly. No app store approval needed for HTML, CSS, JavaScript, image, or font updates.
No MAU fees or lock-in
Host your web app on Netlify, Vercel, AWS, or your own servers. Despia never inserts itself between you and your stack, and charges no per-user fees.
The local server is completely optional. Standard Despia runtime works well for most apps. Use this when you need guaranteed offline functionality or a performance edge on first load.
How it works
When users install your app, they receive a lightweight native container. The binary contains no web assets at submission time. What is in the binary:- Native iOS (Swift) or Android (Kotlin) code
- WebView for rendering (WKWebView on iOS, WebView on Android)
- JavaScript bridge exposing 30+ native features via
despia-native - Local HTTP server infrastructure (runs on-device only)
- Storage and update management
- Tiny install size
- All native code fixed at submission
- Store compliant - only web content downloads post-install
- Iterate on UI without app store resubmission
First launch hydration
The first time a user opens the app, Despia downloads your web build:- Fetches your latest build (HTML, CSS, JS, images, fonts) from your hosting
- Caches everything locally on the device
- Starts the HTTP server at
http://localhost - Loads your app from localhost
- HTML, CSS, JavaScript
- Images, fonts, and other static assets
- Not native code (already in binary)
- Not executables (
.so,.dylib,.dex)
- Instant boot on every subsequent launch
- Full offline operation
- 60fps hardware-accelerated rendering
Hydration downloads web content only (HTML, CSS, JS). This is identical to how browsers cache pages and is what enables store compliance.
Background updates
When connectivity is available, Despia checks for new builds and downloads them in the background:- Fetches
despia/local.jsonand comparesdeployed_atwith the cached value - If
deployed_athas changed, downloads the complete new version in the background - Stores it separately without affecting the running app
- Applies on next launch
- Web UI (HTML, CSS, JavaScript)
- Images, fonts, and other assets
- Business logic
- How your web UI uses existing native APIs (for example, adding Face ID to a new screen when Face ID already exists in the binary)
- Native code
- App permissions
- Native API implementations
Smart OTA cache system
Thedeployed_at field in despia/local.json powers efficient conditional update logic. On startup, the client fetches the manifest and compares deployed_at with its cached value to determine whether a full asset download is required.
| Scenario | Behavior |
|---|---|
| Good connection | Fetch manifest and compare deployed_at to cached value |
deployed_at changed | New deployment detected, download all assets, set as active app source |
deployed_at unchanged | Serve from existing local cache with no download |
| Poor or no connection | Serve from offline cache, defer manifest check until connectivity improves |
deployed_at has actually changed, minimising network usage while preserving full OTA update capability.
Architecture overview
Native functionality is fixed at submission. Web content can use existing native APIs in new ways, but cannot add new native capabilities.
Why localhost matters
Running fromhttp://localhost instead of file:// or custom schemes solves real problems.
Real URL routing
Your app runs from a real HTTP origin, which means:- React Router just works. Use BrowserRouter like on the web with no config and no hash mode required.
- Any routing library works. Vue Router, Svelte routing, Next.js. If it expects a real HTTP origin, it works.
- No hacks. Your routing code is identical between web and mobile.
Full web API access
- Service Workers work. Advanced caching, background sync, and push notifications via standard web APIs.
- No CORS issues. Your app runs from
localhost, so calls to external APIs are straightforward. - Modern APIs work. IndexedDB, Web Workers, Fetch, WebSockets. Everything works because you have a real origin.
- PWA features enabled.
localhostis a secure context, so PWA capabilities work seamlessly.
Why HTTP and not HTTPS
localhost has inherent security guarantees that make HTTPS unnecessary for local serving:
- Reserved hostname.
localhostmaps to127.0.0.1or::1only. It cannot be redirected or spoofed. - Secure context. Modern browsers treat
http://localhostas secure, enabling all modern Web APIs. - No network exposure. Traffic never leaves the device.
- Protocol flexibility. HTTP lets you load from both
https://(external APIs, CDNs) and local assets without mixed content warnings.
Security comes from the reserved hostname and on-device execution, not encryption. HTTP with localhost provides the right balance for hybrid apps.
Store compliance
Despia’s local server is fully compliant with both Apple App Store and Google Play Store guidelines. Apple App Store (Guideline 3.3.2):- No native code execution - only web content rendering
- Fixed native functionality - all native capabilities determined at submission
- Web content updates only - HTML, CSS, JS changes, never native code
- On-device execution - local HTTP server runs exclusively on-device
- Established pattern - same approach as Safari, Chrome, and Expo
- No executable downloads - never downloads
.dex,.jar,.so, or native binaries - Sandboxed execution - JavaScript runs in WebView sandbox only
- Fixed native binary - APK/AAB contains all native code at submission
- Web content only - downloads HTML, CSS, and JS files, identical to browser caching
- Compliant: updating web content to use existing native APIs
- Not compliant: downloading new native code or adding new native capabilities
Frequently asked questions
Do I need to use the local server?
Do I need to use the local server?
No, it is completely optional. Despia can run your web app directly from any URL. Use the local server when you need guaranteed offline functionality or maximum first-load performance.
Will Apple and Google approve my app?
Will Apple and Google approve my app?
Yes. The local server downloads and caches web content (HTML, CSS, JS) for offline use, identical to how browsers work. No native code or executables are downloaded.
Can I update my app without app store review?
Can I update my app without app store review?
Yes, for web UI changes. You can update HTML, CSS, JavaScript, images, and fonts instantly. Be mindful that dramatic changes to app behavior may require review, especially on iOS.
What happens if a user goes permanently offline?
What happens if a user goes permanently offline?
The app continues to work with the last hydrated version indefinitely. If the device never regains connectivity, the cached content remains fully functional.
How do updates reach users?
How do updates reach users?
On startup, Despia fetches your
despia/local.json manifest and compares the deployed_at timestamp with the cached value. If it has changed, the new build downloads in the background and applies on the next launch - zero downtime, no broken states.Can I add new native features via OTA updates?
Can I add new native features via OTA updates?
You can update your web UI to use native APIs that already exist in the binary. For example, if Face ID is already implemented, you can add it to new screens via an update. You cannot add entirely new native capabilities that were not in the original submission.
Is the JavaScript bridge secure?
Is the JavaScript bridge secure?
Yes. The bridge exposes only the native APIs included at submission time. All JavaScript executes within the WebView’s security sandbox, and native code cannot be modified after submission.
Resources
Plugin on npm
Full package documentation and changelog for
@despia/local.Native SDK
Reference for the
despia-native JavaScript bridge and its 50+ native APIs.