> 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ライブラリのプライベートレジストリに認証する一般的な方法の1つは、あるファイルを含めることです。 `.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.
