The Sitecore configuration file
Content SDK includes the sitecore.config.ts file, which is the central configuration point for your app, found in the app's root folder.
Apps built using a Content SDK starter template include a lightweight version of the config file containing mandatory parameters only. You can expand the file to add further configuration as needed.
To access any value from the configuration file, you can import it into your code as shown in the following example:
import scConfig from 'sitecore.config'Several of the properties described in this topic have a corresponding environment variable; where they do, that variable is listed here alongside the property's description. If a property is not given an explicit value, it will take the value from the corresponding environment variable where available. If a value is not defined in either place, the property will use a default value instead.
The base configuration
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
Connection credentials required to connect to your SitecoreAI instance. |
n/a | |
|
|
string |
The name of your default site. Behaves differently depending on whether you have the multisite feature enabled:
default: |
|
|
|
string |
optional The default locale for your site, used as a fallback (for functionality such as API requests, site resolution, middleware, and so on) when a language is not otherwise provided. You must ensure this aligns with framework-specific settings (such as Next.js i18n) throughout your application. default: |
|
|
|
string |
optional Editing secret required by SitecoreAI editing and preview functionality. Provide this if you want to use your local or deployed application as an editing host. default: |
|
api properties
Provide exactly one of the following, depending on whether you are connecting to a SaaS instance of SitecoreAI or a local instance running in Docker.
edge properties
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
string |
The unique identifier used to connect to and retrieve data from your SitecoreAI instance. default: |
|
|
|
string |
optional Identifier used to connect to and retrieve data from your SitecoreAI instance in client-side operations. default: |
|
|
|
string |
optional URL of the SitecoreAI endpoint that your Content SDK app will communicate with. default: |
|
local properties
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
string |
Your Sitecore API key used to connect to the GraphQL endpoint. default: |
|
|
|
string |
Sitecore API hostname that your app will connect to and retrieve data from. default: |
|
|
|
string |
optional A GraphQL endpoint path that will be appended to default: |
n/a |
Services configuration
These settings provide additional configuration for various Content SDK services.
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
Extra settings for the layout service. |
n/a | |
|
|
Extra settings for the dictionary service. |
n/a | |
|
|
Retry configuration that affects the layout, dictionary, and |
n/a |
layout properties
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
function |
optional Accepts default: the function returns a string in the following format: RequestResponse |
n/a |
dictionary properties
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
optional Configuration for local memory caching of dictionary service requests. |
n/a |
caching properties
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
boolean |
optional Whether local memory caching is used for the dictionary service. default: |
n/a |
|
|
number |
optional The length of time, in seconds, to keep cached entries in local memory. default: |
n/a |
retries properties
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
number |
optional The maximum number of retries attempted by the GraphQL client if the first one fails. Set this to default: |
n/a |
|
|
|
optional Retry strategy implementation for the GraphQL client, imported from default: |
n/a |
Extra middleware and other configurations
These settings configure functionality that is provided by middleware in Next.js, but might be implemented differently in other framework implementations.
redirects
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
boolean |
optional Whether the redirects feature is enabled globally. default: |
n/a |
|
|
string[] |
optional List of locales that the redirect strategy can work with. The names of these locales must match the framework-specific configuration of your app (for example, default: |
n/a |
SitecoreAI does not support redirect items. You can only create and use redirect maps.
multisite
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
boolean |
optional Whether the multisite feature is enabled for normal site rendering mode. Multisite is always on for preview mode to ensure all data can be previewed. default: |
n/a |
|
|
function |
optional Whether the app accepts a default: |
n/a |
personalize
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
boolean |
optional Whether the personalize feature is enabled. default: |
n/a |
|
|
number |
optional The timeout duration, in seconds, for personalization requests to Experience Edge. default: |
|
|
|
number |
optional The timeout duration, in seconds, for personalization requests to Sitecore CDP. default: |
|
|
|
string |
optional The Sitecore Personalize scope identifier, which allows you to isolate your personalization data between SitecoreAI environments. default: |
|
|
|
string |
optional The CDP channel to use for events. default: |
n/a |
|
|
string |
optional The currency type to use for CDP requests. default: |
n/a |
other properties
|
Property |
Type |
Description |
Corresponding environment variable |
|---|---|---|---|
|
|
boolean |
optional In a Next.js app, whether the If the application is deployed as a SitecoreAI editing host, set this property to default: |
|
|
|
boolean |
optional If your application doesn't use AI component generation or you want to opt out of code extraction, set this property to When set to |
n/a |
|
|
string |
optional The internal editing host url used to render the page in editing scenarios in Next.js apps. This may be required only in non-standard local deployment setups. Available in Content SDK 1.1 and higher. default: For SitecoreAI deployments: For all other cases, it uses the request Host header of the incoming request. |
|