# cloudflare-bread

> JavaScript fetch API client for Cloudflare's API with TypeScript definitions generated from the new Cloudflare's OpenAPI schema.

Latest version **0.2.1** (published 2023-05-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install cloudflare-bread
pnpm add cloudflare-bread
yarn add cloudflare-bread
bun add cloudflare-bread
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2023-05-23 |
| First published | 2022-11-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Stefan Maric |
| Maintainers | stefanmaric |
| Keywords | cloudflare, api, openapi, typescript, node, browser, fetch |

## Links

- npm: https://www.npmjs.com/package/cloudflare-bread
- Repository: https://github.com/stefanmaric/cloudflare-bread
- Issues: https://github.com/stefanmaric/cloudflare-bread/issues
- npm.io page: https://npm.io/package/cloudflare-bread

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2023-05-23
- 0.2.0 — 2023-05-23
- 0.1.0 — 2022-11-17

## README

# cloudflare-bread

JavaScript fetch API client for Cloudflare's API with TypeScript definitions generated from the new Cloudflare's OpenAPI schema.

## Project status

Alpha: being used in certain non-critical applications

## Usage

Install with your package manager of choice:

```shell
npm install cloudflare-bread

# or...

yarn add cloudflare-bread

# or...

pnpm install cloudflare-bread
```

Use the API and get type definitions:

```typescript
import { createClient } from 'cloudflare-bread'

const client = createClient({ token: process.env.CLOUDFLARE_API_TOKEN })

const response = await client.zones.zoneIdentifier('example.com').dns_records.$get({
  searchParams: {
    type: 'CNAME'
  }
})

if (response.status === 200) {
  const results = await response.json()
  //    ^? this will be typed
}
```

## TODO

- [ ] Collapse different params on the same position into a single one.
- [ ] Fix `searchParams` being required even tho none of the params are actually required
- [ ] Improve types of middleware

## License

MIT, see [LICENSE](./LICENSE)

---
_Source: https://npm.io/package/cloudflare-bread · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
