Build a Next.js landing page with a CMS your client can rearrange
Build a Next.js landing page from four CMS blocks, hand it to your client, and watch them move sections and change copy on the live page with no deploy.
By the end of this tutorial you have a Next.js landing page built from four CMS blocks, and a client who can reorder those blocks, rewrite them and publish without asking you for a deploy. That's the whole point of a Next.js landing page CMS setup: after handover, content changes stop being your tickets.
Here is the scene we built it for. You make a site for Harbor Yoga, a small studio. They want a page at /retreat for a spring retreat: a hero, three reasons to come, a strip of numbers (days, sessions, places left) and a booking button. Two weeks after launch the owner messages you on a Tuesday morning: "Can the numbers go above the reasons? And the button should say 'Book a place' now." On most hand-built Next.js sites that is a ticket, a commit and a deploy. On this one it is the owner's two minutes in the editor.
You own the blocks: the markup, the styling and which fields exist. Cmssy owns what goes in them and their order on each page, and serves both over the delivery API. Cmssy never renders or hosts the page; the site stays your Next.js app on your host.
TL;DR
- Clone
cmssy-io/examples, opennext-storefront, and copy four blocks:hero,value-props,stats-bandandcta-banner. - Register them in
cmssy/blocks.ts, link the app to your workspace, and add the/api/revalidateroute plus acontent.changedwebhook so a publish reaches the live site without waiting out the page cache. - Deploy, point the editor at the deployed origin, and build the page in the visual editor.
- Hand it over. The client adds, moves and edits your blocks on the live page. An agent connected over MCP can do the same from a prompt.
- What the client can't do is change the blocks themselves. That stays in your repo.
Prerequisites
| Tool | Version | Where the number comes from |
|---|---|---|
| Node.js | 22.13 or newer, below 23 | engines in examples/next-storefront/package.json |
| pnpm | 11.1.2 (npm also works) | packageManager in the same file |
| Next.js | 16.3.1 | dependency of the example |
| React | 19.2.8 | dependency of the example |
@cmssy/react, @cmssy/next, @cmssy/core, @cmssy/cli |
19.33 or newer (19.36.1 at the time of writing) | example dependencies; current release in cmssy-sdk/packages/*/package.json |
| A Cmssy workspace | the free Hobby plan (1 workspace, 1 seat, 25 pages) is enough to build; inviting the client needs a second seat, so Pro | cmssy.com/pricing |
You also need a cs_ API token from the dashboard (API Tokens) for the link step.
1. Run the example before you write anything
The fastest way to see where you're going is to run the finished blocks against our public demo workspace. No account needed:
git clone https://github.com/cmssy-io/examples
cd examples/next-storefront
pnpm install
cp .env.example .env.local
pnpm dev
next-storefront is a full shop, so it registers more blocks than a landing page needs. The four we use live in blocks/hero, blocks/value-props, blocks/stats-band and blocks/cta-banner. Each folder holds a component, a CSS module and a block.ts.
If you're adding Cmssy to an app you already have, run the CLI in its root instead. It writes the catch-all page, the editor route, the proxy, the block registry and an example hero block, all as plain files you can read:
npx @cmssy/cli@latest init
2. Copy the four blocks
A block is a React component plus a field schema. The schema is built with fields.* helpers and the component is typed from it, so a renamed field is a compile error rather than a section that renders empty.
Here is value-props exactly as it ships in the example. The repeater gives the client a list of up to six items, each with a required title and an optional text:
// blocks/value-props/ValueProps.tsx
import { fields, type BlockProps } from "@cmssy/react";
import styles from "./ValueProps.module.css";
export const valuePropsProps = {
heading: fields.text({ label: "Heading" }),
items: fields.repeater({
label: "Props",
itemLabel: "Prop",
addButtonLabel: "Add prop",
maxItems: 6,
itemSchema: {
title: fields.text({ label: "Title", required: true }),
text: fields.textarea({ label: "Text" }),
},
}),
};
export default function ValueProps({
content,
}: BlockProps<typeof valuePropsProps>) {
const items = (content.items ?? []).filter((item) => item.title);
if (items.length === 0) return null;
return (
<section className={styles.section}>
{content.heading ? (
<h2 className={styles.heading}>{content.heading}</h2>
) : null}
<div className={styles.grid}>
{items.map((item, index) => (
<div key={index} className={`shop-card ${styles.card}`}>
<strong>{item.title}</strong>
{item.text ? <span className="shop-muted">{item.text}</span> : null}
</div>
))}
</div>
</section>
);
}
And its block.ts, which is the whole registration:
// blocks/value-props/block.ts
import { defineBlock } from "@cmssy/react";
import ValueProps, { valuePropsProps } from "./ValueProps";
export const valuePropsBlock = defineBlock({
type: "value-props",
label: "Value props",
component: ValueProps,
props: valuePropsProps,
});
The stats strip is the same shape with a cap of four items, which is how you stop a client turning a strip into a wall:
// blocks/stats-band/StatsBand.tsx (schema part)
export const statsBandProps = {
items: fields.repeater({
label: "Stats",
itemLabel: "Stat",
addButtonLabel: "Add stat",
maxItems: 4,
itemSchema: {
value: fields.text({ label: "Value", required: true }),
label: fields.text({ label: "Label" }),
},
}),
};
hero adds a badge, a highlighted word in the heading, two buttons built from fields.text plus fields.link, and a fields.media slot that renders either an image through next/image or a muted looping video. cta-banner is a heading, a text and the same two buttons. Copy both folders as they are; the full files are in the repo.
Copy two habits from these components. Every block returns null when its required content is missing, and none of them hardcodes fallback copy. A block shows what the CMS holds and nothing else, so an empty field never leaks a default English sentence onto a page in another language.
3. Register them in one array
cmssy/blocks.ts is the single list of blocks your site can render. The server renders from it and the editor reads each block's schema from it:
// cmssy/blocks.ts
import { heroBlock } from "@/blocks/hero/block";
import { valuePropsBlock } from "@/blocks/value-props/block";
import { statsBandBlock } from "@/blocks/stats-band/block";
import { ctaBannerBlock } from "@/blocks/cta-banner/block";
export const blocks = [heroBlock, valuePropsBlock, statsBandBlock, ctaBannerBlock];
This is the line that defines what your client can and can't build. Four entries means four kinds of section. If they ask for a testimonial carousel next month, that is a new block in your repo, not a setting in theirs.
4. Link the app to your workspace
npx @cmssy/cli@latest link --token cs_...
link fetches your org and workspace slugs and the draft secret, writes them to .env.local, checks that the workspace answers and the secret is valid, and, if the workspace has no block manifest yet, pushes one from cmssy/blocks.ts, so the palette knows your four blocks before the first deploy. An existing manifest is kept; replace it with cmssy sync-manifest from the deployed code. It prints the editor deep link at the end.
When you later change a block's fields, cmssy sync-manifest reports what the change does to stored content before it pushes, and stops on removals and lossy changes until you pass --allow-removals or --allow-lossy; Cmssy vs Storyblok walks through a field rename with it.
5. Make a publish reach the site without a deploy
The catch-all page the CLI writes caches each page for up to an hour (export const revalidate = 3600) and pre-renders every published path through generateStaticParams. Fast for visitors, but without one more piece your client publishes and then waits up to an hour.
The missing piece is a route that expires the cache when content changes. cmssy init writes it:
// app/api/revalidate/route.ts
import { createCmssyRevalidateRoute } from "@cmssy/next/server";
export const POST = createCmssyRevalidateRoute({
secret: process.env.CMSSY_WEBHOOK_SECRET,
});
In the admin, go to Settings, then Webhooks, create a webhook for the content.changed event pointing at https://<your-site>/api/revalidate, and put its signing secret in CMSSY_WEBHOOK_SECRET on your host. The route checks the signature and expires the content cache, so the next visitor gets the published version. The webhooks post explains what that signature check does.
6. Deploy and point the editor at it
Deploy the app wherever you host Next.js. Then tell the workspace where it lives:
npx @cmssy/cli@latest link --preview-url https://harbor-yoga.example
That sets the origin the editor frames for everyone in the workspace. While you're still developing, leave the shared URL alone: switch the editor to dev mode and enter http://localhost:3000. That target is per user, and edits made in dev mode go to a draft only you can see.
7. Build the page in the editor
In the admin, create a page with the slug /retreat. Open it in the editor. Because the editor frames your real site, you're looking at your own components, styled by your own CSS.
Add the four blocks from the palette: Hero, Value props, Stats band, CTA banner. Click a block to edit it; the fields you declared appear as form controls, and the repeater items appear with your "Add prop" and "Add stat" labels. Fill in the retreat copy, save, and publish.

Pages that sit under the home page inherit its header and footer layout, so /retreat gets the site's navigation without anyone adding it.
8. Hand it over and watch the owner rearrange it
The handover is why we wrote this. Invite the studio owner to the workspace. Hobby has one seat, so this is where you move to Pro, which has five; the 14-day Pro trial needs no card. If you want to approve their changes first, turn on approval stages; an edit to an approved page sends it back to the first stage.
Now the Tuesday message. The owner opens /retreat in the editor, moves the Stats band above the Value props, changes "Join the retreat" to "Book a place" in the CTA banner, and publishes. The content.changed webhook fires, your route expires the cache, and the live page shows the new order. Nobody opened the repo.
Drafts are separate from published content, and every page keeps a version history, so a bad edit is a rollback, not a restore from backup.

9. Let an agent make the next change
The same page can be edited by Claude or any MCP client. Connect Claude Code to the hosted endpoint:
claude mcp add --transport http cmssy https://api.cmssy.io/mcp
Run /mcp and sign in to Cmssy in the browser. You pick which workspaces the connection can reach and whether it is read-only or read-and-write. For this job it needs write. The full setup, with troubleshooting, is in Connect Claude Code to your CMS.
Then give it the job as a prompt you could hand to a colleague:
In the Harbor Yoga workspace, open the page /retreat.
1. Change the cta-banner heading to "Six places left for spring".
2. Set its primary button text to "Book a place".
3. Show me the block content before and after, then publish the page.
Don't add, remove or reorder blocks.
The agent reads the page with get_page, edits the block with update_block_content, and publishes with publish_page. Reordering, when you do ask for it, goes through update_page_blocks, which sets the page's full block list. Claude Code asks before any tool that isn't on your allowlist; what the server itself enforces is covered in what an agent can run in a store. Every agent action lands in the workspace audit log under your name.
What it can't do (yet)
- Cmssy doesn't host or render the page. Your Next.js app does, on your host and your domain. Cmssy stores the content and the block order and serves them over the API.
- Nobody builds new kinds of blocks in the admin. The client and the agent add, arrange and edit the blocks you registered. A new section type is a new file in your repo.
- Copy and layout are editable; styling is yours. If a block has no colour field, the client can't change its colour. Add a field (
fields.color,fields.selecton the style tab) when you want them to.
Take it further
- The finished blocks: github.com/cmssy-io/examples, folder
next-storefront. - Every field builder, with options: Building blocks.
- Wiring your own app instead of the example: Installation.
- A listing block with a server loader, for when the client wants a blog: The block that renders this blog.