Integrates FeatBit JavaScript Client SDK in browser applications with OpenFeature standard support. Use when working with client-side feature flags, browser-based feature toggles, or when user asks about "JavaScript SDK", "JS client SDK", "browser feature flags", "OpenFeature", "OpenFeature provider".
View on GitHubFebruary 3, 2026
Select agents to install to:
npx add-skill https://github.com/featbit/featbit-skills/blob/main/skills/featbit-javascript-client-sdk/SKILL.md -a claude-code --skill featbit-javascript-client-sdkInstallation paths:
.claude/skills/featbit-javascript-client-sdk/# FeatBit JavaScript Client SDK
Integration guide for FeatBit JavaScript Client SDK in web browsers.
> **📖 Complete Documentation**: [GitHub Repository](https://github.com/featbit/featbit-js-client-sdk)
> If this skill doesn't cover your needs, refer to the full SDK documentation above.
⚠️ **Client-Side SDK Only**: For single-user browser environments. Use `@featbit/node-server-sdk` for Node.js server applications.
## Installation & Setup
```bash
npm install --save @featbit/js-client-sdk
```
**Prerequisites**:
- SDK Key: [How to get](https://docs.featbit.co/sdk/faq#how-to-get-the-environment-secret)
- SDK URLs: [How to get](https://docs.featbit.co/sdk/faq#how-to-get-the-sdk-urls)
## Quick Start
```javascript
import { FbClientBuilder, UserBuilder } from "@featbit/js-client-sdk";
// 1. Build user context
const user = new UserBuilder('user-unique-key')
.name('bob')
.custom('age', '18')
.custom('country', 'FR')
.build();
// 2. Initialize client (WebSocket streaming)
const fbClient = new FbClientBuilder()
.sdkKey("your_sdk_key")
.streamingUri('ws://localhost:5100')
.eventsUri("http://localhost:5100")
.user(user)
.build();
// 3. Wait for initialization & evaluate
(async () => {
try {
await fbClient.waitForInitialization();
const isEnabled = await fbClient.boolVariation("game-runner", false);
console.log(`Feature enabled: ${isEnabled}`);
} catch(err) {
console.error("SDK initialization failed:", err);
}
})();
```
## Core Concepts
### 1. User Context (IUser)
Build users with `UserBuilder`:
```javascript
const user = new UserBuilder('user-key') // Required: unique key
.name('Alice') // Optional: display name
.custom('role', 'admin') // Optional: custom properties
.custom('subscription', 'premium')
.build();
```
**Key Requirements**:
- `key` is mandatory and must uniquely identify each user
- Custom properties are used for targeting rules
- Propert