@uxbert-labs/cms-client
v0.2.0
Published
Typed delivery-API SDK + `uxbert-cms typegen` CLI for the UXBERT Labs CMS (cms.uxbert.ai).
Maintainers
Readme
@uxbert-labs/cms-client
Typed SDK for the UXBERT Labs CMS delivery API, plus the
uxbert-cms typegen CLI.
pnpm add @uxbert-labs/cms-clientimport { createClient } from '@uxbert-labs/cms-client';
const cms = createClient({
baseUrl: 'https://cms-api.uxbert.ai',
space: 'my-space',
});
const { items } = await cms.getEntries({ type: 'post', locale: 'en', limit: 10 });
const about = await cms.getEntry('about', { type: 'page', locale: 'ar' });Generate TypeScript types for your space's content model (commit the output; use
--check in CI to catch drift):
npx uxbert-cms typegen --url https://cms-api.uxbert.ai --space my-space --out src/cms/types.gen.tsThe client reads only published snapshots; pass preview: { adminUrl, token } to fetch
drafts inside the live-preview flow (see @uxbert-labs/cms-preview).
