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

> ## Agent Instructions
> The docs are served at https://docs.devias.io. Every path in these docs is relative to that root: /llms.txt is https://docs.devias.io/llms.txt.
> Devias is an open-source platform that works as an operating system for a business: a core (records, views, workflows, agents, permissions) with installable modules.
> Pages are typed by folder. concepts/ explains what things are, guides/ gives procedures, reference/ is exhaustive (SDK, CLI, HTTP API), operate/ covers hosting. Use /start/glossary for exact terms.
> Every id in a module (module, object, field, view, action, workflow, step, connection, variable, event, policy) is a uuid. Generate them with `devias id <count>`. Never invent dotted or readable ids.
> Run `devias plan` and read its output before `devias apply`. Apply only what the plan says.
> The OpenAPI document, including the routes of the modules in the reference setup, is at /reference/api/openapi.json.
> Devias is young and changes quickly. If a page and the source repository (github.com/devias-io/devias) disagree, the repository is right.

# SDK mock backend

> How to use createMockClient from @devias/sdk/mock, a complete in-memory Devias client with the same interface as the HTTP client. Lists its options (manifests, catalog, latency, persist, members, ai), reset, running the studio on it with VITE_MOCK=1, and testing.

The SDK includes a second client with the same methods that keeps everything in memory. It is not a stub: records, queries, workflows, tasks and live events all work.

```ts theme={"dark"}
import { createMockClient } from '@devias/sdk/mock';

const client = createMockClient({
  workspaceId: 'demo',
  manifests: [manifest],
});

await client.records.create('person', { first_name: 'Ada' });
```

Both clients implement the same `DeviasClient` interface, so code written against one runs on the other.

## Options

| Option | What it does |
| - | - |
| `manifests` | Modules installed from the start. |
| `catalog` | More modules that can be installed later. |
| `latency` | A delay for every call, to see loading states. |
| `persist` | Keep the data between page loads, under a key. |
| `members` | The people notifications can go to. |
| `ai` | Scripted agent answers, for testing chat. |

Call `client.reset()` to go back to a clean workspace.

## Run the studio on the mock

To work on the studio with no server, run:

```bash theme={"dark"}
VITE_MOCK=1 pnpm dev:studio
```

## Use the mock in tests

Create a fresh client in each test and assert on what is read back. Nothing is shared between clients, and there is nothing to start or stop.

The mock does not serve files, so a module's logo is not available. A module that needs server code, such as a payment provider, can be put in `catalog` to appear in the list without running. The mock has no workflow runner for queued runs: a run it starts completes immediately.

## Related

* [Records and queries](https://docs.devias.io/reference/sdk/records-and-queries.md): works the same on the mock.
* [What a module is](https://docs.devias.io/guides/modules/what-a-module-is.md): test a manifest against the mock.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.