Monday, 2 February 2026

The Hidden Cost of Scoped Context IDs in Sitecore XMC

When working with Sitecore XM Cloud (SitecoreAI), Next.js, and the Sitecore Content SDK, scoped Context IDs are strongly recommended — especially for values exposed to the browser.

I followed the official Sitecore documentation, created a scoped Context ID, wired it into my Next.js app… and still ended up with a runtime error that wasn’t obvious at all.

This post documents what went wrong, why the error message is misleading, and what you actually need to scope correctly.