Web Platform Guide
Sparkling supports rendering Lynx bundles in the browser via the Lynx web platform. This lets you preview and test your app in a browser without a native simulator — useful for rapid iteration, CI testing, and potentially web deployment.
Architecture
The same source code produces two outputs:
*.lynx.bundle— consumed by native LynxView on Android/iOS*.web.bundle— consumed by<lynx-view>custom element in the browser
New Projects
When you run npm create sparkling-app@latest, the scaffolder asks:
Answering Yes (the default) sets up the project with:
environmentsconfig inapp.config.tsfor dual-output buildsdev:web,build:web, andrun:webscriptssparkling-web-shelldevDependency
You can also pass --web or --no-web as CLI flags:
Existing Projects
To add web support to an existing Sparkling project:
1. Update app.config.ts
Add the environments block and move assetPrefix into the lynx environment:
2. Add dependencies
3. Add scripts to package.json
4. Run autolink
This generates web method imports so that method SDKs (navigation, storage, etc.) work in the browser.
Development Workflow
Start the web dev server
This builds your web bundles and starts the web shell server at http://localhost:3000.
Navigate between pages
For multi-page apps, use the ?page= query parameter:
http://localhost:3000— loadsmain.web.bundle(default)http://localhost:3000?page=second— loadssecond.web.bundle
When using sparkling-navigation's router.open() in your app code, page transitions are handled automatically via the History API.
Hot Module Replacement
The rspeedy dev server provides HMR for web bundles. Changes to your source files are reflected in the browser without a full reload.
Debugging
Use your browser's built-in DevTools (Chrome DevTools, Firefox DevTools, etc.) to inspect the DOM, debug JavaScript, profile performance, and monitor network requests.
Build for Web
To produce web bundles without starting a dev server:
Output goes to dist/web/. These bundles can be served by any static file server.
Next Steps
- Web Method Implementations — how method SDKs work on web
- Web Limitations — what native features aren't available on web

