Here is how we did: We converted our code (which is an npm package) to bundle.js (using browserify). We then included bundle.js in a html page. We then used:
Now theoretically our HTML page should have access to everything inside the package (including the ProcessData class) and so we added the line
var processData= new ProcessData("api-key")
which does not work (hence generates the Uncaught ReferenceError).
Can someone please point us to the right approach for our use-case?
We would like to dynamically load our scripts for each users when a specific event occurs, We would like our scripts to be compatible with both desktop and mobile versions, Our scripts should be able to communicate with remote servers.
Thanks for any help.