{
  "schema": "leumas.docs.page/1",
  "id": "pkg:@leumas/api-client",
  "slug": "packages/api-client",
  "kind": "capabilities",
  "bucket": "package",
  "title": "@leumas/api-client",
  "name": "@leumas/api-client",
  "eyebrow": null,
  "chip": null,
  "summary": "The ONE isomorphic Leumas API client — fetch wrapper, TTL cache, and public-data loaders.",
  "keywords": [
    "api-client",
    "loaders",
    "public-data",
    "isomorphic",
    "cache",
    "api client api",
    "leumas api client",
    "wrapper"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# @leumas/api-client\n\nThe ONE isomorphic (browser + node) client for Leumas API: a small fetch wrapper, a TTL cache, and the\npublic-data loaders every surface uses. No per-project axios wrappers.\n\n**Absorbs (DRY-consolidated from):** `leumas-tech/src/lib/publicData.js`, `z.Domains2/core/src/z.services/*`, `NPM/AXIOS2.0`.\n\n## Usage\n\n```js\nimport { createClient } from '@leumas/api-client';\n\nconst api = createClient({ baseUrl: 'https://api.leumas.tech', getToken: () => session.token });\n\nconst apps  = await api.publicData.apps();   // TTL-cached\nconst me    = await api.get('/user/me');\nawait api.post('/tokens/spend', { amount: 5 });\n```\n\nExports: `createClient`, `createHttp`, `createTTLCache`, `ApiError`.\n",
  "source": {
    "path": "shared/packages/api-client/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 889,
    "hash": "20282c72d20d28012521757dde9f1646643350e1"
  },
  "urls": {
    "html": "/p/packages/api-client",
    "json": "/docs/packages/api-client.json",
    "md": "/docs/packages/api-client.md"
  },
  "links": {
    "composes": [],
    "usedBy": [
      "pkg:@leumas/assets-sdk",
      "pkg:@leumas/connectors",
      "pkg:@leumas/features",
      "pkg:@leumas/leviathan",
      "pkg:@leumas/studio"
    ],
    "product": [
      "pkg:@leumas/admin",
      "pkg:@leumas/studio",
      "pkg:@leumas/web"
    ],
    "howTo": [],
    "skills": []
  },
  "exports": {
    "total": 19,
    "component": 7,
    "hook": 0,
    "helper": 12,
    "names": [
      {
        "n": "ApiError",
        "k": "component"
      },
      {
        "n": "ApiError",
        "k": "component"
      },
      {
        "n": "FRESH",
        "k": "component"
      },
      {
        "n": "RETRY_DEFAULTS",
        "k": "component"
      },
      {
        "n": "RETRY_DEFAULTS",
        "k": "component"
      },
      {
        "n": "STALE",
        "k": "component"
      },
      {
        "n": "TRANSIENT",
        "k": "component"
      },
      {
        "n": "backoffMs",
        "k": "helper"
      },
      {
        "n": "buildResources",
        "k": "helper"
      },
      {
        "n": "buildResources",
        "k": "helper"
      },
      {
        "n": "createClient",
        "k": "helper"
      },
      {
        "n": "createHttp",
        "k": "helper"
      },
      {
        "n": "createHttp",
        "k": "helper"
      },
      {
        "n": "createRealtimeClient",
        "k": "helper"
      },
      {
        "n": "createTTLCache",
        "k": "helper"
      },
      {
        "n": "createTTLCache",
        "k": "helper"
      },
      {
        "n": "describeError",
        "k": "helper"
      },
      {
        "n": "describeError",
        "k": "helper"
      },
      {
        "n": "toWsUrl",
        "k": "helper"
      }
    ]
  }
}
