Skip to main content

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

npm install @superflag-sh/react

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.
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