@ion-design/cms
v0.1.0
Published
Framework-neutral runtime client for Ion CMS
Readme
@ion-design/cms
Server-first, framework-neutral access to published Ion CMS content.
import { createIonCMS } from '@ion-design/cms';
export const cms = createIonCMS({
projectId: process.env.ION_CMS_PROJECT_ID!,
publicKey: process.env.ION_CMS_PUBLIC_KEY!,
});The public key reads published revisions only. Keep client construction in server code so a future
credential policy change does not require moving application code. Draft access uses the separate
preview client constructed by @ion-design/cms-next; a draft query flag does not exist.
const page = await cms.entries.list({
collection: 'blog',
limit: 20,
sort: '-publishedAt',
where: [{ field: 'category', operator: 'eq', value: 'news' }],
});
const article = await cms.entries.findBySlug({
collection: 'blog',
slug: 'launch-day',
});The client is server-first ESM with no Node-only dependency. It supports injected fetch,
abort signals, configurable five-second timeouts, bounded retries for safe reads, ETag/304 reuse,
typed IonCmsError failures, and an X-Ion-CMS-SDK-Version request header.
Never pass a preview token to createIonCMS. Use createIonCMSPreview only from server request
code after @ion-design/cms-next has resolved the HTTP-only preview cookie.
