Skip to main content

SDK Code Recipes

Common patterns and production examples using @qumo-deploy/sdk.

1. Finding Relays for a Broadcast Path

Your app signs relay credentials itself with a signing key; the control plane does not issue them. To find where a client of a broadcast path should connect, ask discovery from the client that is about to connect. It needs no API key or token:

Which relay, and what to do when it goes away

client.relays.place returns a RelayPlacement. relays lists at most four relays, best first: each region’s relay for the path, the region nearest the client first, then other relays of those regions as fallbacks. Every client of a path is offered the same relay in each region, and the managed relays pass a broadcast between themselves, so a publisher and a viewer on different relays still meet. fallback lists the same relays as host:port, ending with the public endpoint. resolve is place plus the configured hostname, and never throws. A relay that is being taken out of service sends GOAWAY to its clients before it stops. When your client receives it:
  1. Leave the relay first: end the announcement or subscription and close the session. (A publisher that stays live on two relays at once confuses the hand-over.)
  2. Connect to the redirect the GOAWAY names, if it names one; otherwise to the next relay in relays (or fallback). If that relay cannot be reached, try the one after it: the list was made before the relays changed.
  3. Publish or subscribe again there, with the same credential: it is valid on every relay.
When the list runs out, ask discovery again: it reflects the relays in service now.

2. Provisioning Isolated Projects & Environments


3. Creating Scoped Identity Accounts for CI/CD

Machine identities allow CI pipelines to authenticate without user credentials: