mbt-api-client
v1.1.1
Published
API client with token refresh queue for mbt
Readme
MBT API Client
Typed MBT API client with React context integration and token refresh helpers.
Installation
pnpm add mbt-api-clientPackage Surfaces
mbt-api-client- API client factory, React provider, hooks, and token refresh helpers
Agent Guidance
AGENTS.mdis the package entrypoint for coding agents.- Canonical rules live in
.ai/agent-rules/. - Factual reference lives in
.ai/agent-reference/. - Canonical usage examples live in
.ai/agent-examples/.
Quick Start
import { ApiClientProvider, createApiClient } from 'mbt-api-client';
const apiClient = createApiClient({
urls: {
authService: 'https://api.example.com/auth',
userProgressService: 'https://api.example.com/progress',
recommendationService: 'https://api.example.com/recommendations',
partnerManager: 'https://api.example.com/partners',
adventureManager: 'https://api.example.com/adventures',
bff: 'https://api.example.com/bff',
puzzleController: 'https://api.example.com/puzzles',
micromodeController: 'https://api.example.com/micromodes',
userManager: 'https://api.example.com/users',
monolith: 'https://api.example.com',
},
});
<ApiClientProvider value={apiClient}>
<App />
</ApiClientProvider>;Public Exports
createApiClientApiClientContextApiClientProvideruseApiClientTokenRefreshManagercreateTokenRefreshManager
Required URL Keys
authServiceuserProgressServicerecommendationServicepartnerManageradventureManagerbffpuzzleControllermicromodeControlleruserManagermonolith
Development
pnpm install
pnpm lint
pnpm format
pnpm buildThis repo standardizes on pnpm only.
Notes
- Package-owned agent guidance is versioned with the library and published with the package.
- The consumer app should read the installed package docs from
node_modules/mbt-api-client/....
