Skip to Content
New to cms0? Start with the hosted, self-hosted, or app integration path.

The shape you pass to cms0<T>() becomes the shape of the client.

src/example.ts
const homePage = await cms.homePage(); const articles = await cms.articles();

Accessors are generated from the TypeScript shape that the CLI publishes. If an accessor is missing, republish the schema.

Root content

Root content is a singleton.

src/example.ts
const homePage = await cms.homePage(); await cms.homePage.update({ headline: "A better headline", });

Collections

Array fields become collection accessors.

src/example.ts
const articles = await cms.articles(); const article = await cms.articles.byId("article_id"); await cms.articles.create({ title: "Launch notes", slug: "launch-notes", }); await cms.articles.update("article_id", { title: "Updated title", }); await cms.articles.delete("article_id");

Options

Accessors accept read options:

src/example.ts
const homePage = await cms.homePage({ fields: ["headline", "seo.title"], exclude: ["seo.jsonLd"], includeId: true, locale: "en", });

Use:

  • fields to include specific nested paths
  • exclude to remove specific nested paths
  • includeId to include cms0 object IDs
  • locale when reading localized content
  • response: "envelope" when you need response metadata

Success check

Accessor calls should match your TypeScript schema. If a field does not exist on the client, publish the schema again and confirm the entry file in cms0.config.ts points at the file that calls cms0<T>().