# Compatibility (https://effetch.monarcode.dev/docs/reference/compatibility)

Before you upgrade Effect, or add Effetch to a project on an unusual
runtime, check here. This page lists what Effetch supports, and keeps what
CI tests separate from what Effetch is built for but CI doesn't test.

## Effect

Effetch has one peer dependency, `effect`, in the range `^4.0.0`. Install it
next to Effetch, as [Installation](https://effetch.monarcode.dev/docs/installation) shows.

CI tests two versions in that range:

- **The full check** runs with the `effect` version pinned in Effetch's own
  `devDependencies`, which can be older than the newest 4.x. It covers
  types, tests, the build and the installed package.
- **A second job** typechecks, tests and builds with `effect` 4.0.0, the
  oldest version in the range.

One feature needs Effect 4.1. From 4.1 on, a query value can be `Redacted`:
it's sent as its value, and Effect keeps it out of its own logs. On 4.0,
the query type doesn't accept a `Redacted` value, and one forced in with a
cast is sent as the text `<redacted>`.

## Runtimes

Effetch is plain TypeScript with no platform-specific code: no Node.js
modules, no Node.js globals and no separate builds. Requests go through the
`HttpClient` you provide, so most of what a runtime needs comes from that
client. `FetchHttpClient.layer`, for example, uses the global `fetch`.

The following table shows where Effetch is built to run, and which runtimes
CI tests:

| Runtime                             | Tested in CI                               |
| ----------------------------------- | ------------------------------------------ |
| Node.js 24                          | Yes: the tests and the installed package   |
| Node.js 20 and 22                   | No. The build targets ES2020.              |
| Browsers                            | No. See [Platform notes](https://effetch.monarcode.dev/docs/platforms). |
| React Native, with Hermes and Metro | No. See [Platform notes](https://effetch.monarcode.dev/docs/platforms). |
| Bun and Deno                        | No                                         |

Effetch builds every URL as a string and never calls `new URL()` itself,
since React Native's `URL` is incomplete. Effect's `HttpClient` does use
`URL` when it sends a request, and so does an endpoint's `url` helper. For
what that means on React Native, see
[Platform notes](https://effetch.monarcode.dev/docs/platforms#react-native).

## Modules

The package is ESM only. It marks itself as free of side effects
(`"sideEffects": false`), so bundlers drop what you don't import, and its
`exports` map has a `types` and a `default` condition for each entry point.

## TypeScript

Effetch needs TypeScript 5.7 or later. Its declarations use typed arrays
with a type argument, such as `Uint8Array<ArrayBuffer>`, which older
versions reject. With `skipLibCheck: true`, TypeScript 5.4 to 5.6 compile
a project that uses Effetch, but some of its types, such as
`Fetch.bytes()`'s, quietly become `any`.

CI checks the types with TypeScript 6.0.3, in three ways:

- A project that installs the packed package compiles under `NodeNext` and
  `Bundler` resolution, with `skipLibCheck: false`, and emits declaration
  files that name Effetch's types.
- Are the Types Wrong checks that the types resolve for Node.js's ESM
  resolution and for bundlers.
- Effetch's tests and examples, and the examples in these docs, compile
  with `exactOptionalPropertyTypes` and `noUncheckedIndexedAccess` on. The
  installed-package project compiles with them off.

## What's next

- [Platform notes](https://effetch.monarcode.dev/docs/platforms): set Effetch up for browsers and React
  Native.
- [Limitations](https://effetch.monarcode.dev/docs/reference/limitations): check the known limits of
  paths, plugins and streams.