OpenFeature Provider for Web SDK
Integrate OpenFeature with Harness FME in your web applications to evaluate feature flags, manage contexts, and track events using a standardized SDK.
Integrate your web applications with Harness FME using the Web OpenFeature Provider, a standardized, vendor-agnostic feature flagging API. This provider implements the OpenFeature specification and bridges the OpenFeature SDK with the Harness FME Browser SDK.
This page walks you through installing, configuring, and using the Web OpenFeature provider to evaluate feature flags in your web applications.
Before you begin
Before you begin, ensure you have the following:
A valid Harness FME SDK key for your project
A modern browser environment that supports ES6 modules
Access to
npmoryarnto install dependencies
Version compatibility
Browser SDK (@splitsoftware/splitio-browserjs)
≥ 1.0.0
@splitsoftware/openfeature-web-split-provider
≥ 1.0.0
OpenFeature Web SDK
≥ 1.0.0
Install the provider and dependencies
Install the Harness FME OpenFeature provider and required peer dependencies:
npm install @splitsoftware/openfeature-web-split-provider
npm install @splitsoftware/splitio-browserjs
npm install @openfeature/web-sdkInitialize the provider
Register the Harness FME OpenFeature provider by using a SplitFactory instance.
For example:
Construct an evaluation context
Provide an evaluation context with a targeting key to evaluate flags. The evaluation context passes targeting information such as user IDs, email addresses, or plan types for flag targeting.
For example:
Evaluate with details
Use the get*Details(...) APIs to get flag values and metadata (such as variant, reason, error code, and configuration). The FME treatment configuration is returned as a raw JSON string under flagMetadata["config"].
For example:
Evaluate with attributes
To include user or session attributes in flag evaluations, define them in the evaluation context before calling the evaluation methods.
For example:
Track events
The Harness FME OpenFeature provider supports tracking user actions or conversion events directly from your web application.
To enable event tracking, your evaluation context must include the following:
A non-empty
targetingKeyA
trafficType(for example,"user"or"account")A non-blank event name
Optionally, you can include a numeric value (defaults to 0) and additional event properties (prefers primitives such as string, number, boolean, or null). For more information, see Sending Events.
For example:
For more information, go to the Harness FME Web OpenFeature Provider GitHub repository.
Last updated
Was this helpful?