Skip to main content

Install Flaggr SDK and configure your development environment

Last updated November 21, 2026

Installation

TypeScript / JavaScript

Install the Flaggr SDK:

npm install @flaggr/sdk

The SDK includes:

  • Core client — createFlaggr, with remote evaluation (poll), batched refreshes (batch), or streaming with local evaluation (stream)
  • React hooks — @flaggr/sdk/react: FlaggrProvider, useBooleanFlag, useStringFlag, useNumberFlag, useObjectFlag and useFlag
  • OpenTelemetry plugin — @flaggr/sdk/otel
  • Browser telemetry plugin — flaggrTelemetry(), which links Web Vitals and errors to flag variants
  • Script-tag bundle — https://cdn.flaggr.dev/sdk.js, for pages without a bundler

Use 0.5.0 or later: 0.4.0 fails to load as an ES module. See TypeScript SDK for details, the script tag and every option.

Go and Python

Flaggr's Go and Python SDKs evaluate flags through Flaggr's evaluation API:

LanguageInstall
Gogo get github.com/flaggr-dev/flaggr-go@latest (guide)
Pythonpip install "flaggr @ git+https://github.com/flaggr-dev/flaggr-python@v0.1.1" (guide). It isn't on PyPI yet

Other Languages (OpenFeature)

Flaggr is compatible with the OpenFeature standard. Any OpenFeature SDK evaluates Flaggr flags with its OFREP provider, which talks to Flaggr's OFREP endpoint. Java uses this route, and so can code in other languages that already uses OpenFeature:

LanguagePackages
Javadev.openfeature:sdk and dev.openfeature.contrib.providers:ofrep (guide)
Python with OpenFeaturepip install openfeature-sdk openfeature-provider-ofrep (guide)
Go with OpenFeaturego get github.com/open-feature/go-sdk github.com/open-feature/go-sdk-contrib/providers/ofrep (guide)
Node.js with OpenFeaturenpm install @openfeature/server-sdk @openfeature/ofrep-provider (guide)

Configuration

Environment Variables

The SDK's global client (flag() without configure()) and FlaggrProvider without props read these from process.env:

VariableDescriptionRequired
FLAGGR_SERVICE_IDYour service identifierYes
FLAGGR_API_KEYAPI token for authenticationYes with the default FLAGGR_API_URL: the data plane refuses requests without a token. Only https://flaggr.dev evaluates isPublic flags without one
FLAGGR_ENVIRONMENTTarget environment (development, staging, production)No (the data plane uses production without one)
FLAGGR_API_URLFlaggr API endpointNo (defaults to https://api.flaggr.dev)

Each also works with a NEXT_PUBLIC_ prefix. From 0.5.0, Next.js inlines the NEXT_PUBLIC_ values set at build time into browser bundles. 0.4.0 looks them up at run time and finds none there, so with 0.4.0 pass the values to configure() or FlaggrProvider yourself.

Update Modes

ModeDescriptionBest For
poll (default)Each evaluation asks the data plane once its cached value has expiredServers, simple setups
batchOn an interval, every flag the client has cached or watches is refreshed, up to 100 flags per requestMany flags, fewer requests
streamFlag configurations pushed over SSE, evaluated locallyLow latency, live updates

See Provider Architecture for how to choose.