Promise-based HTTP client for browser and Node.js built on top of axios, focusing on JWT token lifecycle management. Version 0.1.25 provides an ApiClient class that extends axios with automatic token refresh, request deduplication, and Vue/Nuxt plugins. Unlike raw axios, it handles token storage, refresh logic, and concurrent request queuing out of the box.
npm install jwt-rest-api-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an ApiClient instance with base URL and token refresh endpoint, then performs a GET request with async/await and error handling.
Implement a custom token storage adapter (e.g., using httpOnly cookies).
Import from 'jwt-rest-api-client/src/plugins'.
Manually integrate ApiClient with React using hooks.
Set `deduplicate: false` in config or handle errors to invalidate cache.
Use correct path: import { Vue3Plugin } from 'jwt-rest-api-client/src/plugins'const apiClient = new ApiClient({...})Ensure refresh endpoint returns a new token and update the token storage correctly