Add tough-cookie support to axios, allowing automatic cookie management in axios requests. Version 7.0.0 requires Node >=22.0.0 and axios >=0.20.0. Released as ESM-only, ships TypeScript types. Key differentiator: integrates tough-cookie's CookieJar directly into axios by wrapping the instance, supporting custom cookie jars for session persistence. Uses http-cookie-agent under the hood.
npm install axios-cookiejar-supportNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to add a CookieJar to an axios instance and use it to manage cookies automatically.
Use ESM imports (import { wrapper } from 'axios-cookiejar-support'). If you need CJS, pin to ^6.0.0.Upgrade Node to v22+ or downgrade to v6.x.
To use a custom agent (e.g., http-proxy-agent), consider using http-cookie-agent directly instead.
Pass jar in axios.create({ jar }) rather than per-request.Run npm install --save-dev @types/tough-cookie.
Ensure you are using ESM (import) with v7+ or CJS (require) with v6.x.
Make sure to create a CookieJar and pass it to wrapper(axios.create({ jar })).Run npm install axios tough-cookie axios-cookiejar-support.