Adobe Commerce · updated
What goes in config.json for the Edge Delivery commerce boilerplate?
The storefront reads one JSON file that tells it which Commerce endpoints to call and which headers to send. Under public.default it holds commerce-core-endpoint, commerce-endpoint, a headers object and an analytics object. Extra keys named after a root folder, such as /en-ca/, override the default for one store view. The file is fetched by the browser, so nothing in it is secret.
In plain words
This file is the storefront's address book. It says where the shop's data lives and which shop, language and website to ask for. Get it wrong and pages load but products do not.
Where the file lives
Adobe's page says you find the configuration in your code repository at /config.json, or in the configuration service for your site, and that a config.json in the repository takes precedence over the site's public configuration. The boilerplate ships demo-config.json as a sample to copy, and default-site.json as the template for the configuration service.
The boilerplate's scripts/commerce.js fetches /config.json from the site's own origin and keeps it in the browser's session storage with an expiry two hours ahead.
The keys
| Key | What Adobe says it is |
|---|---|
| commerce-core-endpoint | Core GraphQL endpoint for queries and mutations. Handles all write operations and some reads. |
| commerce-endpoint | Services GraphQL endpoint for read-only operations: Catalog Service, Live Search and Product Recommendations. |
| headers.all.Store | Store view code for core GraphQL requests. |
| headers.cs.Magento-Store-Code | Identifies the store to connect to. |
| headers.cs.Magento-Store-View-Code | Identifies the store view for Catalog Service requests. |
| headers.cs.Magento-Website-Code | Identifies the website to connect to. |
| headers.cs.x-api-key | The API key for the SaaS services: Catalog Service, Live Search and Product Recommendations. |
| headers.cs.Magento-Environment-Id | Connects the storefront to the cloud instance serving it. |
| analytics | Store, store view and website names and IDs, the base currency code and the environment. Two optional keys enable forwarding to Adobe Experience Platform when both are present. |
| plugins.picker.rootCategory | The root category ID for the product picker. |
| commerce-assets-enabled, commerce-b2b-enabled, commerce-companies-enabled | Switches for AEM Assets in the storefront, B2B logic and company features. Company features need the B2B switch set to true. |
How the code uses them
- The core client uses commerce-core-endpoint and falls back to commerce-endpoint when the first is missing. It sends the headers under headers.all.
- The Catalog Service client uses commerce-endpoint and sends headers.all plus headers.cs.
- The boilerplate adds a short cache-busting parameter, cb, to Catalog Service requests, worked out from the cs headers.
Differences by platform
| Platform | What changes |
|---|---|
| Adobe Commerce PaaS | Standard Adobe Commerce header names, and API keys are required for the SaaS services. |
| Adobe Commerce as a Cloud Service | Standard header names, but no API key or environment ID in the default configuration. You only need to set commerce-endpoint: the same endpoint is used for catalogue and core. |
| Adobe Commerce Optimizer | Different header names under cs, such as AC-View-ID (required) and AC-Price-Book-ID (optional), instead of the Magento-* store headers. |
More than one store view
Each key under public other than default must match the root folder path of a store view, for example /en-ca/. Adobe says each such configuration merges with the default at runtime. An empty object inherits everything. The drop-in tools code picks the key with the most path segments that matches the page's address.
The public part of the template (default-site.json in Adobe's boilerplate), with its placeholders. Shortened: the analytics and plugins objects are left out
{
"public": {
"default": {
"commerce-core-endpoint": "{ENDPOINT}",
"commerce-endpoint": "{CS_ENDPOINT}",
"headers": {
"all": { "Store": "default" },
"cs": {
"Magento-Store-Code": "{STORE_CODE}",
"Magento-Store-View-Code": "{STORE_VIEW_CODE}",
"Magento-Website-Code": "{WEBSITE_CODE}",
"x-api-key": "{COMMERCE_API_KEY}",
"Magento-Environment-Id": "{COMMERCE_ENVIRONMENT_ID}"
}
}
}
}
}A store view override, holding only what differs from default (our example, in the shape Adobe's multistore page shows)
"/en-ca/": {
"headers": {
"all": { "Store": "en_ca" },
"cs": { "Magento-Store-View-Code": "en_ca" }
}
}What to check when products do not load
- Open /config.json on your site in a browser. If it is missing, the storefront has nothing to connect to.
- Check that commerce-endpoint is the services endpoint and commerce-core-endpoint the core one. On Adobe Commerce as a Cloud Service they are the same address.
- Compare the three Magento-* codes with the store, store view and website codes in the Commerce Admin. Adobe's multistore page says they must match.
- On PaaS, check that x-api-key and Magento-Environment-Id are present under headers.cs.
- Remember the two-hour copy in session storage: open a new browser session after changing the file.
Related tools and pages on this site
- Adobe Commerce GraphQL query builder (free, runs in your browser)
- Edge Delivery developer tools (redirects sheet, sitemap and metadata files)
Questions
Is the API key in config.json a secret?
It is sent to every visitor's browser, because the browser fetches /config.json. Treat everything in the file as public and never put a private or integration key in it.
Do I need both endpoint keys?
On Adobe Commerce as a Cloud Service Adobe says you only need commerce-endpoint. The boilerplate code falls back to it when commerce-core-endpoint is not set.
Which wins, the repository file or the configuration service?
The repository file. Adobe says a config.json on the production branch takes precedence, so changes in the configuration service will not replace it.
Does the query builder on this site write this file?
No. It writes GraphQL queries and the request around them. The file format is shown above as Adobe publishes it.
Sources
- Adobe: Storefront configuration (config.json keys) (checked 13 Nov 2026)
- Adobe: Multistore setup for the storefront (checked 13 Nov 2026)
- Adobe on GitHub: aem-boilerplate-commerce, default-site.json (the configuration template) (checked 13 Nov 2026)
- Adobe on GitHub: aem-boilerplate-commerce, scripts/commerce.js (config loading, product links) (checked 13 Nov 2026)
- Adobe on GitHub: hlxsites/aem-boilerplate-commerce (README and package.json) (checked 13 Nov 2026)
- Adobe: Commerce boilerplate (folders and files) (checked 13 Nov 2026)
Facts about Adobe's products on this page are from the linked Adobe pages, read on the date shown beside each. Explanations, steps and examples are ours unless marked as Adobe's. If Adobe's page and this one differ, Adobe's page is right.
Surge Migrate is not affiliated with Adobe and claims no Adobe partner status. Adobe product names are trademarks of Adobe.