Next.js for SitecoreAI environment variables
Starting from JSS version 21.6, the SITECORE_EDGE_CONTEXT_ID variable (Context ID) replaces many environment variables that were previously required. However, you must continue to use certain variables when developing locally in a full-stack scenario (since Context ID does not apply). The following sections contain the variables used in each environment type.
The following are the supported variables for Next.js for SitecoreAI:
|
Variable name |
Description |
Usage |
|---|---|---|
|
|
The Context ID, which covers many system configurations required for connecting to the SitecoreAI back end. This is a SitecoreAI system environment variable. When the application runs on the SitecoreAI rendering host, this value is always set to the preview Context ID. |
Environments connected to SitecoreAI, local front-end development |
|
|
The API key for |
Local full-stack development with a local Docker Sitecore environment |
|
|
The API hostname, needed to build the application. When the application runs on the SitecoreAI rendering host, this value is always set to your content management instance, and it will override any value set in your |
Local full-stack development with a local Docker Sitecore environment |
|
|
The GraphQL endpoint. For Experience Edge, the value is |
Local full-stack development with a local Docker Sitecore environment |
|
|
Important This environment variable is only needed if you're using the older, chromes-based editing mode for Pages. If you're using the newer, metadata-based editing mode, you can omit this variable. The public URL for absolute URLs required for static assets when the Next.js app runs in an editing environment. This is a SitecoreAI system environment variable. When the application runs on the SitecoreAI rendering host, this value is always set to your rendering host instance, and it will override any value set in your | |
|
|
A secret token that protects the Sitecore editor endpoint ( | |
|
|
The name of your site. This variable overrides the | |
|
|
The default language of your app. | |
|
|
The number of times the GraphQL Layout, Dictionary, and ErrorPages services retry to fetch when the endpoint rate limit is reached. See how to enable retries for requests to the SitecoreAI Experience Edge GraphQL endpoint. Default: 3 | |
|
|
Determines how layout and dictionary data is fetched from Sitecore. The possible values are | |
|
|
Indicates whether, during static site generation (SSG), | |
|
|
Sitecore JSS NPM packages utilize the debug module for logging. You can use the debug mode flexibly. |