npm login --scope=@kosdev-code --registery=https://npm.pkg.github.com
In this video, we set up a GitHub access token that enables access to various KOS SDKs.
GitHub access tokens are set from settings under the profile. KOS recommends using the classic tokens. After giving the token a name, expiry, and scope, generate a token. Make sure to copy this token, as this is the only time you will see it. Set up NPM to use the token via:
npm login --scope=@kosdev-code --registery=https://npm.pkg.github.com
where the username is the GitHub username and the password is the access token created above.
00:08.645 Create Token
Before we can get started with setting up our development environment, we need to get GitHub Personal Access Tokens to provide access to the various KOS SDKs.
Let’s start that process now.
First thing you want to do is log into GitHub.com with your username and password, which I’ve done already.
From there, you’re going to go into the settings screen.
At the very bottom down here, there’s developer settings.
Select that, and there’s an option for setting up personal access tokens.
We’ll go to Tokens Classic, and we’ll give the choice to generate a new token.
We’ll give this one a name.
This is going to be for the tutorials, and you need to make sure that you’ve at least got read access in order to pull down the various modules and libraries that are provided.
I’m going to pick write access because I need to do some writing, but you can do with just using read.
You want to set an expiry date just for security.
I’m going to say no expiry for now, and then I’m going to generate a token.
You want to be careful because once I leave this window, I don’t have access to it.
You want to copy to the clipboard so that we can make use of it in another command.
01:44.075 Configure NPM
In order to make use of this token, we actually need to configure NPM to say that when I’m trying to get access to any of the artifacts that are on the KOS dev domain, that I want to use that personal access token to do so.
I’m going to issue a NPM login command that says for the KOS dev code scope, I want to use the GitHub packages registry that we’re configuring here.
When I do that, it’s going to ask for my username.
I’ll put in my GitHub username, and it’s going to ask for a password.
This is where I need to put in the personal access token, and I’ll paste that in as well.
When I do that, I’ve got that configured, and I can continue on with the installation.
Thank you.