> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/autofix-to/connect-private-packages/custom-config-private-packages.md).

# 環境変数 - プライベートパッケージ

Aikido がプライベートパッケージを含む依存関係を更新できるようにするには、正確なロックファイル更新を生成できるよう、プライベートレジストリへのアクセスが必要です。Bundle、Poetry、UV など多くのパッケージマネージャーは、認証の設定に環境変数を使用します。Aikido では、暗号化されてワークフローに注入される環境変数を提供できます。

つまり、システムが依存関係の脆弱性を検出すると、プライベートレジストリにシームレスに認証し、影響を受けたパッケージを自動的に修正し、ロックファイルを更新できます。その間も、認証情報は安全に保たれます。

## Aikido での設定 <a href="#configuration-in-aikido" id="configuration-in-aikido"></a>

リポジトリへの書き込み権限が設定されたら、以下の手順に従って Aikido がプライベートレジストリで認証できるように設定できます：

1. アカウントの AutoFix 設定ページに移動し、 [こちら](https://app.aikido.dev/issues/fix/settings).
2. ページ上部のヘッダーにあるタブで「*レジストリを接続*」をクリックすると、以下のモーダルが表示されます

<figure><img src="/files/93d539d9c2979772d40a2c418b778a2cd588532f" alt=""><figcaption></figcaption></figure>

3. 「*環境変数*」を選択すると、リポジトリで自動修正を作成するために必要な環境変数を入力できるようになります。以下の例では、Poetry 用のプライベートレジストリの設定を示しています。

<figure><img src="/files/6fe40affed77088487a13d2b7a3f025743f30fe6" alt=""><figcaption></figcaption></figure>

4. 「key」と「value」を入力し、必要な数だけ変数を追加してください。Aikido がすべての値を自動的に暗号化します。

## 環境変数の使用 <a href="#example-setups" id="example-setups"></a>

### NPM <a href="#npmrc" id="npmrc"></a>

JS ライブラリでプライベートレジストリに認証する一般的な方法は、 `.npmrc` ファイルをリポジトリに含めて、パッケージマネージャーにパッケージのダウンロード元を伝えることです。認証トークンをリポジトリに保存しないようにするため、環境変数を参照できます。

以下に例があります `.npmrc` レジストリを定義し、 `NPM_TOKEN` 環境変数を認証に使用する

```
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
@pied-piper:registry=https://npm.pkg.github.com
```

NPM のプライベートレジストリの他のオプションについては、こちらをご覧ください [こちら](https://help.aikido.dev/~/revisions/27oApOKWT7NW06uHiiU1/aikido-autofix/connect-private-packages/github-registry-private-packages).

### Poetry

環境変数を使った Poetry のセットアップ方法のドキュメントは、こちらをご覧ください [こちら](https://help.aikido.dev/~/revisions/27oApOKWT7NW06uHiiU1/aikido-autofix/connect-private-packages/poetry-private-packages).

### Bundle

環境変数を使った Bundle のセットアップ方法のドキュメントは、こちらをご覧ください [こちら](https://help.aikido.dev/~/revisions/27oApOKWT7NW06uHiiU1/aikido-autofix/connect-private-packages/bundle-private-gems).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/autofix-to/connect-private-packages/custom-config-private-packages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
