# axios-with-cookies

> Fork of axios-cookiejar-support with configurable http(s)-agent

Latest version **1.0.2** (published 2022-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install axios-with-cookies
pnpm add axios-with-cookies
yarn add axios-with-cookies
bun add axios-with-cookies
```

## 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 | 1.0.2 |
| Published | 2022-11-23 |
| First published | 2022-11-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.0.0 |
| Dependencies | 1 |
| Unpacked size | 190.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | maugenst |
| Maintainers | maugenst |
| Keywords | axios, cookie, cookiejar, cookies, tough-cookie, http-agent, https-agent |

## Links

- npm: https://www.npmjs.com/package/axios-with-cookies
- Repository: https://github.com/maugenst/axios-with-cookies
- Homepage: https://github.com/maugenst/axios-with-cookies#readme
- Issues: https://github.com/maugenst/axios-with-cookies/issues
- npm.io page: https://npm.io/package/axios-with-cookies

## Dependencies (1)

- [http-cookie-agent](https://npm.io/package/http-cookie-agent.md) ^4.0.2

## 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

- 1.0.2 (latest) — 2022-11-23
- 1.0.1 — 2022-11-23
- 1.0.0 — 2022-11-23

## README

# axios-with-cookies

![axios-with-cookies](./docs/images/axios-with-cookies.jpg)
Background-Photo by [Lisa Fotios](https://www.pexels.com/photo/macro-photography-of-pile-of-3-cookie-230325/)

[![npm](https://flat.badgen.net/npm/v/with-cookies)](https://www.npmjs.com/package/axios-with-cookies)
[![license](https://flat.badgen.net/badge/license/MIT/blue)](LICENSE)

# axios-with-cookies
This project is a fork of axios-cookiejar-support which lacks the possibility to add configurable
http(s)-agents. It is based on the initial work of Masahiro Miyashiro (@3846masa).

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

## Install

```
npm install axios tough-cookie axios-with-cookies
```

## Usage

```ts
import * as axios from 'axios';
import {AxiosInstance, AxiosStatic} from 'axios';
import {CookieJar, MemoryCookieStore} from 'tough-cookie';
import {wrapper} from 'axios-cookiejar-support';

const axiosInstance: AxiosInstance = ((axios as unknown) as AxiosStatic).create({
  httpsAgent: new HttpsCookieAgent({
    cookies: {
      jar: new CookieJar(new MemoryCookieStore(), {looseMode: true})      
    },
    rejectUnauthorized: false,
    keepAlive: true,
    timeout: 100000
  })
});
this.client = wrapper(axiosInstance);

await this.client.get('https://example.com');
```

See [examples](./examples) for more details.

## Contributing

PRs welcome.

## License

[MIT (c) maugenst](./LICENSE)

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