Hey @peter_munachi!
While many external libraries do work in Retool, it unfortunately isn't possible at the moment to import every npm package directly into Retool. As mentioned in our docs (here), you need to import a UMD build in order for it to work. The library you import also can't contain 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. If you're interested in reading more about how to work with custom components in your app you can read these docs.
Also, Retool runs its Javascript in a sandboxed environment so you most likely won't have access to the parent window's methods.
Hope this helps a little, and please do let me know if you have any questions!