> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qumo-deploy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Client Reference

> Core resources, methods, and configurations available in QumoClient.

# `QumoClient` Reference

The `QumoClient` class is the central gateway to all Qumo Deploy control plane resources.

## Configuration Options (`QumoConfig`)

| Option      | Type                                   | Description                                                                                  |
| :---------- | :------------------------------------- | :------------------------------------------------------------------------------------------- |
| `baseUrl`   | `string`                               | Base API URL for the Qumo Deploy control plane (e.g. `https://api.qumo.dev`). Required.      |
| `token`     | `string?`                              | Optional Bearer authorization token (PAT, JWT, or CI service token).                         |
| `apiKey`    | `string?`                              | Optional API key token sent via the `X-API-Key` header.                                      |
| `csrfToken` | `(() => string \| null \| undefined)?` | Optional callback returning the active CSRF token for cookie-authenticated browser sessions. |

***

## Resource Namespaces

The following namespaces are accessible directly from the client instance:

| Namespace              | Accessor              | Key Methods                                                                             |
| :--------------------- | :-------------------- | :-------------------------------------------------------------------------------------- |
| **Authentication**     | `client.auth`         | `getSession()`, `getMemberships()`, `startDeviceFlow()`, `pollDeviceFlow()`, `logout()` |
| **Projects**           | `client.projects`     | `list()`, `create()`, `getUsage()`, `getBudgets()`, `updateBudget()`                    |
| **Credentials**        | `client.credentials`  | `issue()`, `issueForProject()`, `revoke()`                                              |
| **API Keys**           | `client.apiKeys`      | `list()`, `create()`, `revoke()`                                                        |
| **Tenants**            | `client.tenants`      | `list()`, `create()`, `get()`, `update()`                                               |
| **Bots & Machine IDs** | `client.bots`         | `list()`, `create()`, `delete()`                                                        |
| **Billing**            | `client.billing`      | `createCheckoutSession()`, `getSubscription()`, `getUsageSummary()`                     |
| **Audit Logs**         | `client.audit`        | `list()`, `getEvent()`                                                                  |
| **IAM**                | `client.iam`          | `listBindings()`, `grant()`, `revoke()`                                                 |
| **IP Allowlists**      | `client.ipAllowlists` | `list()`, `create()`, `delete()`                                                        |

***

## Direct HTTP Access

If an endpoint has not yet been wrapped with a high-level resource method, you can execute typed queries directly:

### `client.request<T>(path, options)`

Executes an authenticated HTTP request and automatically parses JSON response bodies:

```typescript theme={null}
const customData = await client.request<{ status: string }>("/api/v1/custom-endpoint", {
  method: "POST",
  body: JSON.stringify({ key: "value" }),
});
```

### `client.requestRaw(path, options)`

Executes an authenticated request and returns the raw `Response` object (for streams, binary payloads, or CSV downloads):

```typescript theme={null}
const rawResponse = await client.requestRaw("/admin/v1/reports/export.csv");
const csvText = await rawResponse.text();
```
