The Future is Now: Sitecore Content SDK 1.2 brings App Router into XM Cloud
For years, I’ve been navigating the ever-evolving landscape of Sitecore, and I’ve seen my fair share of game-changing updates. But let me tell you, the recent release of Sitecore Content SDK v1.2 feels different. This isn’t just another incremental update; it’s a fundamental shift in how we build for XM Cloud, and it’s bringing the power of the Next.js App Router to the forefront of Sitecore development. I’ve had the chance to dive deep into this release, and I’m thrilled to share my findings with you.
The Writing on the Wall: JSS, Content SDK, and the XM Cloud Trajectory
Here’s the key takeaway:
JSS SDK 22.X will reach its end-of-life (EOL) in June 2026.
Why the Content SDK is a Game-Changer
|
Feature
|
JSS SDK
|
Content SDK
|
|
Supported Products
|
Sitecore XM/XP and XM Cloud
|
Exclusively for XM Cloud
|
|
Visual Editing
|
Experience Editor & XM Cloud Pages
|
XM Cloud Pages Builder only
|
|
Complexity & Size
|
Larger, more complex starter apps
|
Significantly smaller and simpler
|
|
Component Mapping
|
Automatic
|
Manual registration by default
|
|
Configuration
|
Scattered across multiple files
|
Centralized in
sitecore.config.ts and sitecore.cli.config.ts |
|
Data Fetching
|
Various data fetching plugins
|
Unified
SitecoreClient class |
|
Middleware
|
Separate middleware plugin files
|
Simplified with
defineMiddleware in middleware.ts |
Farewell, Experience Editor
Enter the App Router: A New Era for Next.js in XM Cloud
The New App Router Structure
pages directory, replaced by a more intuitive app directory:src/ ├── app/ │ ├── [site]/ │ │ ├── [locale]/ │ │ │ └── [[...path]]/ │ │ │ └── page.tsx │ │ └── layout.tsx │ ├── api/ │ ├── layout.tsx │ ├── not-found.tsx │ └── global-error.tsx ├── components/ ├── lib/ └── middleware.ts
Data Fetching in Server Components
With the App Router, Server Components are the default. This means you can fetch data directly within your components without getServerSideProps or getStaticProps.
Here’s a look at the new page.tsx:
// src/app/[site]/[locale]/[[...path]]/page.tsx
import { notFound } from 'next/navigation';
import { draftMode } from 'next/headers';
import client from 'src/lib/sitecore-client';
import Layout from 'src/Layout';
export default async function Page({ params, searchParams }: PageProps) {
const { site, locale, path } = await params;
const draft = await draftMode();
let page;
if (draft.isEnabled) {
const editingParams = await searchParams;
// ... handle preview and design library data
} else {
page = await client.getPage(path ?? [], { site, locale });
}
if (!page) {
notFound();
}
return <Layout page={page} />;
}
async/await directly in our component, and Next.js handles the rest. This is a huge win for developer experience.A New Approach to Layouts
// src/app/[site]/layout.tsx
import { draftMode } from 'next/headers';
import Bootstrap from 'src/Bootstrap';
export default async function SiteLayout({
children,
params,
}: {
children: React.ReactNode;
params: Promise<{ site: string }>;
}) {
const { site } = await params;
const { isEnabled } = await draftMode();
return (
<>
<Bootstrap siteName={site} isPreviewMode={isEnabled} />
{children}
</>
);
}
This SiteLayout component wraps all pages within a given site, providing a consistent structure and allowing for site-specific logic.
Migrating from JSS to the Content SDK: A Checklist
- Update Dependencies: Replace your
jss-nextjscode> packages with the new@sitecore-content-sdk/nextjspackages. - Centralize Configuration: Create
sitecore.config.tsandsitecore.cli.config.tsto consolidate your settings. - Refactor Data Fetching: Replace your data fetching logic with the new
SitecoreClient class. - Update Middleware: Consolidate your middleware into a single
middleware.tsfile using thedefineMiddleware utility. - Register Components: Manually register your components in the
.sitecore/component-map.tsfile. - Update CLI Commands: Replace your
jssCLI scripts with the newsitecore-toolscommands. - Remove Experience Editor Code: Clean up any code related to the Experience Editor, as it’s no longer supported.
The Rise of AI in Sitecore Development
Another fascinating aspect of the Content SDK is its deep integration with AI-assisted development. The repository now includes guidance files for Claude, GitHub Copilot, and other AI tools. This is more than just a novelty; it’s a serious productivity booster. These guidance files instruct your AI assistant on Sitecore-specific conventions, ensuring that the code it generates adheres to best practices.
- Use the correct naming conventions.
- Create the necessary props interface.
- Use the Sitecore field components (
<Text>,<RichText>, etc.). - Handle missing fields gracefully.





