RE: How to import external library with multiple files

I want to access an external library as part of one of my scripts:

 

https://github.com/auth0/node-jsonwebtoken

 

I’ve read several guides showing how to upload a single .js file to the file cabinet and refer to it via it’s relative path, however I’m at a loss as to what to do when I want to use a multi-file library like this.

Jarrod Tuxworth Rookie Asked on December 28, 2021 in SuiteScript.
Add Comment
3 Answers

Usually you look for libraries that work in both the browser and node using the UMD pattern. For crypto related things, you need to make sure that it doesnt use the Crypto interface, suitescript does not implement it. Id start at trying things from https://jwt.io/libraries.

Advanced Answered on December 31, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.