I have been using keycloak.js for more than year mainly with the mobile
Library is pretty well designed however there are some minor limitations in
terms of what adapters could do.
custom implementations for adapters.
Additionally implementations are provided as objects so it's hard to see
and conform this undocumented interface.
I'm happy to contribute any changes that will make sense upstream.
I have created issue to cover exact use case where this is needed:
Adding this functionality will also make it trivial to implement support
for different mobile platforms like ReactNative etc.