---
title: Integrate Capawesome Insiders with Jenkins
description: Install private Capawesome Insiders npm packages in your Jenkins pipelines. Configure access tokens and npm registry for Capacitor CI/CD builds.
---

# Jenkins

You can use private Capawesome npm packages within your [Jenkins](https://www.jenkins.io/){:target="_blank"} pipelines by configuring the Capawesome npm registry.
This guide shows you how to set up authentication to access the private packages from the Capawesome Insiders program.

## Preparation

### Create Jenkins Credentials

[Get your license key](../faq.md#where-can-i-find-my-license-key) and add it to your Jenkins instance as a secret text credential with the ID `CAPAWESOME_NPM_REGISTRY_TOKEN` as described in [Using credentials](https://www.jenkins.io/doc/book/using/using-credentials/){:target="_blank"}.

???+ warning "Keep your license key secure"

    Never commit your license key directly to your repository and always use environment variables to store sensitive information like authentication tokens.

## Pipeline Configuration

### Configure the npm registry

Add the following script to your Jenkins pipeline **before** installing npm dependencies:

```groovy
withCredentials([string(credentialsId: 'CAPAWESOME_NPM_REGISTRY_TOKEN', variable: 'CAPAWESOME_NPM_REGISTRY_TOKEN')]) {
    sh '''
        echo "@capawesome-team:registry=https://npm.registry.capawesome.io" >> .npmrc
        echo "//npm.registry.capawesome.io/:_authToken=${CAPAWESOME_NPM_REGISTRY_TOKEN}" >> .npmrc
    '''
}
```

This will automatically configure npm to use the Capawesome registry for `@capawesome-team` packages during Jenkins builds.

### Example

Here's a complete example of a Jenkins pipeline that builds an Ionic app using private Capawesome packages:

```groovy
pipeline {
    agent any
    
    environment {
        NODE_VERSION = '20'
    }
    
    stages {
        stage('Setup') {
            steps {
                // Install Node.js
                sh '''
                    curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo -E bash -
                    sudo apt-get install -y nodejs
                '''
            }
        }
        
        stage('Configure Registry') {
            steps {
                withCredentials([string(credentialsId: 'CAPAWESOME_NPM_REGISTRY_TOKEN', variable: 'CAPAWESOME_NPM_REGISTRY_TOKEN')]) {
                    sh '''
                        echo "@capawesome-team:registry=https://npm.registry.capawesome.io" >> .npmrc
                        echo "//npm.registry.capawesome.io/:_authToken=${CAPAWESOME_NPM_REGISTRY_TOKEN}" >> .npmrc
                    '''
                }
            }
        }
        
        stage('Install Dependencies') {
            steps {
                sh 'npm ci'
            }
        }
        
        stage('Build') {
            steps {
                sh '''
                    npx cap sync
                    npm run build
                '''
            }
        }
    }
    
    post {
        always {
            // Clean up .npmrc file
            sh 'rm -f .npmrc'
        }
    }
}
```
