> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-docs-event-stream-action-templates.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Learn how to install and manage dependencies inside of Auth0 Actions.

# Manage Dependencies

Actions allows you to use packages from the [`npm` registry](https://www.npmjs.com/). You can install and manage dependencies for your Actions using either the Actions Code Editor in the <Tooltip tip="Auth0 Dashboard: Auth0's main product to configure your services." cta="View Glossary" href="/docs/glossary?term=Auth0+Dashboard">Auth0 Dashboard</Tooltip> or the Auth0 <Tooltip tip="Auth0 Dashboard: Auth0's main product to configure your services." cta="View Glossary" href="/docs/glossary?term=Management+API">Management API</Tooltip>.

## Add a dependency using the Actions Code Editor

To add a dependency on a package from the public `npm` registry:

1. Navigate to [Auth0 Dashboard > Actions > Library](https://manage.auth0.com/#/actions/library), and select your Action.
2. Locate the Actions Code Editor, and select Modules (cube icon) in its sidebar.
3. Select **Add Module**,and enter the name of the module. To use the latest available version of the package, you can leave the version field blank.
4. In your Actions code, require the module. For example, if you added the Axios package, you would add the following line at the top of your code in the Actions Code Editor:

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

## Add a dependency using the Auth0 Management API

Alternatively, you can add a dependency using the Auth0 Management API's [Create Action endpoint](https://auth0.com/docs/api/management/v2#!/Actions/post_action). When calling the endpoint, specify the dependencies in the payload:

```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
```

## Security considerations

Third-party packages can contain vulnerabilities and malicious code, so we recommend auditing packages before using them in your Actions. We also recommend that you continuously monitor packages for vulnerabilities using software composition analysis tools.

## Limitations for dependencies in Actions

### No native module support

Native modules cannot be used in Actions. When executing an Action that depends on a native module, the Action will error with a message containing `Compilation failed: Cannot find module`.

To check whether an `npm` package is native, navigate to the public Github repository for the `npm` package and review the languages the code uses in the sidebar. If the languages include C/C++, the package is likely native. Popular examples include `bcrypt` and `sqlite3`.

### No private module or private registry support

Private `npm` modules and private `npm` registries cannot be used with Actions. Actions uses the [public `npm` registry](https://registry.npmjs.org).
