Install npm libraries

Hey,
I was wondering if it's possible to use this SDK in Retool : https://apryse.com/
as long as I understand It's possible to install manually, or via npm

it'll be great to use it in custom component which renders react, or even vanilla JS if it's possible to manually install.

another 2 questions which isn't really related;
is it possible to add css classes to elements?
is it possible to write css to 1 application ?
Thanks!
@dor1411993 (coworker of mine)

First of all thanks for the reply!
can you explain how to manual install ?
or how to install via npm ?

try this action list

to manually install:

Download or obtain the package or library that you want to install. This may be in the form of a .zip file or a code repository.
Extract the contents of the package or library to a folder on your computer.
In Retool, create a new "Script" component and select the programming language you want to use (e.g. JavaScript).
Write the code that imports the package or library into your Retool application. This will likely involve using the "require" or "import" statement to import the library into your code.
Use the functionality of the package or library in your Retool application by calling its APIs or functions.

to install via npm:

Open your terminal or command prompt and navigate to the directory where your Retool application is located.
Use the "npm install" command followed by the name of the package or library you want to install. For example, if you want to install the apryse SDK, you would use the command "npm install apryse-sdk".
Wait for npm to install the package or library and its dependencies.
In Retool, create a new "Script" component and select the programming language you want to use (e.g. JavaScript).
Write the code that imports the package or library into your Retool application. This will likely involve using the "require" or "import" statement to import the library into your code.
Use the functionality of the package or library in your Retool application by calling its APIs or functions.
hope this might help

Hey @omerz8 and @DaVla!

As awesome as it would be to import any npm package directly into Retool it unfortunately isn't possible at the moment. As mentioned in our docs (here) you need to import a UMD build in order for it to work. Particularly, the file you're importing can't have any require statements. That doc also covers exactly how you can import libraries though so it's definitely worth a look!

That being said, if you're open to doing a bit of extra work there is an interesting guide here on how you can develop and publish your own custom component for use within your Retool app. I'm not familiar with Apryse but, taking a quick look at it, that might be your best bet. If you're interested in reading more about how to work with custom components in your app you can read these docs.

As for CSS - @Isaac-H made a fantastic post on how to use custom CSS in Retool here. We typically don't recommend it as a long-term solution though as component classes aren't guaranteed to be consistent between versions and there currently isn't a way to add custom classes to components. You can check out other options for styling your apps in these docs, the dev team is constantly looking to expand them!

Let me know if that raises any further questions :slightly_smiling_face: I'm also curious to hear more about your use case!

1 Like

Hi, do you have any more detailed information on how to develop and use a custom component that can be used in Retool? I have a use case where I need to use some NPM packages (like react-acceptjs for example) that I can't find a way to use in Retool or the custom components that Retool offers, the guide you shared is not finished and seems to be a bit obsolete nowadays.

Hi @Kaizen Thanks for reaching out! The docs linked by @Kabirdas are the most formal guide we have for demonstrating how to use custom components in Retool.

There are some examples on the forum that use custom libraries inside custom components though! Here's one example and here's a more generic post that may help. :crossed_fingers: Hope it helps

1 Like