SDKs Overview
Official Flipswitch SDKs with real-time updates
Flipswitch provides two integration paths: official SDKs with real-time SSE streaming, or any OpenFeature OFREP provider for polling-based evaluation.
Official SDKs
JavaScript
React, Node.js, browser
Java
Spring Boot, server-side
Python
FastAPI, Django, server-side
Go
Gin, net/http, server-side
Open source on GitHub: JavaScript | Java | Python | Go
OpenFeature / OFREP
Flipswitch implements the OpenFeature Remote Evaluation Protocol (OFREP), so any language with an OpenFeature SDK and OFREP provider can evaluate flags without a dedicated Flipswitch SDK.
OFREP providers use polling to fetch flag values. For instant updates via SSE, use an official SDK above.
.NET
ASP.NET, server-side
Rust
Tokio, server-side
Swift
iOS, macOS
PHP
Laravel, server-side
Ruby
Rails, server-side
See Other Languages (OFREP) for setup instructions.
Feature Comparison
| Feature | Official SDKs | OFREP |
|---|---|---|
| Flag evaluation | ✓ | ✓ |
| Real-time updates (SSE) | ✓ | ✗ |
| Automatic reconnection | ✓ | ✗ |
| Polling fallback | ✓ | ✗ |
| Local caching | ✓ | ~ |
| Event handlers | ✓ | ✗ |
| OpenFeature compatible | ✓ | ✓ |
Official SDKs maintain a persistent SSE connection for millisecond-latency updates. OFREP providers poll at a configurable interval, which is simpler but means flag changes aren't instant.
Configuration
All official SDKs share common options:
| Option | Default | Description |
|---|---|---|
apiKey | required | Your environment API key |
baseUrl | https://api.flipswitch.io | Flipswitch server URL |
enableRealtime | true | Enable SSE for instant updates |
enablePollingFallback | true | Fall back to polling when SSE fails |
pollingInterval | 30s | Polling interval in fallback mode |
maxSseRetries | 5 | Max SSE retries before polling fallback |
Evaluation Context
Pass user attributes for targeting:
const context = {
targetingKey: 'user-123', // Required: unique identifier
email: 'user@example.com', // Custom attributes
plan: 'premium',
country: 'SE'
};
const value = await client.getBooleanValue('feature', false, context);The targetingKey is required for consistent gradual rollouts.