Skip to content

reactive/data-client / .agents/skills/data-client-setup

data-client-setup

Verified

Install and set up @data-client/react or @data-client/vue in a project. Detects project type (NextJS, Expo, React Native, Vue, plain React) and protocol (REST, GraphQL, custom), then follows the bundled protocol-specific setup guide.

FileKindSize
SKILL.mdskill md13.9 KB
evals/evals.jsonconfig12.6 KB
references.jsonconfig523 B
references/DataClientPlugin.mdmarkdown6.6 KB
references/DataProvider.mdmarkdown6.6 KB
references/data-client-endpoint-setup.mdmarkdown8.5 KB
references/data-client-endpoint-setup/references/Endpoint.mdmarkdown20.9 KB
references/data-client-endpoint-setup/references/Endpoint.vue.mdmarkdown20.5 KB
references/data-client-graphql-setup.mdmarkdown4.8 KB
references/data-client-graphql-setup/references/auth.mdmarkdown1.9 KB
references/data-client-rest-setup.mdmarkdown7.6 KB
references/data-client-rest-setup/references/RestEndpoint.mdmarkdown45.2 KB
references/data-client-rest-setup/references/RestEndpoint.vue.mdmarkdown46.1 KB
references/data-client-rest-setup/references/auth.mdmarkdown9.4 KB
references/data-client-rest-setup/references/auth.vue.mdmarkdown9.7 KB
references/data-client-rest-setup/references/axios-migration.mdmarkdown25.4 KB
references/data-client-rest-setup/references/axios-migration.vue.mdmarkdown25.5 KB
references/data-client-rest-setup/references/django.mdmarkdown2.3 KB
references/data-client-rest-setup/references/fetch-migration.mdmarkdown4.0 KB
references/data-client-rest-setup/references/got-migration.mdmarkdown4.5 KB
references/data-client-rest-setup/references/hookifyResource.mdmarkdown6.0 KB
references/data-client-rest-setup/references/hookifyResource.vue.mdmarkdown6.3 KB
references/data-client-rest-setup/references/ky-migration.mdmarkdown3.9 KB
references/data-client-rest-setup/references/resource.mdmarkdown27.0 KB
references/data-client-rest-setup/references/resource.vue.mdmarkdown27.1 KB
references/data-client-rest-setup/references/superagent-migration.mdmarkdown4.1 KB
references/getDefaultManagers.mdmarkdown6.1 KB
references/getDefaultManagers.vue.mdmarkdown3.8 KB
references/installation.mdmarkdown4.0 KB
references/installation.vue.mdmarkdown2.7 KB
references/tanstack-query-migration.mdmarkdown31.1 KB

references/installation.md

View on GitHub
<!-- Generated by `yarn build:skills` from docs/core/getting-started/installation.md (react). Edit the source doc, not this file. -->

# Getting Started with Reactive Data Client

## Set up by hand {#manual-setup}

### Install packages {#install-manually}

```bash
npm install @data-client/react @data-client/test @data-client/rest
```

### Add provider at top-level component {#add-provider-at-top-level-component}

**Web**

```tsx title="index.tsx"
import { DataProvider } from '@data-client/react';
import { createRoot } from 'react-dom/client';
import App from './App';

createRoot(document.body).render(
  <DataProvider>
    <App />
  </DataProvider>,
);
```

Alternatively [integrate state with redux](https://dataclient.io/docs/guides/redux)

**React Native**

```tsx title="index.tsx"
import { DataProvider } from '@data-client/react';
import { AppRegistry } from 'react-native';
import App from './App';

const Root = () => (
  <DataProvider>
    <App />
  </DataProvider>
);
AppRegistry.registerComponent('MyApp', () => Root);
```

Alternatively [integrate state with redux](https://dataclient.io/docs/guides/redux)

**NextJS**

[Full NextJS Guide](https://dataclient.io/docs/guides/ssr#nextjs)

```tsx title="app/layout.tsx"
import { DataProvider } from '@data-client/react/nextjs';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <DataProvider>{children}</DataProvider>
      </body>
    </html>
  );
}
```

**Expo**

```tsx title="app/_layout.tsx"
import { Stack } from 'expo-router';
import { DataProvider } from '@data-client/react';

export default function RootLayout() {
  return (
    <DataProvider>
      <Stack>
        <Stack.Screen name="index" />
      </Stack>
    </DataProvider>
  );
}
```

**Anansi**

[Anansi](https://github.com/ntucker/anansi) (beta) is a fully composable framework for React development with optional
Server Side Rendering.

```bash
npx @anansi/cli hatch my-project
```

Anansi includes Reactive Data Client automatically.

[Next: Define Data »](https://dataclient.io/docs/getting-started/resource)

## Example

Example app: [todo-app](https://github.com/reactive/data-client/tree/master/examples/todo-app) ([`src/index.tsx`](https://github.com/reactive/data-client/blob/master/examples/todo-app/src/index.tsx), [`src/RootProvider.tsx`](https://github.com/reactive/data-client/blob/master/examples/todo-app/src/RootProvider.tsx))

## Supported Tools

<details>

<summary>TypeScript 4.0+</summary>

TypeScript is optional, but requires at least version [4.0](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#variadic-tuple-types) and [strictNullChecks](https://www.typescriptlang.org/tsconfig#strictNullChecks) for full type enforcement.

</details>

<details>

<summary>Older browser support</summary>

If your application targets older browsers (a few years or more), be sure to load polyfills.
Typically this is done with [@babel/preset-env useBuiltIns: 'entry'](https://babeljs.io/docs/en/babel-preset-env#usebuiltins),
coupled with importing [core-js](https://www.npmjs.com/package/core-js) at the entrypoint of your application.

This ensures only the needed polyfills for your browser support targets are included in your application bundle.

For instance `TypeError: Object.hasOwn is not a function`

</details>

<details>

<summary>Internet Explorer support</summary>

If you see `Uncaught TypeError: Class constructor Resource cannot be invoked without 'new'`,
follow the instructions to [add legacy browser support to packages](https://dataclient.io/docs/guides/legacy-browser)

</details>

<details>

<summary>ReactJS 16-19 and React Native</summary>

ReactJS 16.14 and above is supported. React 18 provides improved [Suspense](https://dataclient.io/docs/api/useSuspense)
support and features. Both React Native, [React Navigation](https://reactnavigation.org/) and [Expo](https://docs.expo.dev) are supported.

If you have a working project using other
React libraries, [feel free to share with others](https://github.com/reactive/data-client/discussions/2422) in our
discussions.

</details>
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall