The scalable way to build applications with [dynamic data](https://dataclient.io/docs/getting-started/mutations).
[Declarative resource definitions](https://dataclient.io/docs/getting-started/resource) for [REST](https://dataclient.io/rest), [GraphQL](https://dataclient.io/graphql), [Websockets+SSE](https://dataclient.io/docs/concepts/managers#data-stream) and [more](https://dataclient.io/rest/api/Endpoint)
[Performant rendering](https://dataclient.io/docs/getting-started/data-dependency) in [React](https://react.dev/), [NextJS](https://nextjs.org/), [React Native](https://reactnative.dev/), [Expo](https://expo.dev/), [Vue](https://vuejs.org/)
Schema driven. Zero updater functions.
[](https://circleci.com/gh/reactive/data-client)
[](https://app.codecov.io/gh/reactive/data-client?branch=master)
[](https://github.com/reactive/data-client/issues 'Percentage of issues still open')
[](https://bundlephobia.com/result?p=@data-client/react)
[](https://www.npmjs.com/package/@data-client/react)
[](http://makeapullrequest.com)
[](https://skills.sh/reactive/data-client)
[](https://discord.gg/35nb8Mz)
**[๐Read The Docs](https://dataclient.io/docs)** | [๐Getting Started](https://dataclient.io/docs/getting-started/agent-skills) | [๐คAgent Skills](https://skills.sh/reactive/data-client)
๐ฎ Demos:
[Todo](https://stackblitz.com/github/reactive/data-client/tree/master/examples/todo-app?file=src%2Fpages%2FHome%2FTodoList.tsx) |
[Github Social](https://stackblitz.com/github/reactive/data-client/tree/master/examples/github-app?file=src%2Fpages%2FIssueList.tsx) |
[NextJS SSR](https://stackblitz.com/github/reactive/data-client/tree/master/examples/nextjs?file=components%2Ftodo%2FTodoList.tsx) |
[Websockets+SSR](https://stackblitz.com/github/reactive/coin-app/tree/master?file=src%2Fresources%2FStreamManager.ts,src%2Fapp%2FCurrencyList.tsx)
## Installation
```bash
npm install --save @data-client/react @data-client/rest @data-client/test
```
For more details, see [the Getting Started docs page](https://dataclient.io/docs/getting-started/agent-skills).
### Skills
```bash
npx skills add reactive/data-client
```
Then run [skill](https://agentskills.io) "data-client-setup"
## Usage
### Simple [TypeScript definition](https://dataclient.io/rest/api/Entity)
```typescript
class User extends Entity {
id = '';
username = '';
}
class Article extends Entity {
id = '';
title = '';
body = '';
author = User.fromJS();
createdAt = Temporal.Instant.fromEpochMilliseconds(0);
static schema = {
author: User,
createdAt: Temporal.Instant.from,
};
}
```
### Create [collection of API Endpoints](https://dataclient.io/docs/getting-started/resource)
```typescript
const UserResource = resource({
path: '/users/:id',
schema: User,
optimistic: true,
});
const ArticleResource = resource({
path: '/articles/:id',
schema: Article,
searchParams: {} as { author?: string },
optimistic: true,
paginationField: 'cursor',
});
```
### One line [data binding](https://dataclient.io/docs/getting-started/data-dependency)
```tsx
const article = useSuspense(ArticleResource.get, { id });
return (