Overview
By default, Despia runs your web app from any URL. The local server takes a different approach: it downloads your web build to the device and serves it from an on-device HTTP server athttp://localhost. This eliminates network latency on boot, enables full offline operation, and keeps your existing hosting infrastructure intact.
Instant boot
Real offline support
Live OTA updates
No MAU fees or lock-in
How it works
App store installation
- 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
- 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
Background updates
- 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
Add Despia local server to an existing web project. The agent will install the plugin, add the correct build config for your framework, and verify the manifest is generated at the right path. Provide your framework name (Vite, Webpack, Nuxt, etc.) and your build output directory.
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
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.
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?
Will Apple and Google approve my app?
Will Apple and Google approve my app?
Can I update my app without app store review?
Can I update my app without app store review?
What happens if a user goes permanently offline?
What happens if a user goes permanently offline?
How do updates reach users?
How do updates reach users?
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?
Is the JavaScript bridge secure?
Is the JavaScript bridge secure?
Get started
Add to your build config
Plugin on npm
@despia/local.Native SDK
despia-native JavaScript bridge and its 30+ native APIs.