server SDK
Java feature flags
The Java SDK docs publish Maven and Gradle coordinates for io.featureflow:featureflow-java-sdk version 1.4.2. Build one FeatureflowClient and reuse it. In Spring, declare it as a @Bean. The key is a server environment key, sdk-srv-env-….
Java docsGitHubio.featureflow:featureflow-java-sdk
Set it up with your coding agent
Paste this into Claude Code, Cursor or any coding agent. It installs the Java SDK, creates the client and evaluates your first flag.
Set up Featureflow with the Java SDK in this project. Run `npx skills add featureflow/featureflow-skills --skill featureflow-setup -y` first, then follow the skill. Keep SDK keys in env vars.
Or set it up by hand
Install
<dependency>
<groupId>io.featureflow</groupId>
<artifactId>featureflow-java-sdk</artifactId>
<version>1.4.2</version>
</dependency>implementation 'io.featureflow:featureflow-java-sdk:1.4.2'Initialise
String apiKey = "sdk-srv-env-YOUR_API_KEY";
FeatureflowClient featureflow = FeatureflowClient.builder(apiKey).build();Evaluate a flag
FeatureflowUser user = new FeatureflowUser("unique-user-id")
.withAttribute("tier", "silver")
.withStringAttributes("user_role", Arrays.asList("admin", "beta_tester"));
if (featureflow.evaluate("my-feature-key", user).isOn()) {
// enabled
}Kill switch
Branch on evaluate("my-feature-key", user).isOn() or isOff(). Register known features with withFeatures if you want them in the dashboard before anyone flips them. withUpdateCallback runs when a control changes.
The operational side is the kill switch. Turning the flag off does not require a redeploy.
Gradual rollout
Percentage rollouts are configured on the flag. Pass a stable user id so the same person stays in the same bucket. evaluate(key, user).is(value) matches a named variant. value() returns the variant key.
See progressive rollout for the dashboard control. Release pipelines and approval workflows, if the change itself needs a review, are on the Business plan at $399 a month. That price is on the pricing page.
Targeting
withAttribute accepts String, Number, boolean or DateTime. withStringAttributes, withNumberAttributes and withDateAttributes accept a list, and a rule may match any value in the list. withUserProvider supplies the current user in Spring. Set saveUser(false) on the user if you do not want attributes stored. jsonValue() needs version 1.3.1 or later and returns a Gson JsonElement, or null.
Frequently asked questions
What is the Maven artifact?
io.featureflow:featureflow-java-sdk. The Java SDK docs show version 1.4.2. The repository is github.com/featureflow/featureflow-java-sdk.
How many clients should I create?
One per process. The docs say the client is a singleton. In Spring, expose it as a @Bean.
Which API key does Java use?
A server environment API key starting with sdk-srv-env-, from the environment page. Do not ship it in a client application.