Registry / devops / axios-kite

axios-kite

JSON →
library2.1.0jsnpmunverified

AxiosKite is an enhanced wrapper around Axios (v2.1.0, actively maintained) that adds built-in response unwrapping, token management with automatic 401 refresh, request retry (with exponential backoff), deduplication, caching, cancellation, tracing (X-Trace-Id), field transformation (camelCase/snake_case), circuit breaker, and request queuing. It uses a curried request API, ships TypeScript definitions, and is designed for fastify/DI ecosystems. Compared to raw Axios, it offers zero-config enterprise features without sacrificing the native Axios API. New in v2: DoubleCertification, circuit breaker. First stable release: v1.0.

npm install axios-kite
INSTALL
IMPORT
SIG · AXIOS-KITE
A
axios-kite
devopsjavascriptv2.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AxiosKite
import { AxiosKite } from 'axios-kite'
const { AxiosKite } = require('axios-kite')
ESM-only package; CJS require() will fail. Use import syntax.
Token
import { Token } from 'axios-kite'
import Token from 'axios-kite'
Token is a named export, not default. TypeScript supports named imports directly.
AxiosKiteOptions
import type { AxiosKiteOptions } from 'axios-kite'
import { AxiosKiteOptions } from 'axios-kite'
Use type-only import for interfaces to avoid runtime overhead if not needed.

Creates an AxiosKite instance with base URL, timeout, response unwrapping, retry, and a global bearer token interceptor, then makes a GET request.

import { AxiosKite, Token } from 'axios-kite' const token = new Token('access_token') const api = new AxiosKite({ BaseUrl: 'https://api.example.com', TimeOut: 5000, unwrapResponse: true, retry: { maxRetries: 2, retryDelay: (attempt) => attempt * 1000, }, }, { beforeRequest: (config) => { const t = token.getToken() if (t) config.headers.Authorization = `Bearer ${t}` return config }, }) async function main() { const res = await api.get<{ name: string }>('/hello')() console.log(res.data.name) } main().catch(console.error)
Debug
Known issues
breakingVersion 2.0+ changed the constructor signature: second parameter must be an object with beforeRequest and responseError interceptors, not previously used function.
fix
Update constructor call to pass interceptors object: new AxiosKite({...}, {beforeRequest: ..., responseError: ...}).
affects: >=2.0
breakingunwrapResponse default changed from true to false in v2.1.0? Previous versions defaulted to true, now it must be explicitly set.
fix
Set unwrapResponse: true in options if you need automatic response unwrapping.
affects: >=2.1.0
gotchaThe request methods are curried: .get()() — forgetting the second invocation parentheses will not execute the request.
fix
Always call method twice: api.get(url)() or api.post(url)(body). The first call returns a function expecting optional body/query.
affects: >=1.0
deprecatedThe old 'retry.delay' config (single number) is deprecated in v2. Use 'retryDelay' (function or number) instead.
fix
Replace retry: { delay: 1000 } with retry: { retryDelay: 1000 } or retry: { retryDelay: (attempt) => attempt * 1000 }.
affects: >=2.0
Errors
Common errors & fixes
TypeError: axios_kite_1.AxiosKite is not a constructor
Using CommonJS require() on an ESM-only package.
fix
Switch to import statement: import { AxiosKite } from 'axios-kite'
Uncaught TypeError: (intermediate value).get(...) is not a function
Forgetting the second invocation parentheses on curried methods.
fix
Call method with two sets of parentheses: api.get('/url')()
AxiosError: Request failed with status code 401 (no refresh attempt)
DoubleCertification (auto-refresh) is not configured or not enabled.
fix
Set isDoubleCertification: true in AxiosKite options and call api.doubleCertification() with refresh logic.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
axiosrequiredCore HTTP client. axios-kite wraps and extends axios.
Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
axios-kite — npm install axios-kite · libregistry