# tggl-client

> Tggl Typescript SDK for client and server

Latest version **3.2.2** (published 2026-03-31) · ISC license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.2.2 |
| Published | 2026-03-31 |
| First published | 2021-05-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.0.0 |
| Dependencies | 2 |
| Unpacked size | 190.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Nicolas Keller |
| Maintainers | nick-keller |
| Keywords | Tggl, Feature flag, Feature toggle, A/B testing, Remote config, Kill switch |

## Links

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

## Dependencies (2)

- [ky](https://npm.io/package/ky.md) ^1.13.0
- [tggl-core](https://npm.io/package/tggl-core.md) ^1.4.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 3.2.2 (latest) — 2026-03-31
- 3.2.1 — 2025-12-08
- 3.2.0 — 2025-11-21
- 3.1.0 — 2025-11-14
- 3.0.1 — 2025-11-13
- 3.0.0 — 2025-11-11
- 2.1.2 — 2025-06-20
- 2.1.1 — 2025-06-20
- 2.1.0 — 2025-02-16
- 2.0.1 — 2024-12-13
- 2.0.0 — 2024-12-12
- 1.17.2 — 2024-10-19
- 1.17.1 — 2024-10-19
- 1.17.0 — 2024-10-11
- 1.16.0 — 2024-10-06
- … 31 more at https://npm.io/package/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 Typescript SDK</h1>

<p align="center">
  The Typescript SDK can be used both on the client and server 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/node">📚 Documentation</a>
  •
  <a href="https://www.npmjs.com/package/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/js-tggl-client/test.yml" alt="GitHub Workflow Status (with event)" />
  <img src="https://img.shields.io/coverallsCoverage/github/Tggl/js-tggl-client" alt="Coveralls branch" />
  <img src="https://img.shields.io/npm/v/tggl-client" alt="npm" />
</p>

## Usage

Install the dependency:

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

Client applications (browsers, React Native, etc.) should use the TgglClient with a client API key:

```typescript
import { TgglClient } from 'tggl-client'

const client = new TgglClient({
  apiKey: 'XXX',
  initialContext: { userId: 'abc123' },
})

await client.waitReady()

if (client.get('my-feature', true)) {
  // ...
}
```

Backend applications (NodeJs) should use the TgglLocalClient with a server API key:

```typescript
import { TgglLocalClient } from 'tggl-client'

const client = new TgglLocalClient({
  apiKey: 'XXX',
})

await client.waitReady()

if (client.get({ userId: 'abc123' }, 'my-feature', true)) {
  // ...
}
```

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