# createUncageStore

<!-- https://uncage.vercel.app/docs/api/react/functions/createuncagestore/ -->

```ts
function createUncageStore(client): UncageStore;
```

Defined in: react/src/store.ts:265

Framework-agnostic normalized store over an UncageClient.

Error policy: actions never reject, except `createSession` (it must return an id). Failures are
recorded in `lastError`, which UIs render and clear with `dismissError()`.

History: a snapshot carries no message/tool history, so `selectSession` starts from the
snapshot's session/runs/pending approvals with an empty timeline and subscribes with
`after: 0`, rebuilding the timeline from the full replay. If the server can no longer replay
(`event_replay_unavailable`), the store merges a fresh snapshot, sets `replayIncomplete` and
resubscribes from `snapshot.lastSequence`.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `client` | `UncageClient` |

## Returns

[`UncageStore`](https://uncage.vercel.app/docs/api/react/interfaces/uncagestore.md)
