# @leumas/api-client

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


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

```js
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`.


---
Source: shared/packages/api-client/README.md
Canonical: https://docs.leumas.tech/p/packages/api-client
