Install Flaggr SDK and configure your development environment
Installation
TypeScript / JavaScript
Install the Flaggr client SDK:
npm install @flaggr/clientThe SDK includes:
- Core client — Flag evaluation with multiple transport modes
- React hooks —
useBooleanFlag,useStringFlag,useNumberFlag,useObjectFlag - Analytics — Automatic evaluation event batching
- OpenFeature provider — Standard OpenFeature SDK integration
OpenFeature SDK
Flaggr is fully compatible with the OpenFeature standard. You can use the official OpenFeature SDKs:
Web (Browser)
npm install @openfeature/web-sdkServer (Node.js)
npm install @openfeature/server-sdkConfiguration
Environment Variables
| Variable | Description | Required |
|---|---|---|
FLAGGR_API_URL | Flaggr API endpoint | Yes |
FLAGGR_SERVICE_ID | Your service identifier | Yes |
FLAGGR_API_KEY | API token for authentication | Yes (for private flags) |
FLAGGR_ENVIRONMENT | Target environment (development, staging, production) | No (defaults to development) |
Evaluation Modes
The SDK supports 7 evaluation modes:
| Mode | Description | Best For |
|---|---|---|
remote | Evaluate flags via API calls | Server-side, low flag count |
ofrep | OpenFeature Remote Evaluation Protocol | Standard compliance |
in-process | Local evaluation with cached rules | High-throughput, low latency |
file | File-based flag configuration | Testing, CI/CD |
hybrid | Local evaluation + remote sync | Best of both worlds |
connect | Connect-RPC protocol | Type-safe RPC |
grpc-web | gRPC-Web binary streaming | Browser gRPC support |