Java SDK

Get your Featureflow account at featureflow.io

Get Started

The easiest way to get started is to follow the Featureflow quick start guides

Change Log

Please see CHANGELOG.

Installation

Using Maven

<dependency>
    <groupId>io.featureflow</groupId>
    <artifactId>featureflow-java-sdk</artifactId>
    <version>1.0.1</version>
</dependency>

Usage

Quick start

Get your 'Server Environment Api Key' from the environment page in featureflow and instantiate a singleton client:

String apiKey = "<Your Server Environment Api Key goes here>";
FeatureFlowClient featureFlowClient = new FeatureFlowClient(apiKey);

This is a singleton, so if you're using spring you should make it a @Bean in a @Configuration class.

In your code, you can test the value of your feature where the value of my-feature-key is equal to 'on'

  if (featureflow.evaluate('my-feature-key').is('on')){
    // this feature code will be run because 'my-feature-key' is set to 'on'
  }

Because the default variants for any feature are 'on' and 'off', we have provided two helper methods .isOn() and .isOff()


if(featureflow.evaluate('my-feature-key', context).isOn()){
  // this feature code will be run because 'my-feature-key' is set to 'on'
}

if(featureflow.evaluate('my-feature-key').isOff()){
  // this feature code won't be run because 'my-feature-key' is not set to 'off'
}

For full API details please see

https://github.com/featureflow/featureflow-java-sdk/blob/master/README.md

Roadmap

  • Write documentation
  • Release to sonatype snapshot
  • Release to sonatype releases

License

Apache-2.0