# axios-http2-adapter

> `axios-http2-adapter` is a custom adapter designed to fill a gap in the current Axios ecosystem. Despite widespread demand, as evidenced by [axios issue #1175](https://github.com/axios/axios/issues/1175), Axios has yet to implement native HTTP/2 support.

Latest version **1.0.3** (published 2025-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install axios-http2-adapter
pnpm add axios-http2-adapter
yarn add axios-http2-adapter
bun add axios-http2-adapter
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2025-05-22 |
| First published | 2023-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | uibakery |

## Links

- npm: https://www.npmjs.com/package/axios-http2-adapter
- npm.io page: https://npm.io/package/axios-http2-adapter

## Dependencies (2)

- [http2-wrapper](https://npm.io/package/http2-wrapper.md) ~2.2
- [follow-redirects](https://npm.io/package/follow-redirects.md) ~1.15

## Recent versions

- 1.0.3 (latest) — 2025-05-22
- 1.0.2 — 2024-10-18
- 1.0.1 — 2024-01-23
- 1.0.0 — 2023-12-20
- 0.0.1 — 2023-12-19

## README

# axios-http2-adapter
`axios-http2-adapter` is a custom adapter designed to fill a gap in the current Axios ecosystem. Despite widespread demand, as evidenced by [axios issue #1175](https://github.com/axios/axios/issues/1175), Axios has yet to implement native HTTP/2 support. This library offers a seamless solution, integrating HTTP/2 capabilities into Axios via `http2-wrapper`.

## Installation

```bash
npm install axios-http2-adapter
```

## Usage

### Basic usage:

```javascript
const axios = require('axios');
const { createHTTP2Adapter } = require('axios-http2-adapter');

axios.defaults.adapter = createHTTP2Adapter();
```

### Configuration:

```javascript
const axios = require('axios');
const { createHTTP2Adapter } = require('axios-http2-adapter');
const http2 = require('http2-wrapper');

const adapterConfig = {
  agent: new http2.Agent({ /* options */ }),
  force: true // Force HTTP/2 without ALPN check - adapter will not check whether the endpoint supports http2 before the request
};

axios.defaults.adapter = createHTTP2Adapter(adapterConfig);
```

## License
This project is licensed under the [MIT License](https://github.com/uibakery/axios-http2-adapter/blob/master/LICENSE).

## Acknowledgements
[axios](https://github.com/axios/axios)
[http2-wrapper](https://github.com/szmarczak/http2-wrapper)

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