Builds

13 repos

Showing 13 of 13 projects

Screenshot of Better Axios

~/builds/better-axios

04Featured

Better Axios

Typed Axios wrapper with built-in auth, interceptors and error handling

better-axios is a small TypeScript wrapper around Axios for projects that re-implement the same auth-header and error-handling boilerplate on every API client. It packages that pattern into one class so both API calls and generated CLIs get consistent auth and error behavior.

An `AxiosApi` class wraps an Axios instance, injecting auth tokens onto requests via a configurable header and prefix, and running global or per-call success/error handlers through request and response interceptors, with typed responses and a custom error type. It ships as an npm package with its own CLI (built on Commander and Inquirer) and a docs site.

Highlights

  • Token-based auth with automatic header injection and configurable prefix (e.g. Bearer)
  • Global and per-request success/error handlers layered onto Axios interceptors
  • Typed responses and a custom error type instead of raw Axios errors
  • Ships as a CLI (`axios-wrapper`) built on Commander and Inquirer, alongside the library
  • Published to npm as @parthkapoor-dev/better-axios, tested with Jest and axios-mock-adapter