Docs
/

@leumas/api-client

The ONE isomorphic Leumas API client — fetch wrapper, TTL cache, and public-data loaders.

@leumas/api-client

The ONE isomorphic (browser + node) client for Leumas API: a small fetch wrapper, a TTL cache, and the public-data loaders every surface uses. No per-project axios wrappers.

Absorbs (DRY-consolidated from): leumas-tech/src/lib/publicData.js, z.Domains2/core/src/z.services/*, NPM/AXIOS2.0.

Usage

import { createClient } from '@leumas/api-client';

const api = createClient({ baseUrl: 'https://api.leumas.tech', getToken: () => session.token });

const apps  = await api.publicData.apps();   // TTL-cached
const me    = await api.get('/user/me');
await api.post('/tokens/spend', { amount: 5 });

Exports: createClient, createHttp, createTTLCache, ApiError.

What it exports

19 exports: 7 components, 0 hooks, 12 helpers. Import from @leumas/api-client.

ApiErrorApiErrorFRESHRETRY_DEFAULTSRETRY_DEFAULTSSTALETRANSIENTbackoffMsbuildResourcesbuildResourcescreateClientcreateHttpcreateHttpcreateRealtimeClientcreateTTLCachecreateTTLCachedescribeErrordescribeErrortoWsUrl
Source shared/packages/api-client/README.md (no-git)markdownjson
Generated from the Leumas repository. Every page cites the file it came from.leumas.techllms.txt