Skip to main content

Move between update modes and protocols, and migrate from other feature flag platforms

Last updated November 21, 2026

Migration Guide

Guides for common migration scenarios when working with Flaggr.

Polling to Streaming

@flaggr/sdk polls by default: each evaluation whose cached value has expired asks the data plane. In stream mode the client receives the service's flag configurations over Server-Sent Events, evaluates locally, and applies changes as they're pushed.

1

Switch the update mode

import { createFlaggr } from '@flaggr/sdk'
 
// Before: polling (the default)
const client = createFlaggr({
  serviceId: 'web-app',
  apiKey: 'fgr_your_token',
  environment: 'production',
})
 
// After: streaming, with local evaluation
const client = createFlaggr({
  serviceId: 'web-app',
  apiKey: 'fgr_your_token',
  environment: 'production',
  updateMode: 'stream',
})

You can also switch a running client with client.setUpdateMode('stream'). With React, pass config={{ serviceId: 'web-app', updateMode: 'stream' }} to FlaggrProvider.

2

Remove custom polling logic

If you re-evaluated flags on a setInterval, remove it. Subscribe to changes instead with client.onFlagChange(key, listener); the React hooks re-render on their own.

3

Add connection state monitoring

import { ConnectionState } from '@flaggr/sdk'
 
client.onConnectionStateChange((state) => {
  if (state === ConnectionState.ERROR) {
    // Optional: show a notice. The client reconnects with backoff.
  }
})
Note

In stream mode the client holds every flag configuration of the service, targeting rules included, so in a browser anyone who can read the page can see them. Flags whose rules use operators the data plane doesn't implement (exists, not_exists, in_cohort, not_in_cohort) are still evaluated remotely. See Provider Architecture for the trade-offs between the modes.

REST, Connect-RPC and gRPC

The data plane at https://api.flaggr.dev serves the same evaluations over REST, OFREP, Connect-RPC and gRPC. @flaggr/sdk, Flaggr's Go and Python SDKs and the OpenFeature OFREP providers use REST or OFREP; no Connect-RPC or gRPC client is published. To call those protocols yourself, see Protocols.

From Other Platforms

From LaunchDarkly

See Migrate from LaunchDarkly for the full walkthrough, including targeting rules and operator mapping.

1

Map concepts

LaunchDarklyFlaggr
ProjectProject
EnvironmentEnvironment
Feature FlagFeature Flag
Targeting RuleTargeting Rule
SegmentCohort
VariationVariant
SDK KeyAPI Token
2

Replace SDK

// Before: LaunchDarkly
import { init } from 'launchdarkly-js-client-sdk'
const client = init('sdk-key', { key: 'user-123' })
const value = client.variation('my-flag', false)
 
// After: Flaggr
import { createFlaggr } from '@flaggr/sdk'
const client = createFlaggr({
  serviceId: 'web-app',
  apiKey: 'fgr_your_token',
  environment: 'production',
  context: { targetingKey: 'user-123' },
})
const value = await client.getBooleanValue('my-flag', false)
3

Import flags

Create the flags in Flaggr with the import endpoint (see Import & Export):

POST /api/flags/import

From Split.io

1

Map concepts

Split.ioFlaggr
WorkspaceProject
EnvironmentEnvironment
SplitFeature Flag
TreatmentVariant
Targeting RuleTargeting Rule
Traffic TypeService
2

Replace SDK

// Before: Split
import { SplitFactory } from '@splitsoftware/splitio'
const factory = SplitFactory({ core: { authorizationKey: 'key' } })
const client = factory.client()
const treatment = client.getTreatment('user-123', 'my-split')
 
// After: Flaggr
import { createFlaggr } from '@flaggr/sdk'
const client = createFlaggr({
  serviceId: 'web-app',
  apiKey: 'fgr_your_token',
  environment: 'production',
})
const value = await client.getStringValue('my-split', 'off', { targetingKey: 'user-123' })

Using OpenFeature for Migration

Smooth Migration

Use the OpenFeature SDK as an abstraction layer. Switch providers without changing your evaluation code.

import { OpenFeature } from '@openfeature/server-sdk'
import { OFREPProvider } from '@openfeature/ofrep-provider'
 
// Step 1: Start with your current provider
OpenFeature.setProvider(currentProvider)
 
// Step 2: Switch to Flaggr through its OFREP endpoint
await OpenFeature.setProviderAndWait(new OFREPProvider({
  baseUrl: 'https://api.flaggr.dev/api',
  headers: [
    ['Authorization', `Bearer ${process.env.FLAGGR_TOKEN}`],
    ['X-Service-Id', 'my-service'],
    ['X-Environment', 'production'],
  ],
}))
 
// Your evaluation code stays the same
const client = OpenFeature.getClient()
const value = await client.getBooleanValue('my-flag', false)

Without X-Environment, OFREP evaluates in development. See OFREP for the Python and Go providers.