SitecoreAI Lessons from Production

Technical Director
  • Twitter
  • LinkedIn

A SitecoreAI implementation involves several systems working together: the authoring environment, an editing application, the public website, Experience Edge and the deployment tooling around them. Each has a reasonable set of defaults. The practical work is making those defaults fit the way the team builds, releases and supports the site.

Across recent projects, a few decisions have become recurring preferences for me. They concern where editing runs, how people and automation access protected deployments, what triggers a deployment, which layer owns public URLs and media addresses, and what configuration reaches the browser. Other lessons have come from upgrading the Content SDK and helping authors understand when their changes become public.

The examples below focus on Next.js applications hosted on Vercel. These are the defaults I would bring to another project, with the important conditions that make them work.

Editing hosts and public delivery

The editing host is the frontend application Sitecore uses to display pages inside the visual editing experience. The public delivery application serves visitors using published content. They commonly share a codebase, but their content sources, audience and configuration differ. Sitecore hosting terminology

For a Next.js site running on Vercel, I prefer to host the dedicated editing application on Vercel too, using Sitecore's external editing-host configuration. That gives the team control over its build, runtime configuration, logs and release process through the same hosting platform used for public delivery. External editing-host configuration

One topology I have used is two Vercel projects, each with a custom environment named edit:

Vercel projectDeployment environmentSitecore content context
Lower-environment projectProductionLower environment's Live context for viewing published content.
Lower-environment projecteditLower environment's Preview context for authoring.
Production projectProductionProduction environment's Live context for the public website.
Production projecteditProduction environment's Preview context for authoring.

Here, Production is a Vercel environment name within a project. A lower-environment project can use that deployment target while still reading lower-environment content. Making that distinction explicit helps avoid configuration mistakes.

I use a stable domain for each editing deployment, keep its variables separate from public delivery, and release compatible frontend code to both roles. Ordinary feature-branch deployments can continue to use Vercel Preview. Custom environments provide a place for a longer-lived editing deployment with its own variables and domain. Vercel environments

Deployment protection for people and automation

Deployment protection controls who can reach a hosted application before its own page logic runs. That matters for lower environments and editing hosts, where a working deployment may contain content that should not be publicly accessible. Keeping these hosts out of search indexes is useful, but noindex does not restrict access.

I treat access as a set of journeys to verify. A developer opening the homepage while signed into Vercel has proved only one of them:

Visitor or integrationWhat I verify
Content authorSitecore can load the editing application, its scripts and assets inside the editor.
Internal testerThe intended office or VPN access works without relying on an existing administrator session.
External reviewerThe approved sharing mechanism works off the VPN, including navigation and subsequent asset requests.
Automated toolThe crawler, test runner or security scanner reaches the application using its authorized access mechanism.
Unauthenticated visitorAccess is denied where protection is required.

On one project, I tested access both on and off the VPN, then checked that a reviewer's sharing cookie continued to work for JavaScript files, navigation and the sitemap. Checking only the initial shared link would have missed much of the actual review experience.

For tools that support custom request headers, Vercel provides Protection Bypass for Automation using x-vercel-protection-bypass. Store that secret in the tool's protected configuration. Deployment protection and firewall rules are separate controls; diagnose which one rejected a request rather than assuming one bypass resolves every restriction. Vercel automation access

Before trusting a scan, inspect the response body and headers to confirm the scanner reached the website. A successful HTTP response could contain an access screen or an application fallback rather than the requested resource. That needs investigation before treating the result as either a confirmed finding or a false positive.

Deployment pipelines and CLI version alignment

SitecoreAI can deploy changes through the Deploy app, its API or the Sitecore CLI. A connected repository can trigger deployments automatically; an existing CI/CD pipeline can instead decide when to invoke the deployment operation. Sitecore deployment options

On projects with an established pipeline, my preference is to trigger Sitecore deployments through the CLI from that pipeline. I use the Deploy app for the environment-management tasks it supports, while keeping release triggers in the team's chosen CI/CD process.

That makes it easier to tie a deployment to a specific commit, run the required checks, apply the team's approval process and retain the output in one release history. It also lets the team distinguish changes that require a Sitecore authoring deployment from changes that only require a frontend deployment. I want the pipeline to make that decision explicitly, with a clear record of what it released.

There is a small tooling detail that can otherwise interrupt this approach: the CLI and its plugins have separate version configuration. The local tool manifest, typically .config/dotnet-tools.json, controls what dotnet tool restore installs. Changing plugin versions in sitecore.json does not upgrade the CLI itself.

I encountered a pipeline failure where upgraded plugins were rejected by an older CLI. The resulting missing cloud command looked like a deployment problem, but the tooling had failed before cloud authentication could begin.

These diagnostics are worth keeping near the start of the job:

dotnet tool restore
dotnet sitecore --version
dotnet sitecore plugin list

Keep the tool manifest and plugin configuration aligned, and commit both when an upgrade requires it. Sitecore CLI upgrade guidance

Lowercase page URLs and case-sensitive media

A public page can acquire several URL spellings through old links, manually entered addresses and generated navigation. A consistent canonical path makes redirects, sitemaps and link generation easier to reason about.

My default is lowercase public page paths. I want the CMS-generated links, frontend navigation, canonical metadata and sitemap to agree on that spelling. Requests using another page-path casing should resolve through a deliberate normalization policy.

The word path matters here. I would not lowercase an entire URL indiscriminately. Query-string values and fragment identifiers may carry meaningful casing. For example, a page normalization rule can change /Services/Our-Team?campaign=SpringLaunch to /services/our-team?campaign=SpringLaunch while preserving the campaign value. URI case-normalization rules

Media is a separate concern. Experience Edge media URLs are case-sensitive. A media item stored beneath a mixed-case path needs a URL that resolves to that path; lowercasing the string in frontend code can break it. Experience Edge media restrictions

If lowercase media paths are a migration requirement, establish and verify that convention in the target media structure and publishing behavior. Check actual published image and PDF URLs, including old links embedded in rich text. A page-URL policy should not accidentally rewrite API routes, static assets or media URLs that have different requirements.

Custom media domains and SDK extension points

A custom Experience Edge hostname lets the site use an address such as media.example.com for media delivery. Sitecore associates the hostname with context or site configuration to route requests. Configuring that hostname and making the frontend emit the corresponding URLs are two separate parts of the implementation. Sitecore custom hostname routing

The Content SDK exposes a public rewriteMediaUrls setting. With true, it uses the custom hostname configured in SITECORE_EXPERIENCE_EDGE_HOSTNAME; it also accepts a function that transforms a URL string. Start with the documented option, then use the function when the required mapping needs additional logic. Content SDK media URL configuration

For example, the delivery deployment can define a hostname without a protocol or path:

SITECORE_EXPERIENCE_EDGE_HOSTNAME=media.example.com

That variable must be paired with the SDK's rewriting configuration. Merely adding it to the deployment is not a substitute for checking the generated URLs.

In my implementation, the mapping needed to account for the media URL's path structure as well as its hostname. A simple host replacement would not have produced the required address. Using the SDK's public transformation function gave that logic a clear home without patching SDK internals or modifying installed packages.

I enable this published-media mapping on delivery deployments and leave it out of editing and preview. In that setup, the presence of the environment variable is a deployment choice; it does not automatically detect whether an individual request is an editing request.

Verify images, PDFs, rich-text links and downloads in both delivery and editing. Preserve path casing and image-transformation query parameters. A branded hostname is only useful when the generated address still retrieves the intended resource.

Redirects at the hosting layer

A redirect tells the browser that the requested resource has moved. On a migrated site, the redirect list often represents years of external links, campaign URLs and bookmarked documents, so it deserves the same care as application code.

When Vercel hosts the public site, I prefer Vercel to handle straightforward redirects. That gives these rules a clear place in the request path and keeps simple URL changes out of custom page-rendering logic. Vercel's bulk redirects support both deployment-time files and managed runtime updates; choose the approach that fits who owns the changes. Vercel bulk redirects

The quality of the input matters as much as the mechanism. I review redirect data for:

IssueWhy it matters
Duplicate sourcesOne incoming URL should not have conflicting destinations.
Self-redirects and loopsA request must eventually reach a resource instead of redirecting repeatedly.
Unnecessary chainsOld URLs should reach the intended final destination with as few hops as practical.
Query-string and casing assumptionsRules must match the selected redirect mechanism's actual behavior.
Old media URLsLinked PDFs and images need coverage alongside ordinary pages.

The redirect mechanism also needs to suit the rule. Bulk redirects are intended for simple mappings; rules requiring wildcard, header or query-dependent logic may need another routing mechanism. Vercel's bulk source matching ignores query strings, so copying a URL containing query parameters into a source field does not create a query-specific rule.

I also give each rule one clear owner. If the same old path is handled by a legacy proxy, the hosting platform and application code, an otherwise simple redirect becomes difficult to diagnose. Verify the final HTTP response and destination, including whether query parameters should be preserved.

Reverse proxies in front of Vercel

A reverse proxy receives a public request and forwards it to the hosting platform behind it. Products such as Azure Front Door can have a legitimate role in an enterprise architecture, but they also become another place where routing, caching, headers and access rules can affect the website.

For a site already hosted on Vercel, my starting preference is to let Vercel receive the public traffic directly. Before adding another proxy, I want a specific requirement that the additional layer will satisfy, along with clear ownership of its configuration.

Vercel itself advises against placing a reverse proxy in front of a project because it can reduce traffic visibility and affect firewall behavior. Its documentation also describes supported proxy configurations, including Azure Front Door. Vercel reverse-proxy guidance

Where another proxy is required, verify the complete path: TLS connections, the original client IP, cache behavior, redirect ownership and origin access. A page loading successfully does not establish that the security and operational features behind the proxy are seeing the information they expect.

Context IDs in browser-visible configuration

A Sitecore Context ID grants access to a set of platform resources. Its permissions matter wherever it is used. Sitecore recommends scoped Context IDs and specifically calls for public scoped IDs for client-side requests. Sitecore Context IDs

In Next.js, NEXT_PUBLIC_ is a declaration that a value may be bundled into browser JavaScript. It is not a convenient naming convention for a secret. Referenced public variables are inlined during the build, so changing the deployment's environment values afterward does not rewrite an already-built client bundle. Next.js environment variables

I configure the server and browser IDs separately:

SITECORE_EDGE_CONTEXT_ID=<server-scoped-live-context-id>
NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID=<public-scoped-live-context-id>

The server ID should have the resources needed for server operations. The browser ID should expose only the resources required by the client-side features in that deployment. Keep master IDs and broader server credentials out of public configuration, rendered HTML and resource URLs.

Be precise about the required resources too. Content SDK 2.5 guidance requires the client Context ID used by getHeadLinks() to include at least the Files resource for Sitecore stylesheet links. Forms, analytics and personalization may have additional requirements. A scoped ID still needs enough access for the features the application actually uses. Content SDK client Context ID requirement

Check the configured ID's permissions and the values exposed by the deployed application. Copying an environment-variable set from another project is a starting point for review, not evidence that its site, environment and permission scope are correct.

Content SDK upgrades and starter application changes

An SDK upgrade can involve changes in both the installed packages and the application code that integrates them. Updating dependencies does not automatically apply changes made to the starter application's layouts, head rendering, routing or configuration.

My preferred upgrade process makes two comparisons:

  1. Compare the old starter application with the starter for the target SDK version to identify integration changes.
  2. Compare those changes with the real application and adapt them around its custom behavior.

On a recent upgrade, that included reviewing the page-head implementation and the proxy's static-asset matching. The application's own metadata and routing needed to be preserved while adopting the relevant starter changes.

I record which changes were applied, adapted or intentionally omitted. That gives the next upgrade a useful baseline and makes the review more concrete than checking whether the package version changed. Afterward, verify public delivery and editing, including the styles and resources that depend on the client Context ID.

Workflow approval and publishing

Workflow approval records that content has passed the required review. Publishing makes an eligible version available through the published delivery path. The relationship between those operations depends on the workflow configuration; reaching an approved state does not by itself guarantee that a page is live. Sitecore workflow guidance

When authors need to approve content now and release it later, I prefer to keep that distinction visible. A simple approval workflow followed by an explicit Publish action may be sufficient. If the business wants an immediate approve-and-publish path, configure it deliberately and make the action clear to reviewers.

Check referenced data sources and media as part of that authoring journey. A page's status alone may not explain why an author sees one result in editing and another on the public site. Include the delivery and cache-refresh steps when documenting what users should expect after publishing.

These choices make the implementation easier to operate because each has an identifiable owner: the hosting platform runs the frontend, the pipeline controls releases, the URL policy governs page addresses, and scoped credentials define resource access. That clarity is useful long after the initial launch, when another developer or content author needs to understand why the site behaves as it does.