# @vercel/fetch

> Opinionated `fetch` optimized for use inside microservices

Latest version **7.0.0** (published 2023-06-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vercel/fetch
pnpm add @vercel/fetch
yarn add @vercel/fetch
bun add @vercel/fetch
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2023-06-21 |
| First published | 2020-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 570 |
| Maintainers | matt.straka, ijjk, quietshu, vercel-release-bot, snokohn, nick.tracey, matheuss, chriswdmr, zeit-bot |

## Links

- npm: https://www.npmjs.com/package/@vercel/fetch
- Repository: https://github.com/vercel/fetch
- Homepage: https://github.com/vercel/fetch#readme
- Issues: https://github.com/vercel/fetch/issues
- npm.io page: https://npm.io/package/@vercel/fetch

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^4.3.3
- [agentkeepalive](https://npm.io/package/agentkeepalive.md) ^4.2.1
- [@types/async-retry](https://npm.io/package/@types/async-retry.md) ^1.4.3
- [@vercel/fetch-retry](https://npm.io/package/@vercel/fetch-retry.md) ^5.0.3
- [@vercel/fetch-cached-dns](https://npm.io/package/@vercel/fetch-cached-dns.md) ^2.0.2

## Recent versions

- 7.0.0 (latest) — 2023-06-21
- 6.2.0 — 2022-02-28
- 6.1.1 — 2021-06-05
- 6.1.0 — 2020-10-16

## README

# @vercel/fetch

[![Build Status](https://github.com/vercel/fetch/workflows/CI/badge.svg)](https://github.com/vercel/fetch/actions?workflow=CI)

Opinionated `fetch` optimized for use inside microservices. Bundles:

- https://github.com/vercel/fetch/tree/main/packages/fetch-retry
- https://github.com/vercel/fetch/tree/main/packages/fetch-cached-dns
- https://github.com/node-modules/agentkeepalive

It automatically configures an `agent` via [agentkeepalive](https://github.com/node-modules/agentkeepalive),
if not provided, with the following settings:

| Name                         | Value |
| ---------------------------- | ----- |
| `maxSockets`                 | 200   |
| `maxFreeSockets`             | 20    |
| `timeout`                    | 60000 |
| `freeSocketKeepAliveTimeout` | 30000 |

## How to use

JavaScript

```js
const fetch = require('@vercel/fetch')(require('some-fetch-implementation'));
```

TypeScript

```typescript
import createFetch from '@vercel/fetch';
import * as fetch from 'some-fetch-implementation';
const fetch = createFetch(fetch);
```

If no fetch implementation is supplied, it will attempt to use peerDep `node-fetch`.

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