# Installation (https://effetch-query.monarcode.dev/docs/installation)

Effetch Query is one package. You add it beside Effect, and beside Effetch,
React and your router if you use them. This page shows the command for each.

## Before you begin

You need:

- `effect` 4.1 or later, which is a peer dependency;
- an ESM project, since the package is ESM only;
- one of the supported runtimes: browsers, React Native (Hermes), Node 20
  or later, Bun or Deno.

## Install the package

To install Effetch Query with Effetch and Effect, run the following
command:

```bash
pnpm add @monarcode/effetch-query @monarcode/effetch effect
```

If you use Effetch, you need `0.1.0-rc.4` or later in 0.1. You import it
as `import { Fetch } from "@monarcode/effetch"`. Effetch is optional: to
use any Effect instead, see
[Queries from any Effect](https://effetch-query.monarcode.dev/docs/queries/without-effetch).

## Add React

For React, add `@effect/atom-react` 4.1 or later and `react` 19:

```bash
pnpm add @effect/atom-react react
```

## Add TanStack Router

To connect a client to TanStack Router or TanStack Start, add
`@tanstack/react-router` 1.170.33 or later in 1.x:

```bash
pnpm add @tanstack/react-router
```

[TanStack Router and Start](https://effetch-query.monarcode.dev/docs/frameworks/tanstack-start) shows the
setup.

## Add React Native's signals

In React Native, the client hears that the app came back into focus or
online from React Native's `AppState` and NetInfo. Effetch Query doesn't
depend on either: you pass them in. Add NetInfo if your app doesn't have
it:

```bash
pnpm add @react-native-community/netinfo
```

[React Native](https://effetch-query.monarcode.dev/docs/react/react-native) shows the setup.

## Import the entry points

Each entry point is a subpath of the one package, such as
`@monarcode/effetch-query/react`, so you import only what you use. The core
entry point exports namespaces:

```ts
import { Mutation, Query, QueryClient } from "@monarcode/effetch-query";
```

If this line compiles, the package is installed.
[Entry points](https://effetch-query.monarcode.dev/docs/reference) lists every entry point and what it
exports.

## What's next

- [Getting started](https://effetch-query.monarcode.dev/docs/getting-started): build a small todo app, end
  to end.
- [Coming from TanStack Query](https://effetch-query.monarcode.dev/docs/coming-from-tanstack-query): if you
  know TanStack Query, the same ideas under their names here.