Now with AI-powered page building via MCP Server
Documentation

Installation

Get up and running with cmssy in under 5 minutes.

Last updated: June 7, 2026

Prerequisites

A cmssy site is a standard Next.js (App Router) project that renders your published content with the cmssy SDK. You'll need:

  • Node.js 18+ - we recommend nvm
  • pnpm - our recommended package manager (npm and yarn also work)
  • A Next.js App Router app - new or existing
  • A cmssy workspace - for the API URL, slug, and draft/editor settings

Install the SDK

Add the two SDK packages to your Next.js project:

Create a Next.js app

Starting fresh? Scaffold an App Router project, then add the SDK. (Or skip this and use your existing app.)

Configure

Create cmssy/config.ts exporting a CmssyNextConfig built from environment variables, then add those keys to your .env. Copy the values from your workspace's Settings → Headless page in the cmssy dashboard:

VariableWhat it isWhere to get it
CMSSY_API_URLFull GraphQL endpoint, e.g. https://api.cmssy.io/graphqlSettings → Headless
CMSSY_WORKSPACE_SLUGYour workspace slugSettings → Headless (or the workspace URL)
CMSSY_DRAFT_SECRETSecret that unlocks draft / preview modeSettings → Headless
CMSSY_EDITOR_ORIGINThe admin origin that frames your site - https://www.cmssy.ioFixed value
CMSSY_REVALIDATE_SECRETSecret for the on-publish ISR revalidation webhookSettings → Headless

Keep these secret - never commit .env to version control. In production, set the same variables in your hosting provider (e.g. your Vercel project settings).

Project structure

A typical cmssy site looks like this (see the open-source cmssy-web reference repo):

my-site/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ layout.tsx            # CmssyServerLayout (header/footer)
β”‚   β”œβ”€β”€ [[...path]]/page.tsx  # createCmssyPage - the catch-all page
β”‚   └── api/draft/route.ts    # createDraftRoute - editor preview
β”œβ”€β”€ blocks/
β”‚   └── hero/
β”‚       β”œβ”€β”€ block.ts          # defineBlock(...) + fields
β”‚       └── src/index.tsx     # the React component
β”œβ”€β”€ cmssy/
β”‚   β”œβ”€β”€ config.ts             # CmssyNextConfig + resolveLocale
β”‚   └── blocks.ts             # registry: exports the `blocks` array
└── proxy.ts                  # locale + edit-mode + CSP

Each block lives in its own folder under blocks/ and is registered in cmssy/blocks.ts.

Start development

Run the Next.js dev server:

Open http://localhost:3000 - your site renders published cmssy content.

Editor preview

To edit content visually with live preview, the cmssy editor frames your deployed (or local) site in an iframe. For your project to show up in the editor, you need:

  • Your workspace Preview URL (Settings → Headless) set to your site - e.g. https://your-site.com, or http://localhost:3000 while developing.
  • CMSSY_EDITOR_ORIGIN set to the admin origin (https://www.cmssy.io) - the SDK uses it for the postMessage bridge and the CSP frame-ancestors that lets the admin frame your site.
  • The draft route app/api/draft/route.ts = createDraftRoute(cmssy) so the editor can enter preview / draft mode.
  • proxy.ts applying the CSP via applyCmssyCsp in edit mode.

Then open the page editor in the admin - your site loads in the canvas and edits appear instantly. If you see β€œpreview didn't connect”, double-check the Preview URL and CMSSY_EDITOR_ORIGIN.

Deploy

Deploy like any Next.js app (e.g. Vercel). Set the same environment variables in your hosting provider, then point your workspace's Preview URL at the deployed site so the editor can frame it.

Updating the SDK

Bump both packages together to pick up SDK fixes, then redeploy:

Troubleshooting

Common issues

  • "Preview didn't connect" - CMSSY_EDITOR_ORIGIN must be your admin origin (https://www.cmssy.io), and the workspace Preview URL must point at your site.
  • Blank page - check CMSSY_API_URL is the full GraphQL endpoint and CMSSY_WORKSPACE_SLUG matches your workspace.
  • "Port 3000 already in use" - stop other dev servers or run next dev -p 3001.
  • Node.js version error - upgrade to Node.js 18+ using nvm install 18.

Next Steps

Now that you're set up, explore the following guides:

Terminal
400">"text-violet-400">pnpm add @cmssy/next @cmssy/react
 
500"># or with 400">"text-violet-400">npm
400">"text-violet-400">npm install @cmssy/next @cmssy/react
Fastest start

The quickest way to start is to clone the open-source cmssy-web repo (cmssy.com's own site), point it at your workspace via .env, and run pnpm dev. It already wires up blocks, layout, the editor bridge, and locale routing.

Terminal
400">"text-violet-400">pnpm create next-app@latest my-site
500"># App Router: Yes
 
400">"text-violet-400">cd my-site
400">"text-violet-400">pnpm add @cmssy/next @cmssy/react
cmssy/config.ts
400">"text-violet-400">import 400">"text-violet-400">type { CmssyNextConfig } 400">"text-violet-400">from "@cmssy/next";
 
400">"text-violet-400">export 400">"text-violet-400">const cmssy: CmssyNextConfig = {
apiUrl: process.env.CMSSY_API_URL ?? "",
workspaceSlug: process.env.CMSSY_WORKSPACE_SLUG ?? "",
draftSecret: process.env.CMSSY_DRAFT_SECRET ?? "",
editorOrigin: process.env.CMSSY_EDITOR_ORIGIN ?? "",
defaultLocale: "en",
};
Copy your .env from Settings β†’ Headless

Open Settings β†’ Headless in the cmssy dashboard and copy each value into your project's .env:

CMSSY_API_URL=https://api.cmssy.io/graphql
CMSSY_WORKSPACE_SLUG=your-workspace
CMSSY_DRAFT_SECRET=your-draft-secret
CMSSY_EDITOR_ORIGIN=https://www.cmssy.io
CMSSY_REVALIDATE_SECRET=your-revalidate-secret

Keep secrets out of version control. In production set the same vars in your host (e.g. Vercel project settings).

Terminal
400">"text-violet-400">pnpm dev
 
500"># Next.js dev server -> http:500">//localhost:3000
Terminal
500"># Deploy to Vercel
vercel
 
500"># or just push to your connected Git repo
400">"text-violet-400">git push
SDK versioning

Bump @cmssy/react and @cmssy/next together - @cmssy/next peer-depends on a matching @cmssy/react. After bumping, run pnpm install and redeploy.

Terminal
400">"text-violet-400">pnpm up @cmssy/next @cmssy/react
 
500"># check the installed version
400">"text-violet-400">pnpm why @cmssy/react