Please search for verifySession in ZAutomationAPIProvider.js. I'm not saying it is accessible from modules, but at least you can have a look how we handle it.
ok, but isn't there an "almighty" global object that can be used for passing around data wherever in the call stack you are at the moment (regardless of modules etc), like e.g. in web apps the HTTPSession? Then that session object could be used everywhere in the code as a placeholder for global data and then fetched where it is needed?