> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Auth0 Dashboard の Actions Code Editor または Management API を使用して、npm レジストリのパッケージを Auth0 Actions の依存関係として追加し、セキュリティガイダンスとネイティブおよびプライベートモジュールの制限事項を確認します。

# 依存関係の管理

Actions では、[`npm` レジストリ](https://www.npmjs.com/) のパッケージを使用できます。Actions の依存関係は、<Tooltip tip="Auth0 Dashboard: サービスを設定するための Auth0 の主要製品。" cta="用語集を見る" href="/docs/ja-jp/glossary?term=Auth0+Dashboard">Auth0 Dashboard</Tooltip> の Actions Code Editor または Auth0 の <Tooltip tip="Auth0 Dashboard: サービスを設定するための Auth0 の主要製品。" cta="用語集を見る" href="/docs/ja-jp/glossary?term=Management+API">Management API</Tooltip> を使用して、インストールや管理を行えます。

<div id="add-a-dependency-using-the-actions-code-editor">
  ## Actions Code Editor を使用して依存関係を追加する
</div>

公開 `npm` レジストリのパッケージへの依存関係を追加するには、次の手順に従います。

1. [Auth0 Dashboard > Actions > Library](https://manage.auth0.com/#/actions/library) に移動し、対象の Action を選択します。
2. Actions Code Editor を開き、サイドバーの Modules (キューブアイコン) を選択します。
3. **Add Module** を選択し、モジュール名を入力します。パッケージの利用可能な最新バージョンを使用する場合は、バージョン欄は空欄のままにできます。
4. Actions のコード内でそのモジュールを `require` します。たとえば、Axios パッケージを追加した場合は、Actions Code Editor 内のコードの先頭に次の行を追加します。

   ```javascript lines theme={null}
   const axios = require('axios');
   ```

<div id="add-a-dependency-using-the-auth0-management-api">
  ## Auth0 Management API を使って依存関係を追加する
</div>

または、Auth0 Management API の [Create Action エンドポイント](https://auth0.com/docs/api/management/v2#!/Actions/post_action) を使用して依存関係を追加することもできます。エンドポイントを呼び出す際は、ペイロードに依存関係を指定します。

```bash lines theme={null}
curl -H "Authorization: Bearer {managementApiToken}" \
     -X POST  -H "Content-Type: application/json" \
     -d '{ \
            "name":"my-action", \
            "supported_triggers":[{"id":"post-login","version":"v2"}], \
            "code":"module.exports = () => {}",\
            "dependencies": [{\
                "name":"lodash",\
                "version":"4.17.21"\
            }],\
            "runtime":"node14"\
        }' \
    https://{yourTenant}.com/api/v2/actions/actions
```

<div id="security-considerations">
  ## セキュリティに関する考慮事項
</div>

サードパーティのパッケージには脆弱性や悪意のあるコードが含まれている可能性があるため、Actions で使用する前にパッケージを監査することをお勧めします。また、ソフトウェア構成分析ツールを使用して、パッケージの脆弱性を継続的に監視することもお勧めします。

<div id="limitations-for-dependencies-in-actions">
  ## Actions の依存関係に関する制限
</div>

<div id="no-native-module-support">
  ### ネイティブモジュールはサポートされていません
</div>

Actions ではネイティブモジュールは使用できません。ネイティブモジュールに依存する Action を実行すると、`Compilation failed: Cannot find module` を含むメッセージとともにエラーが発生します。

`npm` パッケージがネイティブかどうかを確認するには、その `npm` パッケージの公開 GitHub リポジトリを開き、サイドバーで使用されているプログラミング言語を確認してください。C/C++ が含まれている場合、そのパッケージはネイティブである可能性が高いです。代表的な例としては `bcrypt` や `sqlite3` があります。

<div id="no-private-module-or-private-registry-support">
  ### プライベートモジュールおよびプライベートレジストリはサポートされていません
</div>

Actions では、プライベート `npm` モジュールやプライベート `npm` レジストリは使用できません。Actions で使用されるのは[公開 `npm` レジストリ](https://registry.npmjs.org)です。
