Prerequisites
- Node.js >= 20.19 (22 recommended)
- npm
1. Install
2. Write the host
host.mjs:
3. Write the desktop page
public/index.html:
4. Write the mobile page
mobile/index.html:
onConnected fires.
5. Run it
http://127.0.0.1:8100, scan the QR with a phone on the same Wi-Fi, and
Crosslink takes it from there: pairing and then your notes list. The phone loads
the desktop’s plain-HTTP LAN address in this development mode, so the browser
does not register a Service Worker or provide the durable installed-PWA
lifecycle. The secure published mode linked under Before you ship is the
Add to Home Screen path.
What you did not write
- a pairing screen, QR generation, or a nine-digit code UI
- a pairing-session fetch, refresh timer or expiry handler
- a manifest, a service worker, or icon generation
- Add to Home Screen or Continue in Browser
- an offline screen, a reconnect loop, or revocation handling
- a bundler configuration
Before you ship
Read Durable Origins. Add to Home Screen and the cached offline screen depend on the origin the phone loaded, and a plain-HTTP LAN address gives you neither. Your host says which case you are in:Next steps
Pairing Card
The desktop pairing UI and its options
Mobile Bootstrap
What happens between the scan and your app
Durable Origins
Making an installed app survive the desktop going offline
Capabilities and RPC
Capability-gated methods and events