# react-tggl-client

> Tggl React SDK

Latest version **4.0.1** (published 2025-11-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-tggl-client
pnpm add react-tggl-client
yarn add react-tggl-client
bun add react-tggl-client
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2025-11-16 |
| First published | 2022-05-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 30.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nicolas Keller |
| Maintainers | nick-keller |
| Keywords | Tggl, React, SDK, Feature flag, Feature toggle, A/B testing, Remote config, Kill switch |

## Links

- npm: https://www.npmjs.com/package/react-tggl-client
- Repository: https://github.com/Tggl/react-tggl-client
- Homepage: https://tggl.io/developers/sdks/react
- Issues: https://github.com/Tggl/react-tggl-client/issues
- npm.io page: https://npm.io/package/react-tggl-client

## Dependencies (1)

- [tggl-client](https://npm.io/package/tggl-client.md) ^3.1.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 4.0.1 (latest) — 2025-11-16
- 4.0.0 — 2025-11-15
- 3.1.2 — 2025-08-21
- 3.1.1 — 2025-08-17
- 3.1.0 — 2025-02-16
- 3.0.0 — 2024-12-13
- 2.3.0 — 2024-11-28
- 2.2.1 — 2024-10-19
- 2.2.0 — 2024-10-11
- 2.1.1 — 2024-08-24
- 2.1.0 — 2024-07-21
- 2.0.0 — 2024-03-15
- 1.6.1 — 2024-03-10
- 1.5.2 — 2024-03-10
- 1.6.0 — 2023-09-09
- … 5 more at https://npm.io/package/react-tggl-client/versions

## README

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://tggl.io/tggl-io-logo-white.svg">
    <img align="center" alt="Tggl Logo" src="https://tggl.io/tggl-io-logo-black.svg" width="200rem" />
  </picture>
</p>

<h1 align="center">Tggl React SDK</h1>

<p align="center">
  The React SDK can be used to evaluate flags and report usage to the Tggl API or a <a href="https://tggl.io/developers/evaluating-flags/tggl-proxy">proxy</a>.
</p>

<p align="center">
  <a href="https://tggl.io/">🔗 Website</a>
  •
  <a href="https://tggl.io/developers/sdks/react">📚 Documentation</a>
  •
  <a href="https://www.npmjs.com/package/react-tggl-client">📦 NPM</a>
  •
  <a href="https://www.youtube.com/@Tggl-io">🎥 Videos</a>
</p>

<p align="center">
  <img src="https://img.shields.io/github/actions/workflow/status/Tggl/react-tggl-client/ci.yml" alt="GitHub Workflow Status (with event)" />
  <img src="https://img.shields.io/coverallsCoverage/github/Tggl/react-tggl-client" alt="Coveralls branch" />
  <img src="https://img.shields.io/npm/v/react-tggl-client" alt="npm" />
</p>

## Usage

Install the dependency:

```bash
npm i react-tggl-client
```

Add the provider to your app:

```tsx
import { TgglClient, TgglProvider } from 'react-tggl-client'

// Instanciate it outside of your component
const client = new TgglClient({ apiKey: 'YOUR_API_KEY' })

const App = () => {
  return (
    <TgglProvider client={client}>
      {/*...*/}
    </TgglProvider>
  )
}

```

Use the hook to evaluate flags:

```typescript
import { useFlag } from 'react-tggl-client'
 
const MyComponent = () => {
  const value = useFlag('myFlag', 'Varation A')
 
  //...
}
```

---
_Source: https://npm.io/package/react-tggl-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
