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.

const terms = await ovok.cms.legalPage('terms-and-conditions', { locale: 'de-DE' });
  • locale takes an app language (de-DE) or a CMS locale (de). Omitted, the CMS answers in its default locale.
  • The body field 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');
  • list returns a PagePromise: await it for the first page, or for await to walk every page.
  • limit is at most 50. sort names a top-level field; prefix it with - for descending.
  • retrieve takes a slug and throws OvokValidationError for an empty one. A draft and a missing document both come back as not found.
  • Both calls use v1/public/cms/collections/{collection}/items and 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 unless sort says otherwise.

Load translations

const translations = await ovok.cms.translations('de');
  • Returns the translations collection 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 OvokError with code cms_translations_page_limit instead of returning a partial tree.
  • Nothing is cached on the device. Cache the result in your app if you need it offline.

Reference

Last updated on

On this page