Skip to main content

Requirements

  • Node.js >= 20.19
  • npm (workspaces-aware)

Get the code

Crosslink is not published to a package registry yet — use it from a clone as npm workspaces.
Each package under packages/* (@crosslink/sdk-node, @crosslink/sdk-browser, @crosslink/react, @crosslink/core, @crosslink/protocol, …) is then available as a workspace dependency to any app in the same monorepo, or via npm link / a file: reference from outside it.

Optional: OS keychain storage

A host stores its identity seed in the operating system’s credential store when one is reachable, and in an authenticated-encryption file otherwise. keytar and Electron’s safeStorage are both optional and imported dynamically — their absence is a normal outcome, not an error.
On Linux, keytar needs libsecret headers to build:
Without either, set CROSSLINK_SECRET_KEY so the encrypted-file fallback uses a passphrase you control.

Optional: run the local services

Nothing here is needed to pair or connect — a phone reaches the host directly over the address in the QR. Signaling and relay only add a route for phones that cannot. For local development:
This starts both services on localhost (signaling on :8081, relay on :8082 by default).

Environment variables

Verify installation

The packages are ESM-only, so require() will not load them.

TypeScript support

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

Framework-specific setup

Vite / React

Electron

Troubleshooting

WebCrypto unavailable

Ensure you’re serving from a secure context (HTTPS or localhost). WebCrypto is not available on http:// origins, which affects CrosslinkClient.create()’s encrypted storage (it falls back to plaintext storage, or throws if allowPlaintextFallback is false).

Module not found

Ensure you’re using ESM:
Or rename files to .mjs.