How to create a configuration for Service Worker

Context We’re working on encrypting data stored in offline mode. Data will be encrypted before it gets stored in cache / esm-offline database. It’s decrypted before it’s accessed by the application or uploaded back online. Encryption needs to be enabled/disabled via a configuration that can be set for an instance or a distribution.

How to configure Going the react-config route is not something that’ll work since esm-offline is a framework being accessed by the service worker. We’re looking at an alternative approach to this but so far we can see that nothing similar has been implemented. So we’d appreciate any suggestions on how we can about this configuration.

What we want to configure

  • isEncryptionActive - boolean
  • urls / patterns (to encrypt) - list of data