I'm not aware of anyone having tried to use the library in SW before. Also, last time we checked if we may be able to move the sync logic to SW background sync, that feature wasn't available in browsers yet.
No idea really, but I have personally not seen code using a complex JS library in SW before. If you use caching, the sync is usually pretty fast after re-opening an app, and one can tune that performance a lot by adjusting caching and loading behavior.
The widget (mostly) uses the library's public API, as documented in https://remotestoragejs.readthedocs.io/en/latest/js-api.html.
this.rs. to find the calls on the rs.js instance).
The token should be available from
remote is a
WireClient). Or, if the SW has access to the same
localStorage, then you could just read it from there directly.