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

# Realtime

> Subscribe to thread events over Pusher. The browser configures nothing except what we return here.

Patchwork owns the Pusher account. The client fetches public config, then asks us to sign a `private-thread-{id}` subscription. Direct tokens can only subscribe to their own threads.

If Pusher is not configured on the workspace's API, `enabled` is `false` and you poll `GET /v1/loom/runs/:id` instead. [`@usepatchwork/react`](https://www.npmjs.com/package/@usepatchwork/react) does this automatically.

## Config

`GET /v1/loom/realtime/config`

```json theme={null}
{
  "enabled": true,
  "key": "app-key",
  "cluster": "mt1"
}
```

<ResponseField name="enabled" type="boolean" required>
  Whether the server will publish thread events.
</ResponseField>

<ResponseField name="key" type="string">
  Public Pusher key. Never a secret.
</ResponseField>

<ResponseField name="cluster" type="string">
  Pusher cluster.
</ResponseField>

## Authorize

`POST /v1/loom/realtime/auth`

```json theme={null}
{
  "channel_name": "private-thread-3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "socket_id": "1234.5678"
}
```

Returns the Pusher authentication payload for that socket. `403` if the token does not own the thread.

Channel name must be `private-thread-` plus the thread UUID.

## Endpoints

* [Realtime config](/api-reference/loom/realtime-config) — `GET /v1/loom/realtime/config`
* [Authorize a realtime channel](/api-reference/loom/authorize-a-realtime-channel) — `POST /v1/loom/realtime/auth`
