Result I have investigated and while it is possible to allow the developer to provide their own mechanism for encryption I think the simplest option is for us to encrypt/decrypt the storage ourselves using well established node modules. This way if they want they can still provide their own storage solution with encryption built in. I have implemented this here: https://github.com/aerogear/aerogear-js-sdk/pull/326 The solution is to provide an encryption key and if the developer provides this then we encrypt localStorage for them using a storage wrapper. Depending on what Wojciech Trocki and Wei Li think if we decide this is mergeable then I will update the docs to reflect this new flag. Note: I haven't performed any performance tests yet but I will update the ticket here with a result once I do. |