- 
                Notifications
    You must be signed in to change notification settings 
- Fork 203
FMEPRD-282 Add OpenFeature Documentation and Release Notes #11760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            10 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      fd104aa
              
                FMEPRD-282
              
              
                alai97 23272cd
              
                Add Traffic Types Doc Link
              
              
                alai97 1d10fa9
              
                Wording Nit
              
              
                alai97 6b0e40f
              
                SME Review
              
              
                alai97 42983f3
              
                Merge branch 'main' into add-openfeature-sdk-section
              
              
                alai97 710d1ca
              
                SME Review
              
              
                alai97 d128211
              
                SME Review
              
              
                alai97 52bf823
              
                Consistency Nit
              
              
                alai97 81d456b
              
                Bump Version
              
              
                alai97 04e6ccd
              
                Bump Release Date
              
              
                alai97 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
        
          
  
    
      
          
            194 changes: 194 additions & 0 deletions
          
          194 
        
  ...anagement-experimentation/20-sdks-and-infrastructure/openfeature/android-sdk.md
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,194 @@ | ||
| --- | ||
| title: OpenFeature Provider for Android SDK | ||
| sidebar_label: Android OpenFeature Provider | ||
| sidebar_position: 1 | ||
| description: Integrate OpenFeature with Harness FME in your Android applications to evaluate feature flags, manage contexts, and track events using a standardized SDK. | ||
| --- | ||
|  | ||
| Integrate your Android applications with Harness FME using the <Tooltip id="fme.openfeature.provider">Android OpenFeature Provider</Tooltip>, a standardized, vendor-agnostic feature flagging API. This provider implements the OpenFeature specification and bridges the OpenFeature SDK with the Harness FME Android SDK. | ||
|  | ||
| This page walks you through installing, configuring, and using the Android OpenFeature provider to evaluate <Tooltip id="fme.openfeature.feature-flag">feature flags</Tooltip> in your Android applications. | ||
|  | ||
| ### Prerequisites | ||
|  | ||
| Before you begin, ensure you have the following: | ||
|  | ||
| - A valid [Harness FME SDK key](/docs/feature-management-experimentation/sdks-and-infrastructure/#api-keys) for your project | ||
| - An Android project targeting API Level 21 (Android 5.0 Lollipop) or later | ||
| - Access to your project's `build.gradle` or `build.gradle.kts` file to add the provider dependency | ||
|  | ||
| ### Version compatibility | ||
|  | ||
| | Component | Minimum Version | | ||
| | --------------------------------- | ----------------------------------- | | ||
| | Android | API Level 21 (Android 5.0 Lollipop) | | ||
| | `@splitsoftware/split-openfeature-provider-android` | ≥ 1.0.0 | | ||
| | OpenFeature Kotlin SDK | ≥ 0.7.0 | | ||
|  | ||
| ## Install the provider and dependencies | ||
|  | ||
| Add the Harness FME OpenFeature provider dependency to your application's `build.gradle.kts` file. | ||
|  | ||
| ```kotlin | ||
| dependencies { | ||
| implementation("io.split.openfeature:split-openfeature-android:1.0.0") | ||
| } | ||
| ``` | ||
|  | ||
| Or, if you're using the Groovy DSL (`build.gradle`): | ||
|  | ||
| ```groovy | ||
| dependencies { | ||
| implementation 'io.split.openfeature:split-openfeature-android:1.0.0' | ||
| } | ||
| ``` | ||
|  | ||
| ## Initialize the provider | ||
|  | ||
| The Harness FME OpenFeature provider requires an Android application `Context` (for SDK initialization) and your Harness FME SDK Key. | ||
|  | ||
| ```kotlin | ||
| import dev.openfeature.kotlin.sdk.OpenFeatureAPI | ||
| import dev.openfeature.kotlin.sdk.ImmutableContext | ||
| import io.split.openfeature.android.provider.SplitProvider | ||
|  | ||
| // Create provider configuration | ||
| val config = SplitProvider.Config( | ||
| applicationContext = applicationContext, | ||
| sdkKey = "YOUR_SDK_KEY" | ||
| ) | ||
|  | ||
| // Create the FME provider | ||
| val provider = SplitProvider(config = config) | ||
|  | ||
| // Set the provider with an initial context containing a targeting key | ||
| val initialContext = ImmutableContext(targetingKey = "user-123") | ||
| OpenFeatureAPI.setProvider(provider, initialContext = initialContext) | ||
|  | ||
| // Get a client and evaluate flags | ||
| val client = OpenFeatureAPI.getClient() | ||
| val showNewFeature = client.getBooleanValue("new-feature", false) | ||
| ``` | ||
|  | ||
| ## Construct an evaluation context | ||
|  | ||
| Provide an <Tooltip id="fme.openfeature.evaluation-context">evaluation context</Tooltip> with a <Tooltip id="fme.openfeature.targeting-key">targeting key</Tooltip> to evaluate flags. The evaluation context passes targeting information such as user IDs, email addresses, or plan types for flag targeting. | ||
|  | ||
| For example: | ||
|  | ||
| ```kotlin | ||
| val context = ImmutableContext( | ||
| targetingKey = "user-123", | ||
| attributes = mapOf( | ||
| "email" to Value.String("[email protected]"), | ||
| "age" to Value.Integer(30), | ||
| "plan" to Value.String("premium") | ||
| ) | ||
| ) | ||
|  | ||
| val client = OpenFeatureAPI.getClient() | ||
| val result = client.getBooleanDetails("premium-feature", false, context) | ||
| ``` | ||
|  | ||
| To set a targeting key during initialization: | ||
|  | ||
| ```kotlin | ||
| val initialContext = ImmutableContext(targetingKey = "user-123") | ||
| OpenFeatureAPI.setProvider(provider, initialContext = initialContext) | ||
| ``` | ||
|  | ||
| To change a targeting key at runtime: | ||
|  | ||
| ```kotlin | ||
| val newContext = ImmutableContext(targetingKey = "user-456") | ||
| OpenFeatureAPI.setEvaluationContext(newContext) | ||
| ``` | ||
|  | ||
| ## Observe provider events | ||
|  | ||
| The Harness FME OpenFeature provider emits <Tooltip id="fme.openfeature.events">events</Tooltip> when provider state changes (for example, when flags update, configuration changes, or errors) occur. You can observe these events to update your application's behavior in real time. | ||
|  | ||
| You can enable your application to: | ||
|  | ||
| - Refresh feature-dependent UI when flags change | ||
| - Gracefully handle degraded states (i.e., when the provider becomes stale) | ||
| - Log or alert on configuration or network issues | ||
| - Control initialization flows based on provider readiness | ||
|  | ||
| For example: | ||
|  | ||
| ```kotlin | ||
| import dev.openfeature.kotlin.sdk.events.OpenFeatureProviderEvents | ||
| import kotlinx.coroutines.launch | ||
|  | ||
| // Observe provider events | ||
| lifecycleScope.launch { | ||
| provider.observe().collect { event -> | ||
| when (event) { | ||
| is OpenFeatureProviderEvents.ProviderReady -> { | ||
| // Provider is ready to evaluate flags | ||
| Log.d("Split", "Provider is ready") | ||
| } | ||
| is OpenFeatureProviderEvents.ProviderConfigurationChanged -> { | ||
| // Flag configuration has been updated | ||
| Log.d("Split", "Configuration changed") | ||
| } | ||
| is OpenFeatureProviderEvents.ProviderStale -> { | ||
| // Provider is serving cached data | ||
| Log.d("Split", "Provider is stale") | ||
| } | ||
| is OpenFeatureProviderEvents.ProviderError -> { | ||
| // An error occurred | ||
| Log.e("Split", "Provider error: ${event.error}") | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|  | ||
| ## Track events | ||
|  | ||
| The Harness FME OpenFeature provider supports tracking user actions or conversion <Tooltip id="fme.openfeature.events">events</Tooltip> directly from your Android application. | ||
|  | ||
| To enable event tracking, your evaluation context must include the following: | ||
|  | ||
| - A non-empty `targetingKey` | ||
| - A [`TrafficType`](/docs/feature-management-experimentation/management-and-administration/fme-settings/traffic-types/) (for example, `"user"` or `"account"`) | ||
| - A non-blank event name | ||
|  | ||
| Optionally, you can include: | ||
|  | ||
| 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](/docs/feature-management-experimentation/api/events/#event-record-fields). | ||
|  | ||
| ```kotlin | ||
| // Set context with trafficType | ||
| val context = ImmutableContext(targetingKey = "user-123") | ||
| .withTrafficType("user") | ||
|  | ||
| OpenFeatureAPI.setEvaluationContext(context) | ||
|  | ||
| // Track an event | ||
| val client = OpenFeatureAPI.getClient() | ||
| client.track("button_clicked") | ||
|  | ||
| // Track with a value | ||
| client.track( | ||
| "purchase_completed", | ||
| TrackingEventDetails(value = 99.99) | ||
| ) | ||
|  | ||
| // Track with properties | ||
| client.track( | ||
| "page_viewed", | ||
| TrackingEventDetails( | ||
| structure = ImmutableStructure( | ||
| mapOf( | ||
| "page" to Value.String("home"), | ||
| "referrer" to Value.String("google") | ||
| ) | ||
| ) | ||
| ) | ||
| ) | ||
| ``` | ||
|  | ||
| For more information, go to the [Harness FME Android OpenFeature Provider GitHub repository](https://github.com/splitio/split-openfeature-provider-android/). | 
        
          
  
    
      
          
            64 changes: 64 additions & 0 deletions
          
          64 
        
  ...ture-management-experimentation/20-sdks-and-infrastructure/openfeature/index.md
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| title: OpenFeature Providers | ||
| id: index | ||
| slug: /feature-management-experimentation/sdks-and-infrastructure/openfeature | ||
| sidebar_position: 1 | ||
| description: Learn about using Harness OpenFeature providers for feature management. | ||
| --- | ||
|  | ||
| [OpenFeature](https://openfeature.dev/docs/reference/intro) offers a standardized, vendor-agnostic SDK for feature flagging that can integrate with a variety of third-party providers. Whether you're using an open-source or commercial solution, self-hosted or cloud-hosted, OpenFeature gives developers a unified API for consistent feature flag evaluation. | ||
|  | ||
| OpenFeature SDKs provide flexible abstractions that make it easy to integrate feature flags into any application. Within your application, the feature flagging client uses the OpenFeature SDK to evaluate <Tooltip id="fme.openfeature.feature-flag">feature flags</Tooltip> through the <Tooltip id="fme.openfeature.evaluation-api">Evaluation API</Tooltip>. | ||
|  | ||
| Each flag evaluation passes an <Tooltip id="fme.openfeature.evaluation-context">evaluation context</Tooltip>, which provides relevant data about the application or user. | ||
|  | ||
| ```mermaid | ||
| flowchart LR | ||
| %% Outer app box | ||
| subgraph YourApp["Your App"] | ||
| style YourApp fill:#D0E4FF,stroke:#0000FF,stroke-width:2px | ||
|  | ||
| %% Feature Flagging Client (yellow dotted box) | ||
| subgraph FeatureFlagClient["Feature Flagging Client"] | ||
| style FeatureFlagClient stroke:#FFD700,stroke-dasharray: 5 5 | ||
|  | ||
| %% Puzzle piece: OpenFeature SDK | ||
| subgraph OpenFeatureSDK["OpenFeature SDK"] | ||
| style OpenFeatureSDK fill:#FFFF99,stroke:#FFD700 | ||
|  | ||
| %% Flag Evaluation API inside SDK | ||
| FlagEvalAPI["Flag Evaluation API"] | ||
| end | ||
|  | ||
| %% OpenFeature Provider in second half of puzzle piece | ||
| OpenFeatureProvider["Harness FME <br> OpenFeature Provider"] | ||
| end | ||
|  | ||
| %% Arrows from Flag Eval through Eval Context directly into FlagEvalAPI | ||
| FlagEval1["Flag Eval"] --> EvalCtx1["Eval Context"] --> FlagEvalAPI | ||
| FlagEval2["Flag Eval"] --> EvalCtx2["Eval Context"] --> FlagEvalAPI | ||
| end | ||
|  | ||
| %% External Harness FME Service in cloud | ||
| HarnessFME["Harness FME Service"]:::cloudStyle | ||
|  | ||
| %% Bidirectional arrow between OpenFeature Provider and Harness FME | ||
| OpenFeatureProvider <--> HarnessFME | ||
|  | ||
| %% Styling for cloud | ||
| classDef cloudStyle fill:#A4E5A4,stroke:#2E8B57,stroke-width:2px,shape:cloud | ||
| ``` | ||
|  | ||
| <br /> | ||
|  | ||
| The <Tooltip id="fme.openfeature.provider">OpenFeature Provider</Tooltip> wraps the Harness FME SDK, bridging the OpenFeature SDK with the Harness Feature Management & Experimentation (FME) service. The provider maps OpenFeature's standardized interface to the FME SDK, which handles communication with Harness services to evaluate feature flags and retrieve configuration updates. | ||
|  | ||
| ## Use OpenFeature SDKs | ||
|  | ||
| Harness FME offers official OpenFeature providers for the following SDKs. | ||
|  | ||
| import { Section, openfeatureSDKs } from '@site/src/components/Docs/data/fmeOpenfeature'; | ||
|         
                  alai97 marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
|  | ||
| <Section items={openfeatureSDKs} /> | ||
|  | ||
| You can use these providers instead of the Harness FME SDK in your application. | ||
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.