Skip to main content

Add third-party packages to an app

Retool supports adding npm packages so that additional functionality can be used in your React apps.

You can add public npm packages to your React app. Private packages are not currently supported.

Security restrictions

Retool imposes certain restrictions on the types of packages that can be installed:

While Retool does not strictly enforce package compatibility, the agent uses React 19 to build your apps. Ensure your package supports this version in order to avoid any adverse effects.

Add package

Ask the agent to add your desired npm package from the prompting box.

Use the `lightweight-charts` npm package for my charts.
Install `mui/material` and use that for my component design.

The agent always asks for permission before installing a third-party package. When prompted, carefully review the request, and apply any security guidance provided to you by your organization administrators or security team. If you trust the package, approve it, and the agent will configure your app accordingly.

Best practices

The agent verifies that your package meets the security requirements but it cannot verify any third-party packages you add to your app. You must independently verify each package that you install in your app. Use the following best practices to safely add packages to your app. Refer to Risks and security considerations for more information.

Verify the package name before installing

Double-check the exact spelling of any package name before installing it. Attackers sometimes publish packages with names that closely resemble popular packages to trick users into installing malicious code. Confirm the package name on npmjs.com and verify it matches the one you intend to install.

Check package reputation and maintenance

Before installing a package, review its activity on npmjs.com and its source repository. Look for indicators of an actively maintained and widely trusted package:

  • High weekly download counts.
  • Recent publish dates.
  • Active issue tracking and pull request history.
  • Multiple contributors or a reputable publisher.

Avoid packages with very few downloads, no recent updates, or a single anonymous maintainer.

Review the package's dependencies

A package's dependencies are also included when you install them. A trusted package can still introduce risk through a compromised or vulnerable dependency. Check the package's dependency tree on npm and avoid packages with an unusually large number of transitive dependencies.

Check for known vulnerabilities

Search for the package in a vulnerability database such as the npm advisory database or Socket before installing. These sources list known security issues and can help you assess whether a package is safe to use.

Risks and security considerations

The following sections outline the risks of installing third-party packages in your React app.

Retool is making product improvements that aim to help you mitigate these risks.

Third-party packages, even those that are well-known and widely vetted, could have compromised code. For example, the following scenarios are possible:

  • A package has its supply chain compromised. For example, attackers could retrieve the package maintainers' git tokens.
  • A package uses another package as its dependency, which is compromised in some way.
  • A package is subject to typosquatting, or the user accidentally installs a package that’s maliciously owned instead of the one that is trusted.
  • A package could contain a vulnerability that could be exploited at runtime.
  • A package that was previously safe could include a vulnerability in an update.

If you add an untrusted or compromised package to your app, malicious payloads could be executed at install time or at runtime. If this occurs, the following risks are possible:

  • Attackers could have access to any action the user takes, such as resetting their password or multi-factor authentication (MFA), inviting or promoting an outside account to admin, etc.
  • Attackers could make arbitrary resource queries in the organization.
  • Attackers could install malware in the code execution environment to monitor resource queries and forward them to an attacker-controlled log.