Understand commercetools Frontend environments

Ask about this Page
Copy for LLM
View as Markdown

Environments overview

Environments are tied to three different stages of the development lifecycle: development, testing, and publishing to customers. They help with isolating the features ready for your customers from the ones you're developing or testing. Frontend components (and other features) can only be used in the environments for which they've been activated. For more information, see Working with environments in the Studio.
Projects are separate from Frontend Studio environments. A Project is the isolated data container for your commerce data, API Clients, and Project settings. Your environment setup can map to one or more Projects, depending on how much isolation you need for data, integrations, permissions, and testing.

Suggested Project setup

Projects do not require a single Project topology. A common starting point is to keep production data in a dedicated Project and use one or more non-production Projects for development and testing. Teams often add separate development, testing, or staging Projects when they need stricter isolation for integrations, test data, or access control.

When planning your setup, consider the following guidelines:

  • Keep production and non-production data separate.
  • Add more Projects only when you need stronger isolation for teams, integrations, or test activities.
  • Use a naming convention for Project keys so that environment purpose is easy to identify.
For more information about Project structure and naming, see Projects and Organizations, Teams, and Projects.

Suggested development workflow

While you can adopt your own workflow, we recommend following the guidance in the Work with environments as a developer section.
Keep your CI/CD flow aligned with that separation. Promote the same codebase through development, staging, and production, while keeping environment-specific credentials and Project settings separate. For the Frontend deployment flow, see Deploy commercetools Frontend.

Test data and automated tests

Run automated tests against a non-production Project.

For performance tests, supporting test data, and cleanup obligations, follow the guidance in Load testing. In particular, keep test and production data separate, prepare reusable test data in advance, and avoid generating large volumes of disposable data during each run.

For Carts in particular, avoid creating a Cart or anonymous session before it is needed. For example, create the Cart when a shopper adds a Product instead of on the first page view. This reduces the number of unused Carts that later need cleanup.

If your workflow creates many Carts, review Automatic cleanup, the Carts configuration, and Set DeleteDaysAfterLastModification. To remove sample data from tutorial Projects, see Delete sample data.