skills/featbit-sdks-javascript/SKILL.md
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.
npx skillsauth add featbit/featbit-skills featbit-sdks-javascriptInstall 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 browser-based JavaScript and TypeScript applications that evaluate feature flags client-side — vanilla JS apps, SPAs, or any non-React framework. For React, use featbit-sdks-react instead.
Why client-side SDK: designed for single-user browser contexts, stores flag data in localStorage, and syncs via WebSocket streaming or HTTP polling. Do not use for Node.js server-side applications — those require featbit-sdks-node.
https://github.com/featbit/featbit-js-client-sdk
Copy and track progress:
Step 1: Install the package
Run:
npm install --save @featbit/js-client-sdk
Step 2: Build the browser client
Use this minimal setup:
import { FbClientBuilder, UserBuilder } from "@featbit/js-client-sdk";
const user = new UserBuilder('<unique-user-key>').name('Jane').build();
const fbClient = new FbClientBuilder()
.sdkKey('<your-env-secret>')
.streamingUri('ws://localhost:5100')
.eventsUri('http://localhost:5100')
.user(user)
.build();
Step 3: Evaluate the first feature flag
Use the official pattern:
await fbClient.waitForInitialization();
const boolVariation = await fbClient.boolVariation('flag-key', false);
If initialization does not complete or the first value is the fallback unexpectedly, verify sdkKey, streamingUri, eventsUri, and the initial user, then retry.
After the client is ready, evaluate a feature flag with a fallback value:
const flagKey = "game-runner";
// value only
const boolVariation = await fbClient.boolVariation(flagKey, false);
// value with evaluation detail
const boolVariationDetail = await fbClient.boolVariationDetail(flagKey, false);
All variation calls return a Promise — always use await. Use boolVariation when only the flag value is needed. Use boolVariationDetail when the evaluation reason is also needed.
Also available: stringVariation/stringVariationDetail, numberVariation/numberVariationDetail, jsonVariation/jsonVariationDetail.
Add custom properties to a user when targeting rules depend on attributes beyond key and name:
import { UserBuilder } from "@featbit/js-client-sdk";
const user = new UserBuilder('a-unique-key-of-user')
.name('bob')
.custom('age', 18)
.custom('country', 'FR')
.build();
Use .custom(key, value) for any attribute that must be referenced in feature flag targeting rules. Values can be strings or numbers.
To use FeatBit with the OpenFeature standard, install three packages:
npm install @openfeature/web-sdk featbit-js-client-sdk @featbit/openfeature-provider-js-client
See the openfeature-provider-js-client repository for usage examples.
stringVariation, numberVariation, jsonVariation).development
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.
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.