Configuring npm to work with a SourceCraft registry

  1. Create a personal access token (PAT).

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

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

    registry=https://pkg.sourcecraft.tech/npm/<organization_slug>/<registry_ID>/
    //pkg.sourcecraft.tech/npm/<organization_slug>/<registry_ID>/:_authToken=${NPM_AUTH_TOKEN}
    always-auth=true
    

    Tip

    You can find the organization slug and registry ID on the registry page in the SourceCraft UI.

  4. Create the NPM_AUTH_TOKEN environment variable containing the previously obtained personal access token:

    export NPM_AUTH_TOKEN=<personal_access_token>
    

See also