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

# UI Config (tRPC)

> Server-persisted per-user UI configuration overlay (Tier-0 addon-platform config layer).

This namespace exposes the authenticated per-user UI-config overlay
document — semantic display deltas (surface item order/visibility, lens
values such as privacy mode) merged client-side over the app's shipped
base configuration:

* `uiConfig.get`
* `uiConfig.set`

<Note>
  Both endpoints are gated by the default-off `addon_platform_ui_config`
  feature flag and return `FORBIDDEN` while it is disabled. The document
  schema is owned by `@repo/ui-config` (`uiConfigOverlaySchema`).
</Note>

## Payload Contract

* `document`: a schema-versioned overlay object (`schemaVersion: 1`).
  Unknown keys are preserved (loose schema, forward-compatible). Maximum
  serialized size 64 KiB.
* `expectedRevision`: optimistic-concurrency token. Pass `0` when no
  document exists yet; otherwise the revision returned by the last
  `get`/`set`. A stale value fails with `CONFLICT` (message carries the
  current revision).

`get` returns `{ document, revision, migrated }` — an empty overlay with
`revision: 0` when nothing is stored; stored documents are migrated
forward to the current schema version on read.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.glider.fi/v1/trpc/uiConfig.set' \
    --header 'Content-Type: application/json' \
    --data '{
      "input": {
        "document": {
          "schemaVersion": 1,
          "lenses": { "privacy": { "enabled": true } },
          "surfaces": {
            "dashboard.main": {
              "order": ["portfolio-table", "command-deck"],
              "hidden": ["team-feed"]
            }
          }
        },
        "expectedRevision": 0
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "result": {
      "data": {
        "revision": 1
      }
    }
  }
  ```
</ResponseExample>
