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

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.

See Other Languages (OFREP) for setup instructions.

Feature Comparison

FeatureOfficial SDKsOFREP
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:

OptionDefaultDescription
apiKeyrequiredYour environment API key
baseUrlhttps://api.flipswitch.ioFlipswitch server URL
enableRealtimetrueEnable SSE for instant updates
enablePollingFallbacktrueFall back to polling when SSE fails
pollingInterval30sPolling interval in fallback mode
maxSseRetries5Max 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.

On this page