Node Import Error

Just got this error importing the openfga sdk into Node 20.

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “http”: require.resolve(“stream-http”) }’
- install ‘stream-http’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “http”: false }

Hi @stephenbawks1, as the SDK uses the builtin Node.js http module, you’ll need to instruct webpack to use a polyfill for it. You can do this by installing the stream-http library and then telling webpack to use it as a fallback using the resolve.fallback option in your webpack configuration.

Just to note that the SDK is more intended for use within server side runtimes so make sure that using it in a browser might not be ideal given the use of a client secret.