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

@cheng.du100/api-debug-panel

v0.1.1

Published

Framework agnostic frontend API debug panel with fetch, XHR, axios interception and Vue 2/3 support.

Readme

@cheng.du100/api-debug-panel

Framework agnostic frontend API debug panel. Supports fetch, XMLHttpRequest, optional axios interception, Shadow DOM UI and Vue 2/3 plugin usage.

Runtime Compatibility

  • Browser runtime: modern browsers with fetch/XHR support.
  • Package syntax target: ES2019.
  • Node.js for install/build tooling: 16-20.

Install

npm install @cheng.du100/api-debug-panel

Basic Usage

import { initApiDebugPanel } from '@cheng.du100/api-debug-panel';

const panel = initApiDebugPanel({
  enabled: false,
  timeout: 10000,
  position: 'bottom-right',
  includeSuccess: false,
  ignoreUrls: ['/health', '/metrics']
});

panel.enable();
panel.disable();
panel.setEnabled(true);

Switch Config

The panel is disabled by default unless you explicitly enable it.

initApiDebugPanel({ enabled: true });

Use enabled: 'auto' to read a browser-side switch. Empty or missing values mean disabled.

initApiDebugPanel({
  enabled: 'auto',
  queryKey: 'api_debug',
  storageKey: 'API_DEBUG',
  globalKey: '__API_DEBUG__'
});

Supported truthy values: 1, true, yes, on, enable, enabled.

Supported falsy values: 0, false, no, off, disable, disabled.

Examples:

localStorage.setItem('API_DEBUG', '1');
window.__API_DEBUG__ = true;
// Or open: https://example.com?api_debug=1

You can also pass a custom resolver:

initApiDebugPanel({
  enabled: () => import.meta.env.DEV || localStorage.getItem('API_DEBUG') === '1'
});

Vue 3

import { createApp } from 'vue';
import App from './App.vue';
import { createApiDebugPanelPlugin } from '@cheng.du100/api-debug-panel/vue';

createApp(App)
  .use(createApiDebugPanelPlugin({
    enabled: 'auto',
    timeout: 10000,
    includeSuccess: false
  }))
  .mount('#app');

In a production app, prefer a guarded resolver:

createApiDebugPanelPlugin({
  enabled: () => import.meta.env.DEV || localStorage.getItem('API_DEBUG') === '1'
});

Vue 2

import Vue from 'vue';
import App from './App.vue';
import ApiDebugPanelVue2 from '@cheng.du100/api-debug-panel/vue2';

Vue.use(ApiDebugPanelVue2, {
  enabled: 'auto',
  timeout: 10000,
  includeSuccess: true,
  position: 'bottom-right'
});

new Vue({
  render: h => h(App)
}).$mount('#app');

The controller is available as this.$apiDebugPanel by default. You can customize the property name:

Vue.use(ApiDebugPanelVue2, {
  enabled: 'auto',
  propertyName: '$debugApi'
});

You can also use the core API directly in Vue 2:

import { initApiDebugPanel } from '@cheng.du100/api-debug-panel';

Vue.prototype.$apiDebugPanel = initApiDebugPanel({ enabled: 'auto' });

Axios

const panel = initApiDebugPanel({ enabled: true });
panel.interceptAxios(axiosInstance);

API

  • initApiDebugPanel(options)
  • destroyApiDebugPanel()
  • setApiDebugEnabled(boolean)
  • isApiDebugEnabled()
  • clearApiDebugRecords()
  • getApiDebugRecords()
  • controller.enable()
  • controller.disable()
  • controller.setEnabled(boolean)
  • controller.isEnabled()
  • controller.interceptAxios(axiosInstance)

Options

type ApiDebugPanelOptions = {
  enabled?: boolean | 'auto' | (() => boolean);
  timeout?: number;
  position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
  includeSuccess?: boolean;
  ignoreUrls?: Array<string | RegExp | ((url: string) => boolean)>;
  maxRecords?: number;
  captureRequestBody?: boolean;
  captureResponseBody?: boolean;
  captureHeaders?: boolean;
  maskFields?: string[];
  title?: string;
  zIndex?: number;
  queryKey?: string;
  storageKey?: string;
  globalKey?: string;
};

Security

The panel is disabled unless enabled resolves to true. Sensitive fields such as authorization, cookie, token and password are masked by default.