Skip to main content

Host configuration

application

Identity and branding. Crosslink-owned screens, the generated manifest and the generated icons all come from here, so it is stated once. See Branding and Theming. There is no option that replaces Crosslink’s screens or removes its mark and attribution.

mobile

Your mobile application, and where Crosslink should serve it. Setting entry turns on the built-in bootstrap: Crosslink then owns the manifest, service worker, icons, browser SDK, install handoff and every onboarding screen. See Mobile Bootstrap.

capabilities

Array of capability objects:

signalingUrl

string — URL of the signaling server (enables QR pairing across networks). No default is hardcoded; when unset it is auto-discovered from .crosslink-data/stack.json if a local npm run stack is running, or left unconfigured.

relayUrl

string — URL of the relay server (enables connectivity behind NATs). Same auto-discovery as signalingUrl.

relayUrls

string[] — Ordered regional relay fallbacks. Allocation tries the first healthy validated endpoint and re-allocates after a regional/channel failure.

lan

pairing

mdns

mDNS results are untrusted discovery candidates, never identity evidence. The SDK accepts only local addresses and valid app/fingerprint/version/port metadata; the authenticated handshake still pins the host.

groups

security

networkMode

"auto" | "local-only" | "lan-and-relay" | "remote" — Which transports the host offers. auto (default) uses LAN plus whatever remote path is configured or discovered; local-only disables signaling, relay, tunnel, and port mapping entirely; lan-and-relay uses LAN plus the configured relay/signaling services; remote requires a working outside-the-network route and fails startup loudly if none can be established.

remote

Direct inbound access from the internet, via a router port mapping (PCP, NAT-PMP, UPnP) or a port you forwarded by hand. See Remote Access.

Client configuration

deviceName

string — Device name shown to host.

storage

SecureStorage — Custom storage backend. Default (via .create()): IndexedDB-backed, encrypted with a non-extractable WebCrypto key when available.

onStateChange

(state: ConnectionState, detail?: Record<string, unknown>) => void — State change callback.

onConfirmPairing

(req: PairingConfirmRequest) => boolean | Promise<boolean> — Pairing confirmation.

logger

Logger — Custom logger implementation (must implement trace, debug, info, warn, error, child, isEnabled — use consoleLogger() from @crosslink/core for a ready-made one).

dialTimeoutMs

number — Max time to wait for a WebSocket to open before giving up. Default: 10000.

allowPlaintextFallback

boolean — Only accepted by CrosslinkClient.create(), not the plain constructor. Allows falling back to unencrypted storage when WebCrypto/IndexedDB is unavailable.

Environment variables


Service configuration

Both services read configuration from CLI flags (--port, --host, --auth-token) or the environment variables below; PORT/HOST win over a positional/flag port, and an explicit token always wins over the per-machine dev token fallback.

Signaling (services/signaling)

Relay (services/relay)


TypeScript configuration

Both SDKs ship with TypeScript declarations. No @types packages needed.