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
.NET.NET 8.0+ / C#ServerFeatureSignals
RubyRuby 3.1+Serverfeaturesignals
ReactReact 18+Client@featuresignals/react
VueVue 3.3+Client@featuresignals/vue

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);

// C#
await client.WaitForReadyAsync();

// Ruby
client.wait_for_ready

Lifecycle

Always close the client when shutting down:

client.close(); // Node.js, Go, Java
client.close() // Python, Ruby
client.Dispose(); // C#

OpenFeature Support

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

API keys and HTTP behavior

  • API key expiration: Environment API keys can be created with an optional expiration time. Expired keys are rejected; rotate keys before they expire.
  • SSE authentication: Passing the API key as the api_key query parameter on GET /v1/stream/{envKey} is deprecated and will be removed in a future version. Use the X-API-Key header instead.
  • Rate limits: Evaluation and other rate-limited responses include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. SDKs should respect these (for example by backing off or reducing request frequency) to avoid 429 responses.