How to set user specific environment variables for a shared collection?

I have a collection shared with a team. That collection contains multiple environments and every environment has a set of variables. From those variables there are two variables email and password where I would like to define them differently according to the user.

The reason why I need this is that I run a script to fetch the user token before every request and that is done on the collection level in pre-request script.

pm.sendRequest({
    url: pm.environment.get("host") + '/api/token',
    method: 'POST',
    header: {
        'content-type': 'application/json',
        'Authorization': 'Basic ' + btoa(pm.environment.get("email") + ':' + pm.environment.get("password"))
    },
    body: {
    }
}, function (err, res) {
    pm.environment.set("authToken", res.json().token);
});

As you can see here email and password are read from environment variables where every team member have different email and password. What is the best way to load this info and keeping the password secure from the rest of the team?

Not sure if this will work to your specific need but… I’d suggest each person make a personal workspace and set their info as global variables.

Then have them import your shared collections and environments. In your code, set variables to be overwritten/set with global variable data from users workspaces. Have user set their config to not save current variables to initial values so their data is not exported from their own local setup.

I see so basically it’s reverse. Have them import the team collection to their own collection and they will set their own variables locally. Makes sense. Will try it out. Thx!