Using private packages / dependencies

How to use Github packages for private dependencies

Accessing GitHub packages for private dependencies requires the following steps:

  1. Create a personal access token in GitHub
  2. Encrypt the Personal access token in Codemagic by creating an envioronment variable group and marking the “Secure” checkbox. More information here
  3. Add the environment variable group to the codemagic.yaml file.
  4. Create a .npmrc file with the following contents (where @owner is your github username):
registry=https://registry.npmjs.org/
@owner:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}