Closed dep closed 4 months ago
👋🏻 Hey @dep ! Thanks for raising this issue.
Because we embed the evaluation engine in the Flipt Client Node, and because the engine is OS/Architecture specific, we need the os
Node module to determine what the client OS is. This means that currently the flipt-node-client
is limited to running in NodeJS environments and not capable of running in the browser.
We're currently looking into how to bundle the evaluation engine via WASM so that we can release a browser compatible client side evaluation library. But until then, we're only capable of supporting Node compatible usecases with this client.
I will update the https://github.com/flipt-io/flipt-client-sdks/tree/main/flipt-client-node README and documentation to note this.
@dep I know its been awhile! but we've finally released a client-side SDK that's compatible with running in the browser (without NodeJS)
https://www.npmjs.com/package/@flipt-io/flipt-client-browser
Mind giving it a try to see if it fixes this issue for you?
@markphelps I'll give it a go when I have a few, thanks!
Bug Description
Trying to use the JS SDK as documented here: https://github.com/flipt-io/flipt-client-sdks/tree/main/flipt-client-node
I'm getting a JS error:
Version Info
v1.34.0
Search
Steps to Reproduce
Install
"@flipt-io/flipt-client": "0.0.3",
Setup:
// namespace is the first positional argument and is optional here and will have a value of "default" if not specified. // engine_opts is the second positional argument and is also optional, the structure is: // { // "url": "http://localhost:8080", // "update_interval": 120, // "auth_token": "secret" // } // // You can replace the url with where your upstream Flipt instance points to, the update interval for how long you are willing // to wait for updated flag state, and the auth token if your Flipt instance requires it. const fliptEvaluationClient = new FliptEvaluationClient();
const variant = fliptEvaluationClient.evaluateVariant("flag1", "someentity", {"fizz": "buzz"});
console.log(variant);