Caprid is two services and the SDKs that talk to them.
- Relay is Mux’s Media over QUIC (MoQ) relay network. Clients connect to a relay to publish tracks and to subscribe to them. A track is a sequence of objects, and the relays carry them from a publisher to every subscriber, across regions. The payloads are bytes the relay doesn’t interpret, so a track can carry video, audio, captions, chat, or game state.
- Switchboard is the control plane. It owns your Organization and its Namespaces, issues the keys your backend signs Client tokens with, and decides, for every session on every relay, whether it may start and what it may do.
- The Relay SDKs connect your code to a relay:
@caprid/relayfor browsers and Node, andcaprid-relayfor Python asyncio. They share one specification, so both behave the same way.
How the pieces fit
Section titled “How the pieces fit” ┌──────────────── Switchboard ────────────────┐ your backend ──┤ API key: manage Namespaces, Signing keys │ │ Admission: may this session start? │ └──────────────────────▲──────────────────────┘ │ publisher ──── Client token ──────► relay ◄────── Client token ──── viewer (SDK) (Relay) (SDK)- Your backend holds an API key and a Signing key. It never ships either to a browser or app.
- For each publisher or viewer, your backend mints a short-lived
Client token: a JWT saying which paths under your
Namespace it may publish to (
put) and subscribe to (get). - The Client (your web page, app, or service, using an SDK) connects to a relay with that token. The relay asks Switchboard to admit the session, then enforces the token’s grant on every request.
- Publishers announce a namespace and write objects to tracks; subscribers subscribe to tracks and receive the objects.
The SDK guides call the token a “Relay JWT”. It’s the same Client token: the SDKs consume it, and Switchboard (or your own backend, with a Signing key) issues it.
Pick a path
Section titled “Pick a path”- Try it end to end. The Quickstart goes from an API key to an object published and received.
- Wire up your backend. Credentials covers every key and token, and Prod and staging how to keep them apart. The Account API reference has every route.
- Build a client. Start with the TypeScript guide or the Python guide.
- Run your own relays. Running a Self-hosted relay enrolls
moq-relayon your infrastructure. - Working with an AI agent? Build with AI agents lists the Markdown,
llms.txtand OpenAPI entry points, and the rules an agent should follow.
Status
Section titled “Status”The SDKs are before 1.0. Install them from npm (@caprid/relay) and PyPI (caprid-relay). Each
SDK’s packages release together at one version, so install matching versions. Before 1.0, a minor
version can break the API. The TypeScript and
Python changelogs say what changed.