Excessive use of Javascript window object

I am working on a javascript SDK which works in browser, here they have used window.someVariableName to store a data. We wanted that variable to be accessible any where in javascript code, but this expose the internal variables to the user, which is not secure.
Is there any standard way to handle this?

I created a singleton class in javascript and added all variables in that class with getters and setters.