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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@allcardtech/axios-tracing

v0.1.21

Published

Reusable axios instance with token management and header injection for web applications.

Downloads

20

Readme

axios-tracing

A customized Axios instance with automatic browser tracking, tracing, and token management - by Allcard Tech @2025

Features

  • Automatic browser detection and tracking
  • Request tracing with UUID
  • Token management
  • Content-type handling
  • Built-in interceptors

Installation

npm install @allcardtech/axios-tracing

Usage

Basic Usage

import createAxiosInstance from '@allcardtech/axios-tracing';

const api = createAxiosInstance({
  baseURL: 'https://api.example.com'
});

With Token Management

import createAxiosInstance from '@allcardtech/axios-tracing';

// Example token getter
const getToken = () => YOUR_TOKEN;

const api = createAxiosInstance({
  baseURL: 'https://api.example.com',
  getToken,
  contentType: 'application/json'
});

With Environment Variables (Vite Example)

import createAxiosInstance from '@allcardtech/axios-tracing';

export const axiosInstance = createAxiosInstance({
  baseURL: YOUR_GATEWAY_URL,
  getToken: () => YOUR_TOKEN
});

API Reference

createAxiosInstance(options)

Creates a configured axios instance with tracking and token management.

Options

| Parameter | Type | Default | Description | |-------------|----------|---------------------|--------------------------------| | baseURL | string | '' | Base URL for all requests | | getToken | function | null | Function that returns token | | contentType | string | 'application/json' | Default Content-Type header |

Added Headers

The instance automatically adds these headers to requests:

  • Authorization: Bearer token (when token is available)
  • x-browser-details: Browser information (name, version, device type)
  • x-trace-id: Unique UUID for request tracing

Error Dialog Component

StandardErrorDialog

Display error messages with trace IDs and support contact information.

Props

| Prop | Type | Required | Description | |-----------------|----------|----------|------------------------------------| | open | boolean | Yes | Controls dialog visibility | | onClose | function | Yes | Callback when dialog is closed | | customErrorCode | string | No | HTTP error code (e.g., "503") | | traceId | string | No | Unique trace ID for error tracking | | supportEmail | string | No | Support contact email |

Example Usage

import { StandardErrorDialog } from '@allcardtech/axios-tracing';


  <StandardErrorDialog
    open={isApiError}
    onClose={() => handleOnClose()} 
    customErrorCode="CUSTOM_ERROR_CODE"
    traceId="YOUR_TRACE_ID"
    supportEmail="YOUR_SUPPORT_EMAIL"
  />

export default MyComponent;

Dependencies

  • "@fontsource/montserrat": "^5.2.6"
  • "@fontsource/roboto": "^5.2.6"
  • "@fontsource/sora": "^5.2.6"
  • "@mui/material": "^7.1.1"
  • "axios": "^1.9.0"
  • "prop-types": "^15.8.1"
  • "react": "^19.1.0"
  • "ua-parser-js": "^2.0.6"
  • "uuid": "^13.0.0"

License

© Allcard Tech 2025