Skip to main content
Version: 2.0.0

Quick Start - Server

Get Featureflow integrated into your server application in minutes.

1. Install the SDK

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

2. Initialize the Client

important

The Featureflow client must be a singleton. Do not create a new instance on every request — this causes unnecessary reloads and degrades performance.

The client maintains an optimised cache of your feature rules and receives real-time updates.

FeatureflowClient client = new FeatureflowClient.Builder("srv-env-YOUR_API_KEY")
.withFeatures(Arrays.asList(
new Feature("logout-button", Variant.off),
new Feature("example-feature", Variant.off)
))
.build();

// In Spring, declare this in a @Configuration class
// Tip: Use an enum for feature keys to track them in your IDE

Your Server Environment API Key is available on the Projects page in Featureflow.

Why Register Features?

Registering features at startup provides several benefits:

  • Features appear in the dashboard immediately
  • You can set a custom failover variant (default is off)
  • Creates a central reference of all deployed features

3. Evaluate Features

// Simple evaluation
if (featureflowClient.evaluate("example-feature").isOn()) {
// Feature is enabled
}

// With user targeting
FeatureflowUser user = new FeatureflowUser("user-123")
.withAttribute("tier", "silver")
.withAttribute("age", 32)
.withAttribute("signup_date", new DateTime(2017, 1, 1, 12, 0, 0, 0));

if (featureflowClient.evaluate("example-feature", user).isOn()) {
// Feature is enabled for this user
}

Pass a user object with attributes to enable targeting rules. Without a user, evaluations are treated as anonymous.

4. Test Your Integration

Start your application and check the Featureflow dashboard — your registered features will appear automatically.

Congratulations! You're now using Featureflow.

Creating Features in the Dashboard

You can also create features directly in the UI. Click + New Feature and enter a name and key:

Create Feature

Feature Lifecycle Status

New features show a "Created" status until detected in your application. Once you evaluate the feature, the status updates to show it's active:

Status Icon

The feature detail view shows the status across all environments with quick toggles:

Status Detail

Next Steps