Skip to Content
Read the release notes before upgrading production environments.
Getting StartedFramework Setup

1) Install the SDK/CLI package

pnpm add @cms0/cms0

2) Configure API environment variables

Use environment variables for the admin base URL and API key.

CMS0_API_BASEURL=http://localhost:4002 CMS0_API_KEY=your_api_key_here

For Vite/browser usage, you can expose framework-prefixed variables too:

VITE_CMS0_API_BASEURL=http://localhost:4002 VITE_CMS0_API_KEY=your_api_key_here

3) Create cms0.config.ts

At your project root:

import "dotenv/config"; import { defineConfig } from "@cms0/cms0/config"; export default defineConfig({ entry: "./src/data/cms0.ts", api: { baseUrl: process.env.CMS0_API_BASEURL, key: process.env.CMS0_API_KEY, }, });

4) Add schema entry module

Create src/data/cms0.ts:

import { cms0 } from "@cms0/cms0"; type RootSchema = { HomePage: { title: string; subtitle: string; }; }; export const data = cms0<RootSchema>({ apiConfig: { baseUrl: process.env.CMS0_API_BASEURL ?? import.meta.env.VITE_CMS0_API_BASEURL, key: process.env.CMS0_API_KEY ?? import.meta.env.VITE_CMS0_API_KEY, }, });

5) Run your first generation

npx cms0 build

If this succeeds, your app is wired correctly and ready for the first editable content flow.