Is your feature request related to a problem? Please describe.
When I switch between working in development environment vs staging/production I have to go through all my tabs updating the endpoint and headers (for access tokens etc).
Describe the solution youโd like
Ability to have multiple "profiles" where endpoint and headers could be applied to all tabs.
Describe alternatives youโve considered
n/a
Additional context
n/a
๐๐พThanks for opening your first issue here! Be sure to follow the issue template! โ๐พ
Can you define what a profile is.
Also why can't you have separate tabs for different environments?
All of my tabs have an access token in. Updating that access token across
10 tabs is a labourisous process.
Also if I have 10 active tabs that I'm working on but I also need to have
another tab for a different environment (e.g. staging) I now need 20 tabs.
Having a "profile" type feature reduces the amount of tabs I need to have
open at any one time.
Definition of a profile: some settings (i.e. endpoint and collection of
headers) that can be applied across tabs.
On Wed, 18 Jul 2018, 19:18 Samuel, notifications@github.com wrote:
Also why can't you have separate tabs for different environments?
โ
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/imolorhe/altair/issues/341#issuecomment-406026803,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AASE-iyIwhlmwuLSO0evumQLN2gRM7sWks5uH3wOgaJpZM4VUsz-
.
How do you propose this profile is set and used? Thinking from the user flow, how would you go about it, and also considering the UI as well. Is there any application that you can refer to about the profile functionality?
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.
Maybe it can look like this:
Profiles page
Settings in windows or a checkbox somewere ( Use default profile ), if you want use profiles or uncheck to have same functionalities from window
So if I understand correctly, a profile would only set the value of URL and headers? And the profile would be applied to a window, to override the current settings of the window with the profile settings (which can still be changed by the user as they would normally be able to).
Yes,
I'm not sure if @chrisharrison see it like this but this flow should cover his needs,
maybe in some cases, it will be better to have two checkboxes for default profile URL and default headers separate but this was first what comes into my mind ๐
In postman they have environments which is what you use to switch between dev/staging/prod etc. However in postman it is more generic as your environment is simply a set of variables that you can use anywhere in your request via templating. E.g you can template headers, urls, params, request body for e.g template in your username and password in a login post.
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.
Just leaving my two cents, I have a whole bunch of queries that when we deploy I like to just run through and spot check things with to make sure speed etc are still performing right. Right now in altair that would equate to a 3/4 windows(one for local, stage, and prod), with collections holding all the queries I use. However, it is a pain to switch from the "local" window to "stage", as I now have to for each query change my token, and the url. It would be nice if there was a profile / environment( maybe attached to windows?) that I could set basic key-value variables to use in headers and urls. An example for what it might look like is in insomnia. Currently I use altair for "new" dev work as it has the doc explorer and really nice add fragment items, and I keep all my old queries in insomnia because it's a lot easier to switch between environments there.
I've decided it is better to implement this using the environments approach used by postman.
There would be an environment options that would list out available environments. The environments would essentially be a list of variables with values. Then within the interface, the variables can be used in place of the actual values.
Also you can check how it is implemented in "insomnia", they also have some env's stored as objects and you can use it everywhere
Hi @imolorhe , thanks for Env's
but i'm stuck on how should it be used ๐

my question is how can i use my 'base_url' in URL field,

i try a lot of strings with .base_url in the end like Staging.base_url, Environments.Staging.base_url, global.base_url, etc
but without success ๐ any hint will help ๐
Ah.. you use them within double curly braces {{env_var}}. Sorry about the lack of documentation on it. I've updated the post about it also with this information. https://sirmuel.design/altair-becomes-environment-friendly-%EF%B8%8F-f9b4e9ef887c
Feel free to clap and share! ๐
@imolorhe
It seems that it isn't working in headers?



@JacobT14 Thanks! That was an oversight! Working on fixing it!
No problem! Just didn't know if I was missing something! Just BTW a nice little additional touch would be some sort of autocomplete when you start typing {{
:) Just an idea!
@JacobT14 It's already being considered ๐ Might take a while though.
Hi @imolorhe
it will be great to have a possibility to use env's like nested object, something like :
{
"superviser": {
"prefix": "Bearer ",
"token_hash": "12345"
}
}
and use it like {{superviser.prefix}}{{superviser.token_hash}}
also remarked what if i use somethig from env's in Set headers like {{hash}}, after first request it will be replaced with content of that var, and next changes in env's for hash are useles

Chrome extension v.2.0.7
@vrobik Noted. Would fix the header environment variables issue in the next version. It's an issue with object references. You could create a PR for it also if you'd like.
Most helpful comment
Also you can check how it is implemented in "insomnia", they also have some env's stored as objects and you can use it everywhere