DocsGetting StartedInstallation

Installation

npm i @bluefunctor/blue
❗️

This package is currently private, ensuring it’s exclusively available to our trusted collaborators and partners. If you’re interested in gaining access, feel free to contact us for more details.


Local Development

To install and use the package locally, you’ll need to configure a .npmrc file in your project directory with your private token.

Here’s an example of a .npmrc file:

.npmrc
@blue-functor:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_PRIVATE_TOKEN

Replace YOUR_PRIVATE_TOKEN with the private token provided to you.

Once configured, you can run the following command to install the package:

npm install

CI Environments

For CI/CD pipelines, the private token must be securely stored and injected into the environment. Use an environment variable to store the token and configure the .npmrc dynamically during the build process.

Here’s an example using a shell script:

echo "//npm.pkg.github.com/:_authToken=\${NPM_TOKEN}" > .npmrc

Before running the script, ensure the NPM_TOKEN environment variable is set in your CI system (e.g., GitHub Actions, GitLab CI, or CircleCI).

In your CI configuration file, add the setup step before the installation:

GitHub Actions example:

steps:
  - name: Checkout code
    uses: actions/checkout@v3
 
  - name: Set up .npmrc
    run: echo "//npm.pkg.github.com/:_authToken=\${{ secrets.NPM_TOKEN }}" > .npmrc
 
  - name: Install dependencies
    run: yarn install

This ensures the private package is securely installed in both local and CI environments while protecting your token.