Ah, I see this is essentially what is being done in https://github.com/aerogear/aerogear-js-sdk/pull/16