Skip to content

ParthKapoor-dev/better-axios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

better-axios banner


⚑️ better-axios

A modern, typed wrapper around Axios β€” with clean APIs, built-in token management, interceptors, and smart global handlers.

npm version npm downloads GitHub stars


πŸš€ Why better-axios?

Say goodbye to repetitive axios setup in every project. better-axios helps you build scalable APIs faster with features like:

  • βœ… Global and custom error/success handlers
  • βœ… Token-based auth with automatic header injection
  • βœ… Type-safe responses with custom error types
  • βœ… Request/response interceptors
  • βœ… Easy-to-extend and override
  • βœ… Built-in support for UI feedback patterns

πŸ“¦ Installation

npm install @parthkapoor-dev/better-axios
# or
yarn add @parthkapoor-dev/better-axios

✨ Features

  • πŸ“š Fully typed API with TypeScript
  • πŸ” Token auth with prefix config (Bearer, etc.)
  • πŸ” Interceptors (great for refresh tokens)
  • ⚠️ Global & local success/error handlers
  • πŸ”§ Easy to use setDefaultHeader(), removeAuthToken(), etc.
  • πŸ“¦ Minimal bundle, no runtime dependencies except axios

πŸ§ͺ Basic Usage

import { AxiosApi } from "@parthkapoor-dev/better-axios"

const api = new AxiosApi({
  baseURL: "https://api.example.com",
})

api.get("/users").then((res) => {
  console.log(res.data)
})

πŸ“„ Full Documentation

πŸ‘‰ Explore the full docs here: https://better-axios.parthkapoor.me

  • Getting Started
  • Auth Token Management
  • Interceptors (Request / Response)
  • Global vs Custom Handlers
  • Error Handling Strategies
  • Recipes & Use Cases

πŸ›  Contributing

Found a bug or have a feature request? We welcome contributions!

# clone the repo
git clone https://github.com/parthkapoor-dev/better-axios.git

# install deps
npm install

# run tests
npm run test

πŸ“„ License

MIT License Β© Parth Kapoor

About

Better Axios πŸ“¦ A Minimal API client wrapper for predictable and powerful Axios usage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published