Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

featbit-javascript-client-sdk

verified

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 GitHub

Marketplace

featbit-marketplace

featbit/featbit-skills

Plugin

featbit-skills

Development Tools

Repository

featbit/featbit-skills
5stars

skills/featbit-javascript-client-sdk/SKILL.md

Last Verified

February 3, 2026

Install Skill

Select agents to install to:

Scope:
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-sdk

Installation paths:

Claude
.claude/skills/featbit-javascript-client-sdk/
Powered by add-skill CLI

Instructions

# 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

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
7034 chars