Configuring npm to work with a SourceCraft registry
-
Create a personal access token (PAT).
-
Open the
.npmrcfile in the project root. -
Add the following lines to the previously created
.npmrcfile:registry=https://pkg.sourcecraft.tech/npm/<organization_slug>/<registry_ID>/ //pkg.sourcecraft.tech/npm/<organization_slug>/<registry_ID>/:_authToken=${NPM_AUTH_TOKEN} always-auth=trueTip
You can find the organization slug and registry ID on the registry page in the SourceCraft UI.
-
Create the
NPM_AUTH_TOKENenvironment variable containing the previously obtained personal access token:export NPM_AUTH_TOKEN=<personal_access_token>
See also
- SourceCraft resource relationships
- Creating a registry in SourceCraft
- Connecting a registry to a SourceCraft repository
- Configuring Maven to work with a SourceCraft registry
- Configuring NuGet to work with a SourceCraft registry
- Configuring PyPI to work with the SourceCraft registry
- Configuring Docker to work with a SourceCraft registry
Was the article helpful?
Previous
Next