/sitecore-content-sdk:content-sdk-site-setup-and-envfrom Sitecore Content SDK - Core
Configures site and environment for a Content SDK app: sitecore.config.ts, environment variables, default site/language, personalize and analytics settings. Use when setting up the app or env vars.
Ships in Sitecore Content SDK - Core. 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.
Central config in sitecore.config.ts; all secrets and environment-specific values via env vars. The config file and the env-var conventions below are identical in App Router and Pages Router. Only locale/i18n wiring is router-specific, and that belongs to the dictionary-and-i18n skill (pointer in Hard Rules).
sitecore.config.ts with defineConfig; read all secrets and env-specific values from process.env.*. Add or change vars in .env.example (or .env.remote.example / .env.container.example) with placeholders; never commit .env or .env.local.Use sitecore.config.ts with defineConfig from the SDK. Expose api (edge, local), defaultSite, defaultLanguage, editingSecret, multisite, redirects, personalize as needed.
All sensitive or environment-specific values must come from environment variables (e.g. process.env.SITECORE_API_KEY). Never hardcode API keys, secrets, or production URLs in source.
Document every new or changed env var in .env.example (or .env.remote.example / .env.container.example). Use placeholder or empty value and a short comment; never put real secrets in example files.
Never commit .env or .env.local; they are gitignored. Example files are the source of truth for which vars exist.
defaultLanguage resolves config → NEXT_PUBLIC_DEFAULT_LANGUAGE → en.
Locale/i18n wiring is router-specific and out of scope here: App Router uses next-intl (src/i18n/routing.ts + request.ts) and [site]/[locale] route segments; Pages Router uses the i18n block (locales, defaultLocale) in next.config.js with per-request context.locale. For that, use content-sdk-app-router-dictionary-and-i18n or content-sdk-pages-router-dictionary-and-i18n (and the matching route-configuration skill).
App Router with Cache Components: keep the SDK in-process dictionary cache disabled (dictionary: { caching: { enabled: false } }), because it outlives the cache tags (content-sdk-app-router-cache-components-and-osr). SITECORE_REVALIDATE_SECRET is documented in the .env.*.example files.
Verified against @sitecore-content-sdk/content 2.3.0 dist/cjs/config/define-config.js (defaults, lines 46-59; deepMerge skips undefined/'', lines 99-121; NaN fallback, lines 133-138), @sitecore-content-sdk/nextjs 2.4.0 dist/cjs/config/define-config.js:15 (the Next.js pre-fill), @sitecore-content-sdk/nextjs 2.4.0 dist/cjs/proxy/bot-tracking-proxy.js:128, and the [email protected] App Router template.
| Var / key | Effect |
|---|---|
personalize.enabled (no env var) | Defaults to NODE_ENV !== 'development', so on in every production build. Each request the proxy does not skip pays one Edge lookup (up to edgeTimeout), even on a site with no personalization. Set enabled: false when the site does not personalize |
SITECORE_PERSONALIZE_SCOPE → CSDK_PUBLIC_PERSONALIZE_SCOPE → NEXT_PUBLIC_PERSONALIZE_SCOPE | personalize.scope. The base chain takes the first non-empty, but on Next.js the nextjs defineConfig pre-fills scope from NEXT_PUBLIC_PERSONALIZE_SCOPE, so a non-empty NEXT_PUBLIC_ value wins over SITECORE_. Set one name, not two that disagree. Must equal the CM environment's PAGES_PERSONALIZE_SCOPE. The template's .env.remote.example lists only NEXT_PUBLIC_, which CdpPageView also needs in the browser |
PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT / PERSONALIZE_MIDDLEWARE_CDP_TIMEOUT | personalize.edgeTimeout / cdpTimeout in ms, default 400 each |
NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID | api.edge.clientContextId: the browser context id Bootstrap and <Form> use. Its presence enables browser tracking: the template's Bootstrap.tsx calls initContentSdk only when it is set (and never in development or preview) |
NEXT_PUBLIC_SITECORE_EDGE_PLATFORM_HOSTNAME | api.edge.edgeUrl; empty = https://edge-platform.sitecorecloud.io |
SITECORE_ENABLE_BOT_TRACKING=true | Turns BotTrackingProxy on in development / localhost, where it is off by default |
sitecore.config.ts.example sets edgeTimeout and cdpTimeout from PERSONALIZE_PROXY_EDGE_TIMEOUT, a name define-config does not read. If you copy it, one var drives both timeouts, and when it is unset parseInt yields NaN, which resolveConfig silently replaces with the PERSONALIZE_MIDDLEWARE_* / 400 default. No error either way. Use the PERSONALIZE_MIDDLEWARE_* names, or omit the keys.defineConfig has no analytics or events keys; those are plugin options (content-sdk-analytics-events).sitecoreai-auth § 0b).content-sdk-personalization (proxy, scope, variants), content-sdk-analytics-events (Bootstrap, events), content-sdk-tracking-consent (gating all of it on consent).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-content-sdk23 skills in this plugin
/content-sdk-analytics-eventsSends Content SDK analytics events: analytics and events plugins, pageView, event, form, identity, field limits, client vs server, bot and editing suppression. Use when adding or debugging tracking calls. Not consent or personalization./content-sdk-atomic-design-assessmentAssesses a Content SDK head app for Atomic Design: scan src/components, rate each low-code candidate / partial / keep-code, derive the atom set, plan a side-by-side migration. Use when asked which components could become atoms. Not writing atoms./content-sdk-Other plugins' skills for the same job