Roles
Crosslink has two roles:
Host
The host is the application that:
- Declares capabilities
- Generates pairing codes
- Exposes RPC methods
- Manages client sessions
- Stores the identity key (in OS keychain)
Creating a host
Host methods
Client
The client is the interface that:
- Scans QR codes to pair
- Calls RPC methods
- Subscribes to events
- Manages paired-app records
Creating a client
Client methods
Client storage
Use CrosslinkClient.create() instead of new CrosslinkClient(). The factory encrypts the identity seed at rest; the constructor stores it in plaintext.
Host storage
The host stores its identity key and paired-device records:
Multiple clients
A host can serve multiple clients simultaneously:
Each client has its own session, capabilities, and encryption keys.