I've polished keycloak.js and also added a few more features to it:
* Cordova support
* Account management support
* Load config from keycloak.json
* Added a bunch of events (onAuthSuccess, onAuthError, onAuthRefreshSuccess,
onAuthRefreshError, onReady)
* Async methods now return promise (init, updateToken, loadProfile)
I need to update the documentation, but there's two new examples:
* example/js-console - exposes pretty much all functionality in the js lib
* example/cordova - basic Cordova example (tested with Android phone and emulator)