Skip to content

Pairing

The pairing ceremony connects a local install to a HiveCast account. It is the single transition between "local mode" (no Device record exists) and "connected mode" (hostLinks[] row, device-scoped NATS credentials, live heartbeats).

Pages in this section

  • Login — what hivecast login --device and hivecast connect actually do, file by file and op by op.
  • Device flow — the OAuth-2.0-style device-code flow used by headless pairing (auth.device.*).
  • Host link — the durable cloud-side record that pairing produces and how the Device mirror corresponds to it.
  • Pairing grant — the wire shape of the redeem response: DeviceSetupExchangeResponse and what is in/out of it.
  • Why hosts do not receive raw OAuth tokens — a real architectural rule, with the security argument and the consequences for code review.

Two pairing initiation surfaces

Either of these starts the same protocol:

bash
# Headless / device-code (Flow D in HIVECAST-DEVICE-ENROLLMENT-SPEC.md):
hivecast login --device --cloud https://hivecast.ai

# Browser-pair (Flow B in HIVECAST-DEVICE-ENROLLMENT-SPEC.md):
hivecast login --setup-code <code> --cloud https://hivecast.ai

Both end at the same place: a row in hostLinks[], a heartbeat token, device-scoped NATS credentials, and presence in system.devices.

Source: WORKSTREAMS/product-launch/HIVECAST-DEVICE-ENROLLMENT-SPEC.md § "User Flows".