---
title: Integrate Capawesome Insiders with Bitbucket Pipelines
description: Learn how to install the private Capawesome Insiders npm packages in your Bitbucket Pipelines builds.
---

# Bitbucket Pipelines

You can use private Capawesome npm packages within your [Bitbucket Pipelines](https://www.atlassian.com/software/bitbucket/features/pipelines){:target="_blank"} builds 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 Bitbucket Repository Variable

[Get your license key](../faq.md#where-can-i-find-my-license-key) and add it to your Bitbucket repository as a secured repository variable with the name `CAPAWESOME_NPM_REGISTRY_TOKEN` as described in [Variables and secrets](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/){:target="_blank"}. Make sure to mark the variable as secured.

???+ 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 Bitbucket Pipeline **before** installing npm dependencies:

```yaml
- 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 Bitbucket Pipelines builds.

### Example

Here's a complete example of a `bitbucket-pipelines.yml` file that builds an Ionic app using private Capawesome packages:

```yaml
image: node:20

pipelines:
  default:
    - step:
        name: Build App
        caches:
          - node
        script:
          - echo "@capawesome-team:registry=https://npm.registry.capawesome.io" >> .npmrc
          - echo "//npm.registry.capawesome.io/:_authToken=${CAPAWESOME_NPM_REGISTRY_TOKEN}" >> .npmrc
          - npm ci
          - npx cap sync
          - npm run build
        artifacts:
          - dist/**
```
