Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences here.
×
×
Cookie Preferences
We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
Hi, The API cookbook page on the Help Centre describes the Revealing Module pattern but doesn't actually say where it needs to be used. Is it required for scripts to use this pattern to integrate with others? Can ES6 modules be used also?
It is not required, it's just a technique of building a private scope and protecting the global scope from collisions. ES6 Modules won't work on the Roll20 API, as the individual scripts don't get loaded like they would in a Node Application. They instead get concatenated together into one large script that is then executed by the API Sandbox.