Skip to main content
You will build a desktop host, a mobile page, and nothing else. Crosslink provides the pairing screen, the QR, the mobile onboarding, the installable PWA, the offline screen and the reconnection.

Prerequisites

  • Node.js >= 20.19 (22 recommended)
  • npm

1. Install

The browser SDK is served to your pages by the host, so there is no bundler and no second install.

2. Write the host

host.mjs:

3. Write the desktop page

public/index.html:
Serve it from a loopback-bound server with Crosslink’s control surface mounted:
The control surface only answers requests from this machine — it mints pairing codes and revokes devices, so it refuses anything else.

4. Write the mobile page

mobile/index.html:
There is no manifest link, no service-worker registration, no SDK script tag and no pairing screen here. Crosslink injects what the page needs and has already run pairing, install and reconnection by the time onConnected fires.

5. Run it

Open 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