Configuring npm to work with a SourceCraft registry
-
Create a personal access token (PAT).
-
Open the
.npmrc
file in the project root. -
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.
-
Create the
NPM_AUTH_TOKEN
environment variable containing the previously obtained personal access token:export NPM_AUTH_TOKEN=<personal_access_token>
See also
Was the article helpful?
Previous