Multi-Device Support
Users can be logged in from multiple devices simultaneously. Each device maintains its own E2EE keypair. Messages are encrypted per-device so every active session can decrypt independently.
How it works
Each device generates its own X25519 keypair on first login and registers it with your key directory.
The SDK encrypts a separate payload for each recipient device, bundled in one protobuf envelope.
The server routes each device-specific payload to the correct connection (or offline queue).
Key directory response
Your key directory endpoint should return a deviceKeys array for multi-device clients. The JavaScript SDK uses this shape directly and still accepts a legacy single publicKey response for older integrations.
// GET /api/droponair/keys/{userId} returns:
{
"deviceKeys": [
{ "deviceId": "abc-123", "publicKey": "BASE64..." },
{ "deviceId": "def-456", "publicKey": "BASE64..." }
]
}No client code changes: Multi-device is transparent. If the key directory returns multiple keys, the SDK encrypts for all devices automatically.