Appearance
Getting started
Setup
WARNING
Codey requires a minimum node version of v22 in order to work properly.
Codey packages are privately hosted on Azure DevOps. To get access to these packages, the following setup is required.
First, we need to let npm know where to find the @xerius
packages using a .npmrc
file. This file needs to be placed next to the package.json
with the following content:
bash
@xerius:registry=https://pkgs.dev.azure.com/xeriusit/_packaging/XeriusGroup/npm/registry/
WARNING
Ensure you put @xerius:
in front of the registry
. Forgetting this will cause npm to fetch all packages from the private npm registry.
Authenticate on Windows
To authenticate with Azure DevOps, use the following command:
bash
npx vsts-npm-auth -config .npmrc
This command not working?
Try adding the -F
option to prompt the login screen:
npx vsts-npm-auth -config .npmrc -F
When prompted with a login screen, authenticate with your Xerius email address.
More information can be found on Azure DevOps.
Authenticate on Mac
The vsts-npm-auth
package is not available for Mac. To authenticate on Mac, you need to use a PAT (Personal Access Token) and add a .npmrc
file in the $HOME
directory of your user:
Add .npmrc
to $HOME
; begin auth token
//pkgs.dev.azure.com/xeriusit/_packaging/XeriusGroup/npm/registry/:username=xeriusit
//pkgs.dev.azure.com/xeriusit/_packaging/XeriusGroup/npm/registry/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/xeriusit/_packaging/XeriusGroup/npm/registry/:email=anemail@xerius.be
//pkgs.dev.azure.com/xeriusit/_packaging/XeriusGroup/npm/:username=xeriusit
//pkgs.dev.azure.com/xeriusit/_packaging/XeriusGroup/npm/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/xeriusit/_packaging/XeriusGroup/npm/:email=anemail@xerius.be
; end auth token
Generate PAT
Generate a Personal Access Token with Packaging read & write scopes.
Base64 encode the PAT
One safe and secure method for Base64 encoding a string is to:
- From a command/shell prompt, run:
bash
node -e "require('readline') .createInterface({input:process.stdin,output:process.stdout,historySize:0}) .question('PAT> ',p => { b64=Buffer.from(p.trim()).toString('base64');console.log(b64);process.exit(); })"
- Paste your personal access token value and press Enter/Return
- Copy the Base64 encoded value
Fill the BASE64 token in the .npmrc
file
Replace both [BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
values in your user .npmrc
file with your encoded personal access token from step 3.
Install Codey Packages
An overview of all Codey packages can be found here.
Pipeline
When setting up a build pipeline, we advise adding an npm authentication task to ensure all npm packages can be installed correctly.
yml
- task: npmAuthenticate@0
displayName: Authenticate npm
inputs:
workingFile: "${{parameters.workingDir}}/<your-app-root>/.npmrc"