Skip to content

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 staging before publishing to main
  • Let developers experiment in development without 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.

Terminal window
curl -H "X-Alokai CMS-Space: default" \
-H "X-Alokai CMS-Environment: staging" \
-H "Authorization: Bearer <key>" \
https://your-worker.workers.dev/api/pages

Delivery 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