Environments Are Not Features
Environments should be treated as boundaries, not features. Implement a proxy to manage requests and use a backend to determine the environment. This approach provides a stable and secure way to manage multiple environments. To avoid confusion, reload the page when switching environments. Centralize identity or copy it incrementally, but avoid shared identity databases.