Unleash/unleash-client-node

feat: Add support for browser

ivarconr opened this issue · 1 comments

We just changed to using node-fetch, and this is already part of the main branch.

I would not have the SDK depend directly on isomorphic-fetch, but I am willing to consider a browser specific entry for the browser in the package.json.

The browser entry needs to do a couple of things:

  • change the backup-handler to use localstorage instead of file based storage.
  • create a specific "request" module for the browser context (e.g. http(s) agents does not make sense in the browser, and fetch is available in the global scope)

We should also consider adding an "exports" field if we end up with a "browser" field.

Would love some inital feedback on whether this is a good idea.

We open sources the proxy which add support for the browser. https://github.com/Unleash/unleash-proxy