Team NPM accounts

What team NPM accounts are and how to use them

Zoli Andras avatar
Written by Zoli Andras
Updated over a week ago

What is the purpose of Team NPM accounts?

Team NPM accounts replace individual developer accounts when it comes to NPM package installation. Each team can have a single NPM user set up, that is shared amongst the developers. Projects then can be configured to use the team NPM credentials to install Mobiscroll.

What does it solve?

Since NPM access is based on user credentials, whenever a user changes their password, a project that was set up by them will lose access and will need to be set up again.

Also when a license is reassigned to another developer - that can happen for various reasons (developer leaving a team or working on something else) - they lose the access until Mobiscroll is reinstalled with the new credentials.

When using CI/CD environments, things can get even more problematic. Even if a developer changes their password, the CI/CD pipeline will break and won't be able run an npm update until a new login token is pushed in.

How to update a project to use a team NPM account instead of an individual user account?

  1. Set up NPM access for your team

    This can be done from the Licenses page by any developer.

    1. First, click the "Set up NPM access" button above the assigned developers list

      Image showing the Set up NPM access button on the licenses page
    2. Enter a username

    3. Generate a secret for your company

    4. Save the credentials

      Image showing the steps to take to set up team NPM access. Username field, generate a secret and click the save button.

  2. Update the credentials in the CLI and reinstall Mobiscroll

    Image showing an example command line running the mobiscroll login button. Asks for credentials and an example credential is used.

    Run a login command in the project's root folder.

    mobiscroll login

    When the Mobiscroll CLI prompts for credentials, enter the user and secret of team NPM account instead of the individual developer account.

    Note: You might need to update the Mobiscroll CLI to the latest version.

  3. Commit and push the login token into your repository

    The login command will create or update a file called .npmrc or .yarnrc.yml (for yarn users). This file contains the authorization token and it needs to be committed and pushed into your repository so that other developers and CI/CD environments are granted access to the packages.

Updating team NPM account credentials

Updating the credentials can be done from the Licenses page by any developer that is part of the team. After you update the user and/or the secret, the projects that were previously set up with the same account will lose access until the authorization tokens are updated.

  1. First, click the "Change access" button

    Image showing the Change access button on the licenses page

  2. Generate a new secret by clicking the "Generate secret" button

  3. Optionally change the username

  4. Hit the save button to update the credentials

    Image showing the steps to take to change the team NPM access. Generate a new secret by clicking the generate secret button and optionally changing the username field as well. Then clicking the save button to update the credentials.

To update the authorization tokens, the mobiscroll login command needs to be run in the project's root folder:

Image showing an example command line running the mobiscroll login button. Asks for credentials and an example credential is used.

mobiscroll login

After the Mobiscroll CLI prompts for the user and secret you can use the updated credentials to set the project up.

The login command will update the authorization token in a file called .npmrc or .yarnrc.yml (if you are using yarn instead of npm). This change has to be committed and pushed into the repository.

Did this answer your question?