{"library":"refresh-fetch","type":"library","category":null,"description":"A wrapper around the fetch API that automatically handles authentication token refreshing. Current stable version is 0.9.0. It intercepts fetch responses, detects token expiry via a configurable `shouldRefreshToken` callback, performs token refresh via a `refreshToken` function, and retries the original request. Unlike manual token management, refresh-fetch abstracts the retry logic and ensures concurrent requests are serialized during token refresh. Requires ES6 Promise and fetch. Suitable for single-page apps using bearer tokens with expiry.","language":"javascript","status":"active","version":"0.9.0","tags":["javascript","api","fetch","auth","token","refresh"],"last_verified":"Sun Jun 07","install":[{"cmd":"npm install refresh-fetch","imports":["import { configureRefreshFetch } from 'refresh-fetch'","import { fetchJSON } from 'refresh-fetch'","import type { RefreshFetchConfig, RefreshFetch } from 'refresh-fetch'; import { configureRefreshFetch } from 'refresh-fetch'"]},{"cmd":"yarn add refresh-fetch","imports":[]},{"cmd":"pnpm add refresh-fetch","imports":[]}],"homepage":"https://github.com/vlki/refresh-fetch","github":"https://github.com/vlki/refresh-fetch","docs":null,"changelog":null,"pypi":null,"npm":"refresh-fetch","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}