Skip to main content

SDK Overview

FeatureSignals provides official SDKs for server-side and client-side applications. All SDKs follow a consistent pattern and support OpenFeature for vendor-neutral integration.

Available SDKs

SDKLanguageTypePackage
GoGo 1.22+Servergithub.com/featuresignals/sdk-go
Node.jsTypeScript/Node 22+Server@featuresignals/node
PythonPython 3.9+Serverfeaturesignals
JavaJava 17+Servercom.featuresignals:sdk-java
ReactReact 18+Client@featuresignals/react

SDK Architecture

All SDKs follow the same core design:

┌──────────┐    HTTP/SSE     ┌──────────────┐
│ SDK │ ──────────────▶│ API Server │
│ │ │ or Relay │
│ ┌──────┐ │ initial load └──────────────┘
│ │Cache │ │
│ └──────┘ │ polling/SSE
│ │ (background)
└──────────┘
  1. Initialize with API key and environment key
  2. First load: Fetches all flag values via GET /v1/client/{envKey}/flags
  3. Background sync: Polls at regular intervals or streams via SSE
  4. Local evaluation: Variation methods read from the in-memory cache (no network call)
  5. Graceful degradation: Returns fallback values on errors or before ready

Common Patterns

Initialization

All SDKs accept:

OptionDefaultDescription
sdkKey / sdk_key(required)API key for authentication
envKey / env_key(required)Environment slug
baseURL / base_urlhttps://api.featuresignals.comAPI server URL
pollingInterval30 secondsHow often to refresh flags
streamingfalseUse SSE instead of polling

Variation Methods

All SDKs provide typed variation methods:

MethodReturnsSDK Suffix
Booleantrue/falseBoolVariation / boolVariation / bool_variation
StringText valueStringVariation / stringVariation / string_variation
NumberNumeric valueNumberVariation / numberVariation / number_variation
JSONObject/mapJSONVariation / jsonVariation / json_variation

Each takes three arguments:

  1. Flag key — the flag's unique identifier
  2. Evaluation context — user identity and attributes
  3. Fallback value — returned if the flag doesn't exist or there's an error

Readiness

SDKs emit a "ready" event after the first successful flag load:

// Node.js
await client.waitForReady();

// Go
<-client.Ready()

// Python
client.wait_for_ready()

// Java
client.waitForReady(5000);

Lifecycle

Always close the client when shutting down:

client.close(); // Node.js, Go, Java
client.close() // Python

OpenFeature Support

All server SDKs include an OpenFeature provider for vendor-neutral flag consumption. See the OpenFeature guide for details.