skills/featbit-sdks-java/SKILL.md
Expert guidance for integrating FeatBit Java Server SDK. Use when user asks about "Java SDK", "Java feature flags", "FeatBit Java", "Maven feature flags", or mentions .java or build.gradle files with FeatBit. Do not use for .NET, Go, Node.js, Python, or JavaScript questions.
npx skillsauth add featbit/featbit-skills featbit-sdks-javaInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use for server-side Java applications — Spring Boot, Jakarta EE, standalone services — that need real-time feature flag evaluation. Requires Java SE 8 or above.
Why server-side SDK: maintains one persistent WebSocket connection, synchronizes all flag data locally in under 100 ms, then evaluates every flag locally in under 10 ms per call on average. Do not use for Android or client-side JavaScript — those require a client-side SDK.
https://github.com/featbit/featbit-java-sdk
Copy and track progress:
FBConfig and create the clientFBUser and evaluate the first feature flagStep 1: Add the dependency
Use one build tool:
<dependency>
<groupId>co.featbit</groupId>
<artifactId>featbit-java-sdk</artifactId>
<version>1.4.5</version>
</dependency>
implementation 'co.featbit:featbit-java-sdk:1.4.5'
Step 2: Create the client
Use this minimal setup:
FBConfig config = new FBConfig.Builder()
.streamingURL("ws://localhost:5100")
.eventURL("http://localhost:5100")
.build();
FBClient client = new FBClientImp("<your-env-secret>", config);
Step 3: Evaluate the first feature flag
Use the official pattern:
FBUser user = new FBUser.Builder("<unique-user-key>").userName("Jane").build();
// Flag value only
Boolean flagValue = client.boolVariation("flag-key", user, false);
System.out.printf("flag returns %b for user %s%n", flagValue, user.getUserName());
// Flag value with evaluation detail
EvalDetail<Boolean> ed = client.boolVariationDetail("flag-key", user, false);
System.out.printf("flag returns %b, reason: %s%n", ed.getVariation(), ed.getReason());
Step 4: Validate the integration
If client.isInitialized() is false or evaluation returns the fallback unexpectedly, verify the secret and both URLs, then retry. Call client.close() during shutdown.
After the client is initialized, evaluate a feature flag with a user and a fallback value:
FBUser user = new FBUser.Builder("<unique-user-key>").userName("Jane").build();
// Value only
Boolean value = client.boolVariation("flag-key", user, false);
// Value with evaluation detail
EvalDetail<Boolean> detail = client.boolVariationDetail("flag-key", user, false);
System.out.printf("returns %b, reason: %s%n", detail.getVariation(), detail.getReason());
Use boolVariation when only the flag value is needed. Use boolVariationDetail when the evaluation reason is also needed — detail.getReason() explains why the variation was returned.
Also available for non-boolean flags: variation/variationDetail (string), intVariation/intVariationDetail, longVariation/longVariationDetail, doubleVariation/doubleVariationDetail, jsonVariation/jsonVariationDetail.
Add custom properties to FBUser when targeting rules depend on user attributes beyond key and userName:
FBUser user = new FBUser.Builder("a-unique-key-of-user")
.userName("bob")
.custom("age", "15")
.custom("country", "FR")
.build();
Use .custom(key, value) for any attribute that must be referenced in feature flag targeting rules.
getAllLatestFlagsVariations to get all flags for a user at once.tools
Expert guidance for integrating FeatBit JavaScript Client SDK in browser environments. Use when user asks about "JavaScript client SDK", "browser feature flags", "FeatBit JS", "vanilla JS SDK", or mentions browser-side HTML/JS with FeatBit. Do not use for Node.js server-side, React, React Native, .NET, Python, Java, or Go questions.
development
Expert guidance for integrating FeatBit Go Server SDK. Use when user asks about "Go SDK", "Golang feature flags", "FeatBit Go", or mentions .go files with FeatBit. Do not use for Node.js, Python, Java, .NET, or JavaScript questions.
tools
Expert guidance for integrating FeatBit .NET Server SDK into C# and ASP.NET Core applications. Use when user asks about ".NET SDK", "C# feature flags", "ASP.NET Core FeatBit", "dotnet feature flags", or mentions .cs or .csproj files. Do not use for Node.js, Python, Java, Go, or client-side JavaScript questions.
development
Expert guidance for using the FeatBit REST API to manage projects, environments, and feature flags programmatically. Use when user asks about "FeatBit API", "REST API", "create project API", "create environment API", "create feature flag API", "API authentication", "OpenAPI key", or needs to automate FeatBit operations via HTTP endpoints. Do not use for SDK integration, deployment configuration, or flag evaluation questions.