{"_id":"@arcanaio/go-feature-flag-web-provider-fixed","_rev":"2-0a32d05ae3c47c9b1c8fecc5647ac9c2","name":"@arcanaio/go-feature-flag-web-provider-fixed","dist-tags":{"latest":"0.2.8"},"versions":{"0.2.7":{"name":"@arcanaio/go-feature-flag-web-provider-fixed","version":"0.2.7","keywords":["openfeature","go-feature-flag","feature-flags","feature-toggles","websocket","bug-fix"],"author":{"name":"Arcana"},"license":"Apache-2.0","_id":"@arcanaio/go-feature-flag-web-provider-fixed@0.2.7","maintainers":[{"name":"yuvarajl","email":"yuva@arcana.io"}],"homepage":"https://github.com/open-feature/js-sdk-contrib/tree/main/libs/providers/go-feature-flag-web","bugs":{"url":"https://github.com/open-feature/js-sdk-contrib/issues"},"dist":{"shasum":"6ab7102245c3698fcf6380f8e38c38e4ceede76d","tarball":"https://registry.npmjs.org/@arcanaio/go-feature-flag-web-provider-fixed/-/go-feature-flag-web-provider-fixed-0.2.7.tgz","fileCount":21,"integrity":"sha512-x4CUn6T4enmf8zRAIBkBW/htqsY3AM/j40FI1aemeiIU4DnTbAKWbMRDwc+7qdvelv1X8sOmbaJ2F+KE3yZDxw==","signatures":[{"sig":"MEUCID84QxRQQ4XcRUNOV+jdXu/op5knd6nmHhQvVr6M305FAiEAtK1L07cDcNW2QbH0/a/sKjOQ2Y1v0KV5+X7A8idJ8Cc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":81085},"main":"./index.cjs.js","types":"index.d.ts","module":"./index.esm.js","exports":{".":{"types":"./index.esm.d.ts","import":"./index.cjs.mjs","module":"./index.esm.js","default":"./index.cjs.js"},"./package.json":"./package.json"},"gitHead":"15ae73b9a166bb96501cdedea5720d8fdada8e86","scripts":{"build":"tsc","current-version":"echo $npm_package_version","publish-if-not-exists":"cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi"},"_npmUser":{"name":"yuvarajl","email":"yuva@arcana.io"},"repository":{"url":"git+https://github.com/open-feature/js-sdk-contrib.git","type":"git","directory":"libs/providers/go-feature-flag-web"},"_npmVersion":"10.9.3","description":"GO Feature Flag web provider for OpenFeature with websocket connection fixes","directories":{},"_nodeVersion":"22.19.0","dependencies":{"copy-anything":"^3.0.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0"},"peerDependencies":{"@openfeature/web-sdk":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/go-feature-flag-web-provider-fixed_0.2.7_1759251703251_0.7480929936756919","host":"s3://npm-registry-packages-npm-production"}},"0.2.8":{"name":"@arcanaio/go-feature-flag-web-provider-fixed","version":"0.2.8","description":"GO Feature Flag web provider for OpenFeature with websocket connection fixes","license":"Apache-2.0","author":{"name":"Arcana"},"homepage":"https://github.com/open-feature/js-sdk-contrib/tree/main/libs/providers/go-feature-flag-web","repository":{"type":"git","url":"git+https://github.com/open-feature/js-sdk-contrib.git","directory":"libs/providers/go-feature-flag-web"},"keywords":["openfeature","go-feature-flag","feature-flags","feature-toggles","websocket","bug-fix"],"main":"./index.cjs.js","types":"index.d.ts","publishConfig":{"access":"public"},"scripts":{"build":"tsc","publish-if-not-exists":"cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi","current-version":"echo $npm_package_version"},"peerDependencies":{"@openfeature/web-sdk":"^1.0.0"},"dependencies":{"copy-anything":"^3.0.5"},"devDependencies":{"typescript":"^5.0.0"},"exports":{"./package.json":"./package.json",".":{"module":"./index.esm.js","types":"./index.esm.d.ts","import":"./index.cjs.mjs","default":"./index.cjs.js"}},"module":"./index.esm.js","_id":"@arcanaio/go-feature-flag-web-provider-fixed@0.2.8","gitHead":"17b2179fdbec9226bdb4d60f646d9e2a5ec5b472","bugs":{"url":"https://github.com/open-feature/js-sdk-contrib/issues"},"_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-QursfqVwDTQm16xh6FohotEk+0A/hMEuQMMpLm+B7ma7EY7jeDOuruZ/vQsf35wwSisuv2bsvM3syebVT/qTiw==","shasum":"533f1c04239b2c57948c4d13239d339de2e21635","tarball":"https://registry.npmjs.org/@arcanaio/go-feature-flag-web-provider-fixed/-/go-feature-flag-web-provider-fixed-0.2.8.tgz","fileCount":21,"unpackedSize":85505,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHcMddRGpUF4QVnzy3gcGPvCbD0LTbU3iurgxhyaTir+AiEA/PNQzCsxu/N+Ix2hNwixc2kR2EcPDrJ5GHKOBvty+JE="}]},"_npmUser":{"name":"yuvarajl","email":"yuva@arcana.io"},"directories":{},"maintainers":[{"name":"yuvarajl","email":"yuva@arcana.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/go-feature-flag-web-provider-fixed_0.2.8_1759255893060_0.35767905793836885"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-30T17:01:43.154Z","modified":"2025-09-30T18:11:33.498Z","0.2.7":"2025-09-30T17:01:43.418Z","0.2.8":"2025-09-30T18:11:33.249Z"},"bugs":{"url":"https://github.com/open-feature/js-sdk-contrib/issues"},"author":{"name":"Arcana"},"license":"Apache-2.0","homepage":"https://github.com/open-feature/js-sdk-contrib/tree/main/libs/providers/go-feature-flag-web","keywords":["openfeature","go-feature-flag","feature-flags","feature-toggles","websocket","bug-fix"],"repository":{"type":"git","url":"git+https://github.com/open-feature/js-sdk-contrib.git","directory":"libs/providers/go-feature-flag-web"},"description":"GO Feature Flag web provider for OpenFeature with websocket connection fixes","maintainers":[{"name":"yuvarajl","email":"yuva@arcana.io"}],"readme":"# go-feature-flag-web Provider for OpenFeature\n## About this provider\n[GO Feature Flag](https://gofeatureflag.org) provider allows you to connect to your GO Feature Flag instance with the `@openfeature/web-sdk`.\n\nThe main difference between this provider and [`@openfeature/go-feature-flag-provider`](https://www.npmjs.com/package/@openfeature/go-feature-flag-provider) is that it uses a **static evaluation context**.  \nThis provider is more sustainable for client-side implementation.\n\nIf you want to know more about this pattern, I encourage you to read this [blog post](https://openfeature.dev/blog/catering-to-the-client-side/).\n\n## What is GO Feature Flag?\nGO Feature Flag is a simple, complete and lightweight self-hosted feature flag solution 100% Open Source.  \nOur focus is to avoid any complex infrastructure work to use GO Feature Flag.\n\nThis is a complete feature flagging solution with the possibility to target only a group of users, use any types of flags, store your configuration in various location and advanced rollout functionality. You can also collect usage data of your flags and be notified of configuration changes.\n\n## Install the provider\n\n```shell\nnpm install @openfeature/go-feature-flag-web-provider @openfeature/web-sdk\n```\n\n## How to use the provider?\n```typescript\nconst evaluationCtx: EvaluationContext = {\n  targetingKey: 'user-key',\n  email: 'john.doe@gofeatureflag.org',\n  name: 'John Doe',\n};\n\nconst goFeatureFlagWebProvider = new GoFeatureFlagWebProvider({\n  endpoint: endpoint,\n  // ...\n}, logger);\n\nawait OpenFeature.setContext(evaluationCtx); // Set the static context for OpenFeature\nOpenFeature.setProvider(goFeatureFlagWebProvider); // Attach the provider to OpenFeature\nconst client = await OpenFeature.getClient();\n\n// You can now use the client to use your flags\nif(client.getBooleanValue('my-new-feature', false)){\n    //...\n}\n\n// You can add handlers to know what happen in the provider\nclient.addHandler(ProviderEvents.Ready, () => { ... });\nclient.addHandler(ProviderEvents.Error, () => { //... });\nclient.addHandler(ProviderEvents.Stale, () => { //... });\nclient.addHandler(ProviderEvents.ConfigurationChanged, () => { //... });\n```\n\n### Available options\n| Option name                   | Type   | Default        | Description                                                                                                                                                                                     |\n|-------------------------------|--------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| endpoint                      | string |                | endpoint is the URL where your GO Feature Flag server is located.                                                                                                                               |\n| apiTimeout                    | number | 0 = no timeout | (optional) timeout is the time in millisecond we wait for an answer from the server.                                                                                                            |\n| apiKey                        | string |                | (optional) If GO Feature Flag is configured to authenticate the requests, you should provide an API Key to the provider. Please ask the administrator of the relay proxy to provide an API Key. |\n| websocketRetryInitialDelay    | number | 100            | (optional) initial delay in millisecond to wait before retrying to connect the websocket                                                                                                        |\n| websocketRetryDelayMultiplier | number | 2              | (optional) multiplier of websocketRetryInitialDelay after each failure _(example: 1st connection retry will be after 100ms, second after 200ms, third after 400ms ...)_                         |\n| websocketMaxRetries           | number | 10             | (optional) maximum number of retries before considering the websocket unreachable                                                                                                               |\n\n### Reconnection\nIf the connection to the GO Feature Flag instance fails, the provider will attempt to reconnect with an exponential back-off.   \nThe `websocketMaxRetries` can be specified to customize reconnect behavior.\n\n### Event streaming\nThe `GoFeatureFlagWebProvider` receives events from GO Feature Flag with changes.\nCombined with the event API in the web SDK, this allows for subscription to flag value changes in clients.\n\n```typescript\nclient.addHandler(ProviderEvents.ConfigurationChanged, (ctx: EventDetails) => {\n  // do something when the configuration has changed.\n  // ctx.flagsChanged contains the list of changed flags.\n});\n```\n\n## Contribute\n\n### Building\nRun `nx package providers-go-feature-flag-web` to build the library.\n\n### Running unit tests\nRun `nx test providers-go-feature-flag-web` to execute the unit tests via [Jest](https://jestjs.io).\n","readmeFilename":"README.md"}