open-index/open-npm huggingface dataset:
npm package: @flagcontrol/node
Description: The Node.js SDK for Flagcontrol.
Latest version: 0.2.2

# @flagcontrol/node

The Node.js SDK for Flagcontrol.

## Installation

```bash
npm install @flagcontrol/node
```

## Usage

### 1. Initialize the client

```typescript
import { createFlagControlClient } from '@flagcontrol/node';

const client = createFlagControlClient({
  sdkKey: 'YOUR_SDK_KEY',
});
```

### 2. Evaluate flags

```typescript
// Check if a feature is enabled
const isEnabled = client.isEnabled('new-feature', { userId: 'user-123' });

if (isEnabled) {
  console.log('New feature enabled');
}

// Get flag value with fallback
const value = client.get('config-flag', { userId: 'user-123' }, 'default-value');
```
npm package: @flagcontrol/react
Description: The React SDK for Flagcontrol.
Latest version: 0.2.3

# @flagcontrol/react

The React SDK for Flagcontrol.

## Installation

```bash
npm install @flagcontrol/react
```

## Usage

### 1. Wrap your app with `FlagProvider`

```tsx
import { FlagProvider } from '@flagcontrol/react';

function App() {
  return (
    <FlagProvider
      config={{
        sdkKey: 'YOUR_SDK_KEY',
      }}
    >
      <YourComponent />
    </FlagProvider>
  );
}
```

### 2. Use flags in your components

```tsx
import { useFlag } from '@flagcontrol/react';

function YourComponent() {
  const isEnabled = useFlag('new-feature', false);

  if (isEnabled) {
    return <div>New Feature Enabled!</div>;
  }

  return <div>Old Feature</div>;
}
```
npm package: @flagdash/sdk
Description: FlagDash client SDK for feature flags, remote config, and AI configs
Latest version: 0.1.1

# @flagdash/sdk

The official FlagDash client SDK for JavaScript and TypeScript. Evaluate feature flags, fetch remote configs, and access AI config files from any JavaScript environment (browser, Node.js, edge runtimes).

## Installation

```bash
npm install @flagdash/sdk
# or
pnpm add @flagdash/sdk
# or
yarn add @flagdash/sdk
```

## Quick Start

```ts
import { FlagDash } from '@flagdash/sdk';

const client = FlagDash.init({
  sdkKey: 'client_pk_...',
  environment: 'production',
  baseUrl: 'https://your-flagdash-instance.com',
});

// Evaluate a feature flag
const enabled = await client.flag('new-checkout', undefined, false);

// Fetch a remote config
const pricing = await client.config<{ tier: string }>('pricing');

// Get an AI config file
const agent = await client.aiConfig('agent.md');
```

## Configuration

```ts
const client = FlagDash.init({
  sdkKey: 'client_pk_...', // Required
  environment: 'production', // Required
  baseUrl: 'https://...', // Your FlagDash instance URL
  refreshInterval: 30000, // Poll for updates (ms), 0 = disabled
  timeout: 5000, // Request timeout (ms)
});
```

## Feature Flags

```ts
// Simple boolean flag
const enabled = await client.flag('my-feature');

// With default value
const variant = await client.flag('experiment', undefined, 'control');

// With targeting context
const value = await client.flag('premium-feature', {
  user: { id: 'user_123', plan: 'pro' },
  country: 'US',
});

// All flags at once
const flags = await client.allFlags();
```

## Remote Config

```ts
const config = await client.config('api-settings', { timeout: 5000 });
```

## AI Configs

```ts
// Get a single AI config file
const agent = await client.aiConfig('agent.md');
if (agent) {
  console.log(agent.content); // Markdown content
  console.log(agent.file_type); // 'agent' | 'skill' | 'rule'
  console.log(agent.folder); // string | null
}

// With default content fallback
const skill = await client.aiConfig('missing.md', '# Default');

// List all AI configs
const configs = await client.listAiConfigs();

// Filter by type or folder
const skills = await client.listAiConfigs({ fileType: 'skill' });
const toolConfigs = await client.listAiConfigs({ folder: 'tools' });
```

## Events

```ts
client.on('ready', () => console.log('Client initialized'));
client.on('flags_updated', (flags) => console.log('Flags changed', flags));
client.on('ai_config_updated', () => console.log('AI configs changed'));
client.on('error', (err) => console.error('Error:', err));
```

## Cleanup

```ts
// Stop polling and remove all listeners
client.destroy();
```

## TypeScript

Full TypeScript support with exported types:

```ts
import type {
  FlagDashConfig,
  EvaluationContext,
  UserContext,
  FlagValues,
  AiConfig,
  AiConfigFileType,
  ListAiConfigsOptions,
} from '@flagdash/sdk';
```

## License

MIT
npm package: @flagfw/flag
Description: A web framework for the client side that can deploy spa (single-page-action) simply and quickly. Central console application.
Author: masato nakatsuji
Latest version: 1.0.1

# flag

A web framework for the client side that can deploy spa (single-page-action) simply and quickly. Central console application.

Various documents are available on the following pages.

[https://masatonakatsuji2021.github.io/flag/](https://masatonakatsuji2021.github.io/flag/)
npm package: @flagfw/front
Description: A web framework for the client side that can deploy spa (single-page-action) simply and quickly. Package for framework provision.
Author: masato nakatsuji
Latest version: 1.0.1

# Flag Front

A web framework that allows you to easily and quickly deploy SPAs (Single Page Actions) for web apps and WebView-based client applications.

[https://masatonakatsuji2021.github.io/flag/](https://masatonakatsuji2021.github.io/flag/)

- [Run from console](#1)
- [Creating a SPA project](#2)
- [Run the build](#3)

<div id="1"></div>

## # Run from console

First, install the npm package ``@flagfw/flag`` globally using the following command.

```
$ npm i -g @flagfw/flag
```

Then run the ``flag front`` command.

```
@ flag front
```
<div id="2"></div>

## # Creating a SPA project

Open a terminal from any directory and run the following command.
Creating a SPA project begins interactively.

```
@ flag front create
```

The questions to be asked are below :

|||
|:--|:--|
|**Project Name**|Project name to create.  When creating a project, a directory with the project name is created in the current directory and initial source files are prepared there.|
|**Frameworks**|Framework name to build. If not specified, the initial state "web" will be generated at build time and the build results will be output there.|
|**TypeScript Complie**|When this is set to "true", TypeScript will be transcompiled immediately before building.|
|**Source Compress**|When this is set to "true", the js file (index.min.js) after building will be generated in a compressed form.|
|***Source Obfuscate***|(2023.12.21 Currently not set.) If this is set to "true", the script code will be obfuscated.|

---

<div id="3"></div>

## # Run the build

To build the SPA project, run the following command in the terminal inside the project.

```
@ flag front build
```

When building, TypeScript ts file transcompiler and script file are merged, etc.

The built files are output in units of framework names specified in the ``frameworks`` directory within the project.
npm package: @flagged-dev/sdk
Description: TypeScript SDK for Flagged — Feature Flags for Indie Devs
Latest version: 0.1.1

# @flagged-dev/sdk

TypeScript SDK for [Flagged](https://flagged.pavegy.workers.dev) — Feature Flags for Indie Devs.

Zero dependencies. Works in browsers, Node.js 18+, and edge runtimes.

## Install

```bash
npm install @flagged-dev/sdk
```

## Quick Start

```typescript
import { Flagged } from "@flagged-dev/sdk";

const fg = new Flagged({
  apiKey: "fg_your_api_key",
  defaults: {
    new_checkout: false,
    dark_mode: true,
  },
});

await fg.init();

if (fg.isEnabled("new_checkout")) {
  // New feature code
}
```

## Options

```typescript
new Flagged({
  apiKey: string;               // Required
  defaults?: Record<string, boolean>;  // Fallback values
  pollInterval?: number;        // Default: 60000 (ms). 0 = no polling
  timeout?: number;             // Default: 3000 (ms)
  staleWhileRevalidate?: boolean;  // Default: true
  storageKey?: string | null;   // Default: "flagged". null = disable localStorage
  baseUrl?: string;             // Override API endpoint
});
```

## API

### Core

```typescript
fg.isEnabled(key: string): boolean   // Always returns boolean, never undefined
fg.getFlags(): Record<string, boolean>
```

### Events

```typescript
fg.on("change", (flags) => {
  console.log("Flags updated:", flags);
});

fg.on("error", (error) => {
  console.warn("Flagged fetch failed:", error);
});

fg.on("source", (source) => {
  // "api" | "memory" | "storage" | "defaults"
  console.log("Flags served from:", source);
});

fg.off("change", listener);  // Remove listener
```

### Lifecycle

```typescript
fg.stop();          // Stop polling
await fg.refresh(); // Manual one-shot fetch
fg.destroy();       // Stop + cleanup
```

## Fallback Strategy

Flagged is designed so your app never breaks, even if the API is down:

1. **Memory cache** — instant, always checked first
2. **localStorage** — survives page reloads (browser only)
3. **defaults** — your safety net, defined in code

## License

MIT
npm package: @flaggly/sdk
Description: Client SDK for Flaggly
Author: butttons
Latest version: 0.2.0

# @flaggly/sdk

Client SDK for [Flaggly](https://flaggly.dev) -- a self-hosted feature flag service on Cloudflare Workers.

## Install

```sh
pnpm i @flaggly/sdk
```

## Setup

Define your flag schema and create a client:

```ts
import { Flaggly } from '@flaggly/sdk';

type Flags = {
  'dark-mode': { type: 'boolean' };
  'banner': { type: 'payload'; result: { text: string; color: string } };
  'checkout': { type: 'variant'; result: string };
};

const flaggly = new Flaggly<Flags>({
  url: 'https://flaggly.example.workers.dev',
  apiKey: 'YOUR_USER_JWT',
});
```

Flags are evaluated immediately on creation. Pass `lazy: true` to defer until you call `identify()` or `fetchFlags()`.

## Usage

```ts
// Type-safe getters
const isDarkMode = flaggly.getBooleanFlag('dark-mode');
const banner = flaggly.getPayloadFlag('banner');
const checkout = flaggly.getVariantFlag('checkout');
```

### Identifying users

Call `identify()` when a user logs in. This re-evaluates all flags with the user context:

```ts
await flaggly.identify(userId, { email: user.email, tier: user.tier });
```

### React

```ts
import { Flaggly, FlagValue } from '@flaggly/sdk';
import { useSyncExternalStore } from 'react';

const flaggly = new Flaggly<Flags>({
  url: 'https://flaggly.example.workers.dev',
  apiKey: 'YOUR_USER_JWT',
  lazy: true,
  bootstrap: {
    'dark-mode': false,
  },
});

export const useFlags = () =>
  useSyncExternalStore(flaggly.store.subscribe, flaggly.store.get, flaggly.store.get);

export const useFlag = <K extends keyof Flags>(key: K): FlagValue<Flags[K]> => {
  const data = useFlags();
  return data?.[key].result as FlagValue<Flags[K]>;
};
```

### Cloudflare Workers (service binding)

```ts
const flaggly = new Flaggly<Flags>({
  url: 'https://flaggly.example.workers.dev',
  apiKey: 'YOUR_USER_JWT',
  lazy: true,
  workerFetch: (url, init) => env.FLAGGLY_SERVICE.fetch(url, init),
});
```

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `url` | `string` | -- | Base URL of your Flaggly worker |
| `apiKey` | `string` | -- | Public user JWT |
| `app` | `string` | `"default"` | App identifier |
| `env` | `string` | `"production"` | Environment identifier |
| `lazy` | `boolean` | `false` | Defer flag evaluation until manual call |
| `bootstrap` | `Partial<FlagValues>` | -- | Default values before first fetch |
| `workerFetch` | `typeof fetch` | `fetch` | Custom fetch for service bindings |
| `getBackupId` | `() => string` | -- | Custom anonymous user ID generator |
| `customStorage` | `CustomStorage` | `localStorage` | Storage for backup IDs |
| `getCurrentRoute` | `() => string \| null` | `window.location.href` | Route provider for non-browser envs |
| `getRandomId` | `() => string` | `crypto.randomUUID` | UUID generator for non-browser envs |

## Docs

Full documentation at [flaggly.dev](https://flaggly.dev).

## License

MIT
npm package: @flaggr/evaluator
Description: Standalone flag evaluator for Flaggr - zero dependencies, pure TypeScript
Latest version: 0.1.0

# @flaggr/evaluator

[![npm](https://img.shields.io/npm/v/@flaggr/evaluator)](https://www.npmjs.com/package/@flaggr/evaluator)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Standalone flag evaluation engine for [Flaggr](https://flaggr.dev). Zero dependencies, pure TypeScript.

Use this package for **local/edge evaluation** when you want to evaluate feature flags without making API calls. The evaluation rules are cached locally and evaluated in-process for sub-millisecond latency.

## Installation

```bash
npm install @flaggr/evaluator
```

## Usage

```typescript
import { evaluate } from '@flaggr/evaluator'

const result = evaluate({
  flag: {
    key: 'checkout-v2',
    type: 'boolean',
    enabled: true,
    defaultValue: false,
    targetingRules: [
      {
        conditions: [{ attribute: 'plan', operator: 'equals', value: 'enterprise' }],
        value: true,
      },
    ],
  },
  context: {
    targetingKey: 'user-123',
    plan: 'enterprise',
  },
})

console.log(result.value)  // true
console.log(result.reason) // "TARGETING_MATCH"
```

## Features

- Zero dependencies
- Supports all 16 targeting operators
- Percentage rollouts with deterministic hashing
- Variant assignment for experiments
- Type-safe evaluation (boolean, string, number, object)

## Documentation

- [Advanced evaluation](https://flaggr.dev/docs/guides/advanced-evaluation)
- [Targeting rules](https://flaggr.dev/docs/guides/targeting-rules)
npm package: @flaggr/mcp-server
Description: MCP server for Flaggr feature flag platform
Latest version: 0.1.0

# @flaggr/mcp-server

[![npm](https://img.shields.io/npm/v/@flaggr/mcp-server)](https://www.npmjs.com/package/@flaggr/mcp-server)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Model Context Protocol (MCP) server for [Flaggr](https://flaggr.dev) — manage feature flags from AI assistants like Claude, Cursor, and VS Code Copilot.

## Installation

```bash
npm install -g @flaggr/mcp-server
```

## Claude Desktop Configuration

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "flaggr": {
      "command": "npx",
      "args": ["@flaggr/mcp-server"],
      "env": {
        "FLAGGR_API_URL": "https://flaggr.dev",
        "FLAGGR_API_TOKEN": "flg_your_token"
      }
    }
  }
}
```

## Tools (19)

| Tool | Description |
|------|-------------|
| `list_projects` | List all projects |
| `get_project` | Get project details |
| `list_services` | List services in a project |
| `list_flags` | List flags for a service |
| `get_flag` | Get flag configuration |
| `create_flag` | Create a new flag |
| `update_flag` | Update flag settings |
| `toggle_flag` | Enable/disable a flag |
| `delete_flag` | Delete a flag |
| `create_targeting_rule` | Add targeting rule |
| `delete_targeting_rule` | Remove targeting rule |
| `create_override` | Create context override |
| `delete_override` | Remove override |
| `get_flag_health` | Flag health score |
| `get_flag_impact` | Pre-change impact analysis |
| `create_experiment` | Set up A/B test |
| `list_experiments` | List experiments |
| `get_experiment` | Get experiment details |
| `stop_experiment` | End an experiment |

## Resources (3)

- `flaggr://projects` — All projects
- `flaggr://project/{slug}/flags` — Flags for a project
- `flaggr://flag/{key}/health` — Flag health score

## Prompts (3)

- `gradual_rollout` — Plan a staged percentage rollout
- `ab_test_setup` — Design an A/B test experiment
- `targeting_strategy` — Build targeting rules for a use case

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `FLAGGR_API_URL` | Yes | Flaggr instance URL |
| `FLAGGR_API_TOKEN` | Yes | API token with appropriate scopes |

## Documentation

- [MCP integration guide](https://flaggr.dev/docs)
- [API tokens](https://flaggr.dev/docs/api/tokens)
npm package: @flaggr/sdk
Description: Flaggr feature flag SDK for TypeScript — type-safe evaluation with pluggable OpenTelemetry instrumentation
Latest version: 0.1.0

# @flaggr/sdk

[![npm](https://img.shields.io/npm/v/@flaggr/sdk)](https://www.npmjs.com/package/@flaggr/sdk)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

TypeScript SDK for [Flaggr](https://flaggr.dev) — type-safe feature flag evaluation with React hooks and OpenTelemetry instrumentation.

## Installation

```bash
npm install @flaggr/sdk
```

## Quick Start

```typescript
import { createFlaggr } from '@flaggr/sdk'

const client = createFlaggr({
  serviceId: 'web-app',
  apiKey: 'flg_your_token',
})

const isEnabled = await client.getBooleanValue('checkout-v2', false)
```

## React

```tsx
import { FlaggrProvider, useBooleanFlag } from '@flaggr/sdk/react'

function App() {
  return (
    <FlaggrProvider config={{ serviceId: 'web-app', apiKey: 'flg_xxx' }}>
      <Checkout />
    </FlaggrProvider>
  )
}

function Checkout() {
  const useNewFlow = useBooleanFlag('checkout-v2', false)
  return useNewFlow ? <CheckoutV2 /> : <CheckoutClassic />
}
```

## OpenTelemetry

```typescript
import { createFlaggr } from '@flaggr/sdk'
import { otelPlugin } from '@flaggr/sdk/otel'

const client = createFlaggr({
  serviceId: 'web-app',
  apiKey: 'flg_xxx',
  plugins: [otelPlugin()],
})
```

## Exports

| Entry Point | Description |
|-------------|-------------|
| `@flaggr/sdk` | Core client and evaluation methods |
| `@flaggr/sdk/react` | React hooks and provider |
| `@flaggr/sdk/otel` | OpenTelemetry instrumentation plugin |

## Documentation

- [TypeScript SDK docs](https://flaggr.dev/docs/sdk/typescript-sdk)
- [React hooks](https://flaggr.dev/docs/sdk/react-hooks)
- [Quick Start](https://flaggr.dev/docs/getting-started/quick-start)
npm package: @flagify/cli
Description: Flagify CLI — manage feature flags from the terminal
Latest version: 1.1.0

# @flagify/cli

The official Flagify CLI for managing feature flags from the terminal.

## Install

```bash
npm install -g @flagify/cli
```

Or with Homebrew:

```bash
brew tap flagifyhq/tap
brew install flagify
```

Or download binaries directly from [GitHub Releases](https://github.com/flagifyhq/cli/releases).

**Tip:** Add a short alias to your shell profile for faster usage:

```bash
echo 'alias flag="flagify"' >> ~/.zshrc && source ~/.zshrc
```

## Quick Start

```bash
# Login to your account
flagify login

# Discover your resources
flagify workspaces list
flagify projects list -w <workspace-id>
flagify projects get <project-id>

# Manage feature flags
flagify flags list -p <project-id>
flagify flags create my-flag -p <project-id> --type boolean
flagify flags toggle my-flag -p <project-id>
```

## Commands

| Command | Description |
|---------|-------------|
| `flagify login` | Authenticate with email and password |
| `flagify logout` | Clear stored credentials |
| `flagify workspaces list` | List your workspaces |
| `flagify workspaces pick` | Interactively select a default workspace |
| `flagify projects list` | List projects in a workspace |
| `flagify projects get` | Show project details with environments |
| `flagify projects pick` | Interactively select a default project |
| `flagify projects delete <id>` | Delete a project and all its environments, flags, and segments (admin only) |
| `flagify environments pick` | Interactively select a default environment |
| `flagify flags list` | List all flags in a project (`--format json` for machine-readable output) |
| `flagify flags get` | Get details for a specific flag with per-environment status |
| `flagify flags create` | Create a new feature flag (kebab-case keys enforced) |
| `flagify flags toggle` | Enable or disable a flag (interactive picker if no key given, supports `--all`) |
| `flagify keys generate` | Generate API key pair for environment |
| `flagify keys list` | List API keys for environment |
| `flagify keys revoke` | Revoke all API keys for environment |
| `flagify ai-setup` | Generate AI tool configs (Claude, Cursor, Copilot, Windsurf). Use `--include-flags` for a snapshot |
| `flagify config` | Show current configuration |
| `flagify config set <key> <value>` | Set a config value (api-url, workspace, project, environment) |
| `flagify config get <key>` | Get a single config value |
| `flagify completion` | Generate shell completion scripts |
| `flagify version` | Print CLI version |

## Shell Completions

**Zsh:**
```bash
flagify completion zsh > "${fpath[1]}/_flagify"
```

**Bash:**
```bash
flagify completion bash > /usr/local/etc/bash_completion.d/flagify
```

**Fish:**
```bash
flagify completion fish > ~/.config/fish/completions/flagify.fish
```

## Configuration

The CLI stores credentials in `~/.flagify/config.json`. Use `--project` and `--environment` flags to target specific resources.

## Requirements

- Flagify account ([flagify.dev](https://flagify.dev))

## License

MIT
npm package: @flagkit/react
Description: Exported FlagKit SVG Components for React
Author: ecklf
Latest version: 1.0.4

# @flagkit/react

[![npm version](https://img.shields.io/npm/v/@flagkit/react.svg)](https://www.npmjs.com/package/@flagkit/react)
[![npm downloads](https://img.shields.io/npm/dm/@flagkit/react.svg)](https://www.npmjs.com/package/@flagkit/react)

FlagKit creators: [madebybowtie](https://github.com/madebybowtie/FlagKit).

This library provides exported SVG Components for React instead of relying on a CDN like `react-flagkit`.

## Installation

### yarn

```sh
yarn add @flagkit/react
```

### npm

```sh
npm i @flagkit/react
```

## Usage

Specific icons:

```tsx
import React from "react";
import { FlagIconDE } from "@flagkit/react";

const App = () => {
  return <FlagIconDE />;
};

export default App;
```
npm package: @flagkit/react-native
Description: Exported FlagKit SVG Components for React Native
Author: ecklf
Latest version: 1.0.4

# @flagkit/react-native

[![npm version](https://img.shields.io/npm/v/@flagkit/react-native.svg)](https://www.npmjs.com/package/@flagkit/react-native)
[![npm downloads](https://img.shields.io/npm/dm/@flagkit/react-native.svg)](https://www.npmjs.com/package/@flagkit/react-native)

FlagKit creators: [madebybowtie](https://github.com/madebybowtie/FlagKit).

This library provides exported SVG Components for React Native.

## Installation

**Requires `react-native-svg` v9 or higher**

### yarn

```sh
yarn add react-native-svg @flagkit/react-native
```

### npm

```sh
npm i react-native-svg @flagkit/react-native
```

## Usage

Specific icons:

```tsx
import React from "react";
import { FlagIconDE } from "@flagkit/react-native";

const App = () => {
  return <FlagIconDE />;
};

export default App;
```
npm package: @flaglayer/nextjs
Description: Next.js integration for Flaglayer feature flags. Supports App Router, SSR, and middleware.
Latest version: 0.1.1

# @flaglayer/nextjs

Next.js integration for Flaglayer feature flags. Supports App Router, SSR, and middleware.

## Install

```bash
npm install @flaglayer/nextjs @flaglayer/react
```

## Client Components

```tsx
import { FlagProvider } from '@flaglayer/nextjs';
import { useBooleanFlag } from '@flaglayer/react';

// In layout.tsx
export default function Layout({ children }) {
  return (
    <FlagProvider apiKey="your-api-key" context={{ userId }}>
      {children}
    </FlagProvider>
  );
}

// In components
function MyComponent() {
  const enabled = useBooleanFlag('feature', false);
}
```

## Server Components

```ts
import { createFlagLayerServer } from '@flaglayer/nextjs/server';

const fl = createFlagLayerServer({ apiKey: 'your-api-key' });
const flags = await fl.evaluateAll({ userId: 'user-123' });
```

## Middleware

```ts
import { createFlagLayerMiddleware } from '@flaglayer/nextjs/middleware';

export const middleware = createFlagLayerMiddleware({
  apiKey: 'your-api-key',
  rules: [{ flag: 'new-dashboard', rewrite: '/dashboard-v2' }],
});
```

## Configuration

The API base URL defaults to the Flaglayer cloud API and can be overridden via the `baseUrl` option in any of the entry points.

[Documentation](https://flaglayer.com/docs) | [GitHub](https://github.com/danheim/flaglayer)
npm package: @flaglayer/node
Description: Server-side Node.js client for Flaglayer. Stateless, per-request evaluation.
Latest version: 0.1.1

# @flaglayer/node

Server-side Node.js client for Flaglayer. Stateless, per-request evaluation.

## Install

```bash
npm install @flaglayer/node
```

## Usage

```ts
import { FlagLayer } from '@flaglayer/node';

const fl = new FlagLayer({ apiKey: 'your-api-key' });

const result = await fl.evaluate('new-feature', { userId: 'user-123' });
console.log(result.value); // true

// Typed helpers
const enabled = await fl.getBooleanValue('new-feature', false, { userId: 'user-123' });
```

## Configuration

The API base URL is configurable via the `baseUrl` option and defaults to the Flaglayer cloud API.

```ts
const fl = new FlagLayer({
  apiKey: 'your-api-key',
  baseUrl: 'https://your-self-hosted-instance.com',
});
```

[Documentation](https://flaglayer.com/docs) | [GitHub](https://github.com/danheim/flaglayer)
npm package: @flaglayer/react
Description: React hooks and provider for Flaglayer feature flags.
Latest version: 0.1.1

# @flaglayer/react

React hooks and provider for Flaglayer feature flags.

## Install

```bash
npm install @flaglayer/react
```

## Usage

```tsx
import { FlagProvider, useFlag, useBooleanFlag } from '@flaglayer/react';

function App() {
  return (
    <FlagProvider apiKey="your-api-key" context={{ userId: 'user-123' }}>
      <MyComponent />
    </FlagProvider>
  );
}

function MyComponent() {
  const showFeature = useBooleanFlag('new-feature', false);
  if (showFeature) return <NewFeature />;
  return <OldFeature />;
}
```

## Hooks

- `useFlag(key)` — Get the full flag evaluation result.
- `useBooleanFlag(key, fallback)` — Get a boolean flag value.
- `useStringFlag(key, fallback)` — Get a string flag value.
- `useNumberFlag(key, fallback)` — Get a number flag value.
- `useFlagValue(key, fallback)` — Get a flag value of any type.
- `useFlags()` — Get all evaluated flags.
- `useFlagLayer()` — Access the underlying FlagLayer client instance.

## Configuration

The API base URL defaults to the Flaglayer cloud API and can be overridden via the provider.

```tsx
<FlagProvider apiKey="your-api-key" baseUrl="https://your-instance.com" context={{ userId: 'user-123' }}>
  {children}
</FlagProvider>
```

[Documentation](https://flaglayer.com/docs) | [GitHub](https://github.com/danheim/flaglayer)
npm package: @flaglayer/sdk
Description: Core JavaScript/TypeScript SDK for Flaglayer feature flags.
Latest version: 0.1.1

# @flaglayer/sdk

Core JavaScript/TypeScript SDK for Flaglayer feature flags.

## Install

```bash
npm install @flaglayer/sdk
```

## Usage

```ts
import { FlagLayer } from '@flaglayer/sdk';

const fl = new FlagLayer({ apiKey: 'your-api-key' });
await fl.identify({ userId: 'user-123' });

const showFeature = fl.getBooleanValue('new-feature', false);
```

## API

- `new FlagLayer(options)` — Create a client instance. Options include `apiKey` and optional `baseUrl`.
- `identify(context)` — Set the evaluation context (user, org, custom attributes).
- `evaluate(key, context)` — Evaluate a flag and return the full result.
- `getBooleanValue(key, fallback)` — Get a boolean flag value.
- `getStringValue(key, fallback)` — Get a string flag value.
- `getNumberValue(key, fallback)` — Get a number flag value.
- `getValue(key, fallback)` — Get a flag value of any type.
- `getFlags()` — Get all evaluated flags.
- `refresh()` — Re-fetch flags from the server.

## Configuration

The API base URL is configurable via the `baseUrl` option and defaults to the Flaglayer cloud API.

```ts
const fl = new FlagLayer({
  apiKey: 'your-api-key',
  baseUrl: 'https://your-self-hosted-instance.com',
});
```

[Documentation](https://flaglayer.com/docs) | [GitHub](https://github.com/danheim/flaglayer)