It'd be nice to have the ability to have multiple environments enabled in a certain workspace at any given time. This would allow you to have an environment and a private environment active at the same time to protect information that you might not want to accidentally expose.
For example, if you're dealing with an API you might have different Insomnia environments for different product environments (for example: local and production). This way I can have a production environment and a private production environment enabled at the same time. Optionally, you could also have protected environment keys that will not get exported when you export a certain environment.
Production Environment
{
"host": "https://api.service.com"
}
Private Production Environment
{
"API_KEY": "<SOME_SECRET_KEY>"
}
Local Environment
{
"host": "http://127.0.0.1:8443"
}
Private Production Environment
{
"API_KEY": "<SOME_OTHER_SECRET_KEY>"
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
+1
I have the need to have something similar but I was thinking more in nested environments rather than enabling more than one at the same time.
Example:
The issue I see with multiple selected environments is to know what to do when you have conflicts (variables present in several selected environments). How do you resolve them?
Nested environments solves this issue by using variables by bubbling up from the selected env to the top.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is this feature still planned to implement? I'd like to migrate from Postman in my current company, but difficult to do it without this functionality.
I really need this too, is there a plan for this feature?
I need this feature too, but I found a workaround for this problem
Insert all your variables inside Base Environment but add them by group then by environment. eg
{
"API_Server": {
"testing": {
"api_server_url": "https://testing.website.com/api"
},
"staging": {
"api_server_url": "https://staging.website.com/api"
}
},
"User": {
"admin": {
"username": "Admin"
},
"moderator": {
"username": "Mod"
}
}
}
Then create one Sub-Environment with variables to select per group which environment and the variables itself
{
"API_Server_environment": "testing",
"User_environment": "moderator",
"API_Server": {
"api_server_url": "{{ API_Server[API_Server_environment].api_server_url }}"
},
"User": {
"username": "{{ User[User_environment].username }}"
}
}
So you only have to change "*_environment" variables to use the environments you want.
"API_Server_environment": "testing",
"User_environment": "moderator",
Most helpful comment
+1
I have the need to have something similar but I was thinking more in nested environments rather than enabling more than one at the same time.
Example:
Then I can easily switch user under a same env.
The issue I see with multiple selected environments is to know what to do when you have conflicts (variables present in several selected environments). How do you resolve them?
Nested environments solves this issue by using variables by bubbling up from the selected env to the top.