This is an authentication plugin for Verdaccio with a Github account. Allowing package access to be managed by using Github Team, Github Team feature is only available to a Github organization.
Below snippet is an example to use this authentication plugin. Add `github-team` under the `auth` config, there will be 2 configurations are beloworganization
is the name of your Github organization.paginationCount
is the number of results to include in a single API call, the value is optional and will be default to 100. Value ranges from 1 to 100, any value outside the ranges will be default 100.
auth:
github-team:
organization: mycompany
paginationCount: 100
packages:
'@**/*': # scoped packages
access: web-developer
publish: web-lead
unpublish: web-lead
proxy: npmjs
'**':
access: $authenticated
publish: $authenticated
unpublish: $authenticated
proxy: npmjs
Internally, Github TOKEN is required to make API call to Github server. You should start the Verdacccio server with a TOKEN environment variable. E.g: using node to start the server
TOKEN=abcdefg1234 yarn start
Please generate the TOKEN from GitHub Personal Access Tokens page with read:org
checked under admin:org
.
To install a package, first you need to login with a Github credential, please generate the user TOKEN from GitHub Personal Access Tokens page with read:user
under user
.
Go through the steps below to login (replace square bracket section with your value)
npm login --registry=[your npm server registry path]
.- Please enter your github username when prompted, you should be able to search your Github profile via
https://github.com/[username]
. - Copy paste the created user TOKEN with
read:user
access as the password. - Enter your email address.
- After you are logged in successfully, you can start installing via
npm install myPackage --registry=[your npm server registry path]
.
Repeat steps 1 to 4 from Installing packages. Then publish with the standard NPM way.
E.g: Go to your package folder to publish (with the package.json
), then run
npm publish myPackage --registry=[your npm server registry path]