Namespaces
ovok.cms
Read published CMS documents, legal pages, release notes and translations.
- Stable unknown
- Release candidate since 0.4.49-rc.4
- Development since 0.4.49-dev.517+4645a0a
Reads published content from the Ovok CMS. Reads are always made as the client's tenantCode. Legal pages and translations can be read before sign-in; other collections need a signed-in user.
Read a legal page
const terms = await ovok.cms.legalPage('terms-and-conditions', { locale: 'de-DE' });localetakes an app language (de-DE) or a CMS locale (de). Omitted, the CMS answers in its default locale.- The
bodyfield is rich-text JSON, not HTML; render it with a rich-text renderer.
List and read documents
const page = await ovok.cms.documents.list('faqs', { limit: 20, sort: '-publishedAt' });
for await (const doc of ovok.cms.documents.list('faqs')) {
console.log(doc.title);
}
const doc = await ovok.cms.documents.retrieve('faqs', 'how-to-pair-a-device');listreturns aPagePromise: await it for the first page, orfor awaitto walk every page.limitis at most 50.sortnames a top-level field; prefix it with-for descending.retrievetakes a slug and throwsOvokValidationErrorfor an empty one. A draft and a missing document both come back as not found.- Both calls use
v1/public/cms/collections/{collection}/itemsand merge in the shared tenant's published documents.
Release notes
const notes = await ovok.cms.releaseNotes.list({ limit: 5 });- Same paging and params as
documents.list; newest first unlesssortsays otherwise.
Load translations
const translations = await ovok.cms.translations('de');- Returns the
translationscollection as one nested tree: one group per document slug, with keys split at the dots. - Reads every page of the collection, 50 documents at a time. If the CMS still offers a next page after 500 pages, it throws
OvokErrorwith codecms_translations_page_limitinstead of returning a partial tree. - Nothing is cached on the device. Cache the result in your app if you need it offline.
Reference
- cms API reference: every method and type.
- ovok.content: the older content routes.
- Errors and retries
Last updated on