Are you familiar with the concept of Context ID in Sitecore XM Cloud Solutions?
Upon establishing an environment in XM Cloud, two context identifiers are automatically generated:
Live Context ID — It grants access to content that has been approved and published.
Preview Context ID — It enables access to all content, which includes draft versions and content that has not been approved.
It acts as a singular identifier linked to all your configured resources, from content and sites to files, forms, and integration settings. By incorporating the Context ID into your development configuration, XM Cloud takes it from there, managing the rest effectively.
In Sitecore XM Cloud, where can you find these Context IDs?
Step 1 — Login to XM Cloud -> Navigate to Deploy App — Click on Projects
Step 2 — Click on any project listed under the ‘Projects’ section.
To make application setup more efficient, the JavaScript Rendering SDK (JSS) for Next.js has integrated support for Context resources through the XM Cloud add-on. This add-on feature is accessible in JSS version 21.6 and subsequent versions.
Beginning with JSS version 21.6, the SITECORE_EDGE_CONTEXT_ID variable, also known as Context ID, substitutes a multitude of environment variables that were formerly necessary.
Note:
XM Cloud generates and provides the Context ID when you create an environment through the CLI or the Deploy App.