dropbox / dropbox-sdk-js

The Official Dropbox API V2 SDK for Javascript
https://www.dropbox.com/developers
MIT License
937 stars 352 forks source link

web version of the sdk should use the browser crypto api #1115

Open ta32 opened 1 year ago

ta32 commented 1 year ago

Why is this feature valuable to you? Does it solve a problem you're having? The web version of the JavaScript SDK is importing the NodeJs (server) crypto module - the web-pack fallback for this is https://github.com/browserify/crypto-browserify

This results in a large bundle size for your web-app. It should be possible to replace this with the native browser crypto API's https://developer.mozilla.org/en-US/docs/Web/API/Crypto

Also I am not sure if its safe to continue using this fallback for the future especially for something like cryptography.

Describe the solution you'd like The SDK should detect its being used in the browser and use the https://developer.mozilla.org/en-US/docs/Web/API/Crypto API.

Describe alternatives you've considered None

Additional context related issues https://github.com/dropbox/dropbox-sdk-js/issues/991 https://github.com/dropbox/dropbox-sdk-js/issues/614

greg-db commented 1 year ago

Thanks for writing this up! I'll ask the team to update this accordingly, though I can't promise if/when this would be done.