Skip to main content

QumoClient

The Qumo SDK client. Owns request execution and exposes one property per resource namespace. Example

Namespaces

request

Executes an authenticated request against the configured base URL and parses the response body as JSON. Use the resource namespaces for typed coverage; fall back to this method for endpoints the SDK does not yet wrap. For non-JSON responses (file downloads, blobs, streams), use QumoClient.requestRaw.

requestRaw

Executes an authenticated request and returns the raw Response, without JSON parsing. Use this for non-JSON bodies — file downloads, blobs, streams — where request would wrongly parse the bytes as JSON. Shares the same auth/CSRF header injection and throws APIError on a non-ok status, so error handling is identical.

QumoConfig

Options for constructing a QumoClient.
  • baseUrl string — The control plane’s base URL, e.g. https://api.qumo-deploy.com. An empty string makes requests relative to the current origin (browser use).
  • token? string — Bearer token sent as Authorization: Bearer …. Takes precedence over apiKey.
  • apiKey? string — API key sent as X-API-Key, used when no token is set.
  • csrfToken? () => string | null | undefined — Supplies the CSRF token for cookie-authenticated (browser session) calls. The server requires X-CSRF-Token on every mutating request made with the qumo_session cookie; Bearer/API-key callers are exempt and can omit this. Called per request so a rotated token is picked up without rebuilding the context. Returning null/undefined sends no header.

APIError

Thrown for every non-2xx response. message is the server’s error field, or the HTTP status text when the body has none.
Created by the client for a failed response; you rarely construct one.
  • status — The HTTP status code.
  • message — The server’s error message.
  • data — The parsed response body, or its raw text when it is not JSON.