How to use external NPM library correctly in Retool?

I am trying to load this library in Retool, and use it in scripts triggered by a click on the button component:

I have tried to load it according to documentation: Preloaded JavaScript and Libraries

But I still cannot access it in the script. How can I load it properly?

Hi @kghugo

the library you're trying to use if for Node.js only.
You cannot use it in browser.

If you need only the decoding function, there's a specific library from the same author for browser use-case:

Hope this help

1 Like