SDKs Overview

Official Flipswitch SDKs with real-time updates

Flipswitch provides official SDKs with real-time updates via SSE. When you toggle a flag, connected clients update within milliseconds.

Official SDKs

Feature Matrix

FeatureJavaScriptJavaPythonGoOFREP
Flag evaluationYesYesYesYesYes
Real-time updates (SSE)YesYesYesYesNo
Automatic reconnectionYesYesYesYesNo
Local cachingYesYesYesYesVaries
Event handlersYesYesYesYesNo
OpenFeature compatibleYesYesYesYesYes

Quick Comparison

Use official SDKs when you need:

  • Instant flag updates (SSE)
  • Automatic cache invalidation
  • Event handlers for flag changes
  • Reconnection with backoff

Use standard OFREP when:

  • Your language doesn't have an official SDK
  • You only need polling-based evaluation
  • You want minimal dependencies

Installation

All SDKs follow the same pattern:

// 1. Create provider with API key
const provider = new FlipswitchProvider({ apiKey: 'YOUR_API_KEY' });
 
// 2. Register with OpenFeature
await OpenFeature.setProviderAndWait(provider);
 
// 3. Get client and evaluate
const client = OpenFeature.getClient();
const value = await client.getBooleanValue('my-flag', false);

See each SDK's page for language-specific details.

Configuration

All SDKs share common options:

OptionDefaultDescription
apiKeyrequiredYour environment API key
baseUrlhttps://api.flipswitch.devFlipswitch server URL
enableRealtimetrueEnable SSE for instant updates

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.

Other Languages

For languages without an official SDK, use any OpenFeature OFREP provider:

  • .NET
  • PHP
  • Ruby
  • Rust
  • Swift
  • Kotlin

Or call the Flag Evaluation API directly.

On this page