Environments
An Environment represents a deployment stage within a space — typically main (production), staging, and development. Each environment has its own completely independent copy of content, locales, webhooks, and preview URLs.
Default environment
Every space starts with a single main environment. This is the environment your production storefront should point to.
Creating environments
Go to Settings → Environments and click New Environment. You can create as many environments as you need.
Why use multiple environments?
- Test content changes in
stagingbefore publishing tomain - Let developers experiment in
developmentwithout touching production content - Run A/B tests by pointing different storefront instances at different environments
Environment context in API requests
All API requests carry an environment via the X-Alokai CMS-Environment header. If omitted, the request falls back to the space’s default environment.
curl -H "X-Alokai CMS-Space: default" \ -H "X-Alokai CMS-Environment: staging" \ -H "Authorization: Bearer <key>" \ https://your-worker.workers.dev/api/pagesDelivery API
The delivery API (used by the storefront) accepts ?environment=<id> as a query parameter:
GET /api/v1/pages/by-path/about?environment=staging&locale=en-US