Skip to content

Commit 2d9d71e

Browse files
skulidropekCodex
andauthored
docs: add root README for releases (#11)
Co-authored-by: Codex <codex@local>
1 parent dc45ffb commit 2d9d71e

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# openapi-effect
2+
3+
Drop-in replacement for `openapi-fetch` with an opt-in Effect API.
4+
5+
## Install
6+
7+
```bash
8+
pnpm add @prover-coder-ai/openapi-effect
9+
```
10+
11+
## Usage (Promise API)
12+
13+
This package re-exports `openapi-fetch`, so most code can be migrated by changing only the import.
14+
15+
```ts
16+
import createClient from "@prover-coder-ai/openapi-effect"
17+
import type { paths } from "./openapi"
18+
19+
const client = createClient<paths>({ baseUrl: "https://api.example.com" })
20+
21+
const { data, error } = await client.GET("/pets", {
22+
params: { query: { limit: 10 } }
23+
})
24+
25+
if (error) {
26+
// handle error
27+
}
28+
```
29+
30+
## Usage (Effect API)
31+
32+
Effect-based client is available as an opt-in API.
33+
34+
```ts
35+
import { createClientEffect, FetchHttpClient } from "@prover-coder-ai/openapi-effect"
36+
```

0 commit comments

Comments
 (0)