@drsneox-tools/api-debugger
v0.2.0
Published
Headless axios API request debugger for development
Maintainers
Readme
@drsneox-tools/api-debugger
Headless axios API request debugger for development.
Install
npm install @drsneox-tools/api-debugger axiosUsage
import axios from 'axios';
import {
configureApiDebugger,
installApiRequestDebugger,
patchApiDebugFromAxiosError,
} from '@drsneox-tools/api-debugger';
configureApiDebugger({
enabled: import.meta.env.DEV,
storageKeyPrefix: 'my-app-api-debugger',
modalPhrases: ['Hello debugger'],
});
const api = axios.create({ baseURL: '/api/v1' });
installApiRequestDebugger([api]);
// In axios error handler:
patchApiDebugFromAxiosError(error);Configuration
| Option | Default | Description |
|--------|---------|-------------|
| enabled | false | Enable interceptors |
| storageKeyPrefix | api-request-debugger | localStorage key prefix |
| maxEntries | 200 | Max stored requests |
| modalPhrases | [] | Default modal title phrases (editable in UI, stored in localStorage) |
| initiatorSkipPatterns | package defaults | Stack frames to skip |
| weatherOpenMeteoProxyUrl | /debug-proxy/open-meteo/... | Proxy URL for weather widget (app-specific) |
| weatherWttrProxyUrl | /debug-proxy/wttr/... | Fallback weather proxy |
| exchangeRatesProxyUrl | /debug-proxy/cbr-xml-daily/... | Exchange rates proxy |
UI
Use @drsneox-tools/api-debugger-mantine for Mantine UI component.
License
MIT
