/sitecore-content-sdk-nextjs-app-router:content-sdk-app-router-graphql-data-fetchingfrom Sitecore Content SDK - Next.js App Router
Fetches page, layout, and dictionary data through the Sitecore client in a Next.js App Router app. Covers getPage, getDictionary, getErrorPage, static params, and preview data patterns.
Ships in Sitecore Content SDK - Next.js App Router. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
All Sitecore data fetching goes through the single client in src/lib/sitecore-client.ts. Use getPage, getDictionary, and related methods correctly. This app does not use getComponentData; layout data comes from getPage.
src/lib/sitecore-client.ts only. In the catch-all page: await params, then client.getPage(path ?? [], { site, locale }). For SSG use generateStaticParams and client.getAppRouterStaticParams(siteNames, locales). For preview use draftMode(), then getPreview/getDesignLibraryData with the preview data (see Hard Rules).src/lib/sitecore-client.ts. Do not create a second client or instantiate SitecoreClient elsewhere.await params in the page). Do not rely on global state for site/locale in server code.client.getPage(path ?? [], { site, locale }). Params are a Promise (Next.js 15+); use await params to get { site, locale, path? }.draftMode(); if draft.isEnabled, the plain template calls client.getPreviewData(await headers()) and passes the result to isDesignLibraryPreviewData, client.getDesignLibraryData or client.getPreview; the Cache Components template passes await searchParams to the same calls instead (create-content-sdk-app templates, checked 2026-11-30). Otherwise use getPage with site and locale (Cache Components: getSitecorePage from src/lib/cache/). Never wrap preview reads in 'use cache'.generateStaticParams — use client.getAppRouterStaticParams(siteNames, locales) where site names come from .sitecore/sites.json (e.g. sites.map((s) => s.name)), locales from src/i18n/routing.ts (e.g. routing.locales.slice()). Only call it when process.env.NODE_ENV !== 'development' and scConfig.generateStaticPaths is true. Otherwise the plain template returns []; do not synthesize a fallback param. The Cache Components template must not return [] (Next.js rejects an empty generateStaticParams there) and returns one placeholder { site: BUILD_VALIDATION_SITE, locale, path: [] } from src/lib/sitecore-build-validation.ts; the page and generateMetadata skip Edge for it (isBuildValidationSite).sitecore.config.ts; use environment variables, never hardcode secrets.client.getPage directly in pages or i18n).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sitecore, content-sdk, graphql-data-fetching, app-router, layout-service
npx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-content-sdk-nextjs-app-router17 skills in this plugin
/content-sdk-app-router-atom-createWrites a Content SDK atom (beta.atoms): atom vs component, field schemas and enum tokens, renderer, catalog and registry keys, container slots, lock lifecycle, mock-MMS proof. Use when adding or changing an atom. Not wiring atoms into an app./content-sdk-app-router-atomsContent SDK Atoms (beta.atoms only): catalog, atomsConfig, ComponentRef rendering, lock CI gate, runtime CSS, Content Kit install, null-render traps. Use when wiring atoms or a low-code component renders nothing. Not code components or stable apps./content-sdk-app-router-cache-components-and-osrOther plugins' skills for the same job