---
title: Integrate Capawesome Insiders with GitLab CI/CD
description: Install private Capawesome Insiders npm packages in GitLab CI/CD pipelines. Configure access tokens, npm registry, and Capacitor build steps.
---

# GitLab CI/CD

You can use private Capawesome npm packages within your [GitLab CI/CD](https://docs.gitlab.com/ci/){: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 a GitLab CI/CD Variable

[Get your license key](../faq.md#where-can-i-find-my-license-key) and add it to your GitLab project as a CI/CD variable with the name `CAPAWESOME_NPM_REGISTRY_TOKEN` as described in [CI/CD variables](https://docs.gitlab.com/ci/variables/){:target="_blank"}. Make sure to mark the variable as masked and protected.

???+ 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 GitLab CI/CD pipeline **before** installing npm dependencies:

```yaml
before_script:
  - 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 GitLab CI/CD builds.

### Example

Here's a complete example of a GitLab CI/CD pipeline that builds an Ionic app using private Capawesome packages:

```yaml
stages:
  - build

build-app:
  stage: build
  image: node:20
  before_script:
    - echo "@capawesome-team:registry=https://npm.registry.capawesome.io" >> .npmrc
    - echo "//npm.registry.capawesome.io/:_authToken=${CAPAWESOME_NPM_REGISTRY_TOKEN}" >> .npmrc
    - npm ci
  script:
    - npx cap sync
    - npm run build
  artifacts:
    paths:
      - dist/
    expire_in: 1 hour
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
```

This pipeline will authenticate with the Capawesome npm registry and install any private packages specified in your `package.json` file.
