> ## Documentation Index
> Fetch the complete documentation index at: https://superflag.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the Superflag React SDK for web applications

# React SDK Installation

The `@superflag-sh/react` package provides feature flags and remote config for React web applications.

## Requirements

* React 18 or higher
* TypeScript 5.0+ (recommended)
* Modern bundler (Vite, Next.js, Remix, webpack, etc.)

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @superflag-sh/react
  ```

  ```bash yarn theme={null}
  yarn add @superflag-sh/react
  ```

  ```bash pnpm theme={null}
  pnpm add @superflag-sh/react
  ```

  ```bash bun theme={null}
  bun add @superflag-sh/react
  ```
</CodeGroup>

## Supported Frameworks

The React SDK works with all modern React frameworks:

* **Next.js** (App Router & Pages Router)
* **Remix**
* **Vite**
* **Create React App**
* **Astro** (with React integration)
* Any React 18+ application

## Bundle Size

The React SDK is lightweight and tree-shakeable:

* **\~9 KB** minified (gzipped)
* **Zero dependencies** (only React as peer dependency)
* Fully tree-shakeable ES modules

## TypeScript Support

The SDK is written in TypeScript and includes full type definitions out of the box. No need to install separate `@types` packages.

```tsx theme={null}
import { useFlag } from '@superflag-sh/react'

// Type-safe flag hooks
const enabled = useFlag<boolean>('feature-flag', false)
const config = useFlag<{ theme: string }>('ui-config', { theme: 'light' })
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Usage Guide" icon="code" href="/react/usage">
    Learn how to use the SDK in your app
  </Card>

  <Card title="API Reference" icon="book" href="/react/api-reference">
    Complete API documentation
  </Card>
</CardGroup>
