Hah, quite similar to what we did at FMG. We follow 12factor app principles, those config are retrieved from env flags. We have some layers for generating the env vars, from ansible vars files (which is also in source control) and from the CI server for credentials. Each environment (dev, stg, prod) has its own Ansible file, where you can define which feature you want to turn on and monitor via source control. We store those config in source control but not in js/ts code. Your code tight to only those 3 env. Putting it in Ansible allows us to decouple the env with the logic code. It also helps us spin up a new environment easily, test env for example, or maybe multiple stg environments if you have multiple teams.