/sitecore-content-sdk-nextjs-pages-router:content-sdk-pages-router-graphql-data-fetchingfrom Sitecore Content SDK - Next.js Pages Router
Fetches page, dictionary, and component data via GraphQL in a Sitecore Content SDK Pages Router app. Covers getPage, getDictionary, getComponentData, getPagePaths for SSG, and preview flows.
Ships in Sitecore Content SDK - Next.js Pages 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 getComponentData in the catch-all page. Path from extractPath(context); locale from context.locale.
src/lib/sitecore-client.ts only. In [[...path]].tsx: use extractPath(context) and context.locale; call getPage(path, { locale: context.locale }), then getDictionary and getComponentData(page.layout, context, components). For SSG use getPagePaths in getStaticPaths. For preview use context.preview and getPreview/getDesignLibraryData(context.previewData).src/lib/sitecore-client.ts. Do not create a second client or instantiate SitecoreClient elsewhere.extractPath(context) (from @sitecore-content-sdk/nextjs/utils) to get the path array; use context.locale for locale. Do not assume path or locale from elsewhere.client.getPage(path, { locale: context.locale }), then client.getDictionary({ site: page.siteName, locale: page.locale }) and client.getComponentData(page.layout, context, components) for component props. Pass the result to the layout renderer.client.getPagePaths(siteNames, context?.locales || []) where site names come from .sitecore/sites.json (e.g. sites.map((s) => s.name)). Use revalidate in getStaticProps for ISR. SSR uses getServerSideProps only, with no getStaticPaths.context.preview and context.previewData; when in preview, use client.getPreview(context.previewData) or client.getDesignLibraryData(context.previewData).sitecore.config.ts; use environment variables, never hardcode secrets.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sitecore, content-sdk, pages-router, graphql-data-fetching, ssg, isr
npx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-content-sdk-nextjs-pages-router11 skills in this plugin
/content-sdk-pages-router-component-data-strategyComponent data in a Content SDK Pages Router app: getComponentData after getPage resolves component props for the layout. Use when wiring component data or BYOC in a Pages Router app. Not App Router./content-sdk-pages-router-component-registrationRegisters components in the generated .sitecore/component-map.ts of a Content SDK Pages Router app (regenerate, never hand-edit). Use when adding a component or layout or the editor cannot find one. Not App Router./content-sdk-pages-router-component-scaffoldOther plugins' skills for the same job