Yandex Cloud
Documentation
PresentationContact UsTry it for free
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Registry
  • Getting started
    • All guides
        • Setting up npm
      • Deleting an artifact from a registry
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  1. Step-by-step guides
  2. Managing artifacts
  3. Node.js artifact
  4. Setting up npm

Setting up npm

Written by
Yandex Cloud
Updated at November 17, 2026
View in Markdown

To do the setting up:

  • For all projects: run this command:

    npm config set registry https://registry.yandexcloud.net/npm/<registry_ID>

  • For one project:

    1. Open the .npmrc file in the project root.

    2. Depending on the authentication method:

      IAM token (Base64)
      IAM token
      API key (Base64)
      1. Get an IAM token for the Yandex account or service account you are going to use for authentication.

      2. Create the NPM_AUTH environment variable:

        export NPM_AUTH=$(echo -n 'iam:<IAM_token>' | base64)
        

        Where NPM_AUTH is the body of the previously obtained IAM token, Base64-encoded.

      3. Add the following lines to the previously created .npmrc file:

        registry=https://registry.yandexcloud.net/npm/<registry_ID>
        //registry.yandexcloud.net/npm/:_auth=${NPM_AUTH}
        always-auth=true
        
      1. Get an IAM token for the Yandex account or service account you are going to use for authentication.

      2. Create the NPM_AUTH environment variable:

        export NPM_AUTH="<IAM_token>"
        

        Where NPM_AUTH is the body of the previously obtained IAM token.

      3. Add the following lines to the previously created .npmrc file:

        registry=https://registry.yandexcloud.net/npm/<registry_ID>
        //registry.yandexcloud.net/npm/:_authToken=${NPM_AUTH}
        always-auth=true
        
      1. Create an API key for the service account you are going to use for authentication.

        When creating a key, specify its scope:

        • yc.cloud-registry.artifacts.pull: To pull artifacts from the registry.
        • yc.cloud-registry.artifacts.push: To push artifacts to the registry.
      2. Create the NPM_AUTH environment variable:

        export NPM_AUTH=$(echo -n 'api_key:<API_key>' | base64)
        

        Where NPM_AUTH is the body of the previously created API key, Base64-encoded.

      3. Add the following lines to the previously created .npmrc file:

        registry=https://registry.yandexcloud.net/npm/<registry_ID>
        //registry.yandexcloud.net/npm/:_auth=${NPM_AUTH}
        always-auth=true
        

Scope is an API key parameter that restricts the key's use to specific operations in addition to the service account's access permissions. For details, see API keys with scope and validity limits.

Was the article helpful?

Previous
Setting up Maven
Next
Setting up NuGet
© 2026 Direct Cursus Technology L.L.C.