npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@smart-auth/axios

v0.1.2

Published

Axios integration for Smart Auth SDK — automatic token injection, 401 interceptors, and silent refresh with request queuing

Readme

@smart-auth/axios

Axios integration for the Smart Auth SDK ecosystem.

npm License: MIT

What it does

@smart-auth/axios adds authentication interceptors to your Axios instance. Every request gets the access token automatically. If a 401 comes back, it silently refreshes the token and retries — your app code never knows the token expired.

Features

  • 🔑 Auto token injection — Authorization header added to every request
  • 🔄 Silent 401 refresh — Expired token? Refreshed and retried automatically
  • 🚦 Request queuing — Multiple 401s trigger only ONE refresh, others wait
  • 🧹 Cleanup function — Remove interceptors when done

Installation

npm install @smart-auth/axios @smart-auth/core axios

Quick Start

import axios from 'axios';
import { createAuth } from '@smart-auth/core';
import { createSmartAxios } from '@smart-auth/axios';

const auth = createAuth({
  apiBaseUrl: '/api',
  refresh: { endpoint: '/auth/refresh' },
});

const api = axios.create({ baseURL: '/api' });

// One line — all requests are now authenticated
const cleanup = createSmartAxios({ auth, axios: api });

// Just use axios normally — tokens are handled for you
const { data } = await api.get('/protected-resource');
const users = await api.get('/users');

// Cleanup when done
cleanup();

How it works

  1. Request interceptor → Reads the access token from the auth engine and attaches it as Authorization: Bearer <token>
  2. Response interceptor → If a 401 is received, it pauses the request, triggers a token refresh, then retries the original request with the new token
  3. Concurrent safety → If 5 requests all get 401 at once, only 1 refresh happens. The other 4 wait and retry with the new token.

Part of Smart Auth SDK

| Package | Description | | -------------------------------------------------------------------------- | --------------------------- | | @smart-auth/core | Core auth engine (required) | | @smart-auth/react | React Provider & hooks | | @smart-auth/fetch | Fetch wrapper alternative | | @smart-auth/express | Express middleware |

License

MIT © Durjoy Ghosh