Back to Docs

SDK Documentation

Official SDKs and framework adapters with clear production support, fallback behavior, and cache guarantees for every supported runtime.

Production Support Matrix

Every GA SDK supports authenticated evaluation and targeting context. Fallback behavior is explicit so production teams can decide what happens when the flag API is unreachable.

SDKStatusRuntimeCacheFallback contract
JavaScript / TypeScriptGANode.js 18+Configurable in-memory TTL cacheReturns configured defaultValue with ERROR reason
ReactGAReact 18+ or 19+Keeps last-known flags between refreshesUses initial or last-known flags; unknown flags default to false
VueGAVue 3.3+Keeps last-known flags between refreshesUses initial or last-known flags; default values for missing flags
AngularGAAngular 17+Keeps last-known flags between refreshesgetFlag and pipe can return caller-provided defaults
GoGAGo 1.21+Thread-safe in-memory TTL cacheReturns errors so callers choose fallback behavior
PythonGAPython 3.9+Thread-safe in-memory TTL cacheReturns configured default_value with ERROR reason
RubyGARuby 3.0+Mutex-backed in-memory TTL cacheRaises typed exceptions so callers choose fallback behavior
RustGARust stableThread-safe in-memory TTL cacheReturns Result so callers choose fallback behavior
JavaGAJava 11+ConcurrentHashMap-backed TTL cacheisEnabled returns false on error; evaluate throws
TerraformPreviewTerraform 1.0+Not applicableNot applicable for runtime evaluation

JavaScript / TypeScript

@buildrflags/sdkGA

Server-side and backend evaluation

Full TypeScript typesConfigurable cache TTLTimeout controlsSafe default fallback

Installation

npm install @buildrflags/sdk

Initialization

init.ts
import { createClient } from '@buildrflags/sdk';

const client = createClient({
  apiKey: 'bf_production_xxxxxxxx',
});

Evaluate a Flag

evaluate.ts
const enabled = await client.isEnabled('new-feature', {
  userId: 'user-123',
  attributes: { plan: 'pro' },
});

if (enabled) {
  // Show the new feature
}

Get All Flags

all-flags.ts
const results = await client.evaluateAll(
  ['feature-a', 'feature-b'],
);

for (const [key, result] of results) {
  console.log(key, result.enabled);
}

React

@buildrflags/reactGA

Client-side UI rendering

React hooksSSR initial flagsAuto-refresh pollingLast-known fallback

Installation

npm install @buildrflags/react

Initialization

init.ts
import { BuildrFlagsProvider } from '@buildrflags/react';

export function App() {
  return (
    <BuildrFlagsProvider apiKey="bf_production_xxxxxxxx">
      <Dashboard />
    </BuildrFlagsProvider>
  );
}

Evaluate a Flag

evaluate.ts
import { useFlag } from '@buildrflags/react';

function Dashboard() {
  const { enabled, isLoading } = useFlag('new-feature');

  if (isLoading) return null;
  return enabled ? <NewFeature /> : <CurrentFeature />;
}

Get All Flags

all-flags.ts
import { useFlags } from '@buildrflags/react';

function DebugPanel() {
  const { flags, error, refresh } = useFlags();
  return <button onClick={refresh}>{Object.keys(flags).length} flags</button>;
}

Vue

@buildrflags/vueGA

Vue and Nuxt UI rendering

ComposablesSSR initial flagsAuto-refresh pollingTypeScript types

Installation

npm install @buildrflags/vue

Initialization

init.ts
import { createApp } from 'vue';
import { BuildrFlagsPlugin } from '@buildrflags/vue';

createApp(App).use(BuildrFlagsPlugin, {
  apiKey: 'bf_production_xxxxxxxx',
});

Evaluate a Flag

evaluate.ts
<script setup lang="ts">
import { useFlag } from '@buildrflags/vue';

const { enabled, isLoading } = useFlag('new-feature');
</script>

Get All Flags

all-flags.ts
<script setup lang="ts">
import { useFlags } from '@buildrflags/vue';

const { flags, error, refresh } = useFlags();
</script>

Angular

@buildrflags/angularGA

Angular apps and dashboards

Structural directiveAsync pipeService APISSR initial flags

Installation

npm install @buildrflags/angular

Initialization

init.ts
import { BuildrFlagsModule } from '@buildrflags/angular';

@NgModule({
  imports: [
    BuildrFlagsModule.forRoot({
      apiKey: 'bf_production_xxxxxxxx',
    }),
  ],
})
export class AppModule {}

Evaluate a Flag

evaluate.ts
<div *ifFlag="'new-feature'; else currentFeature">
  New feature
</div>
<ng-template #currentFeature>Current feature</ng-template>

Get All Flags

all-flags.ts
constructor(private flags: BuildrFlagsService) {}

async refreshFlags() {
  await this.flags.refresh();
  console.log(this.flags.snapshot.flags);
}

Go

github.com/buildrlab/buildrflags-goGA

Backend services and workers

Zero dependencies (stdlib only)Thread-safe cacheContext-awareExplicit errors

Installation

go get github.com/buildrlab/buildrflags-go

Initialization

init.go
import buildrflags "github.com/buildrlab/buildrflags-go"

client, err := buildrflags.NewClient("bf_production_xxxxxxxx")
if err != nil {
    log.Fatal(err)
}
defer client.Close()

Evaluate a Flag

evaluate.go
enabled, err := client.IsEnabled(ctx, "new-feature",
    &buildrflags.EvalContext{
        UserID: "user-123",
        Attributes: map[string]interface{}{
            "plan": "pro",
        },
    },
)

if enabled {
    // Show the new feature
}

Get All Flags

all-flags.go
results, err := client.EvaluateAll(ctx, nil)
for key, result := range results {
    fmt.Printf("%s: %v\n", key, result.Enabled)
}

Python

buildrflagsGA

Python web apps, jobs, and notebooks

Context manager supportThread-safe cacheRetry controlsSafe default fallback

Installation

pip install buildrflags

Initialization

init.py
from buildrflags import BuildrFlagsClient

client = BuildrFlagsClient(
    api_key="bf_production_xxxxxxxx"
)

Evaluate a Flag

evaluate.py
from buildrflags import EvaluationContext

result = client.evaluate("new-feature",
    context=EvaluationContext(
        user_id="user-123",
        attributes={"plan": "pro"},
    ),
)

if result.enabled:
    # Show the new feature

Get All Flags

all-flags.py
flags = client.evaluate_all()
for key, result in flags.items():
    print(f"{key}: {'ON' if result.enabled else 'OFF'}")

Ruby

buildrflagsGA

Rails, Sinatra, and Puma apps

Thread-safe (Puma compatible)Built-in cachingNo external dependenciesTyped exceptions

Installation

gem install buildrflags

Initialization

init.rb
require "buildrflags"

client = BuildrFlags::Client.new(
  api_key: "bf_production_xxxxxxxx"
)

Evaluate a Flag

evaluate.rb
result = client.evaluate("new-feature",
  context: {
    user_id: "user-123",
    attributes: { plan: "pro" },
  }
)

if result.enabled
  # Show the new feature
end

Get All Flags

all-flags.rb
flags = client.evaluate_all
flags.each do |key, result|
  puts "#{key}: #{result.enabled}"
end

Rust

buildrflagsGA

Rust services and CLIs

Sync and async APIsThread-safe cacheTyped errorsEvaluate all flags

Installation

cargo add buildrflags

Initialization

init.rs
use buildrflags::{BuildrFlagsClient, BuildrFlagsConfig};

let client = BuildrFlagsClient::new(BuildrFlagsConfig {
    api_key: "bf_production_xxxxxxxx".to_string(),
    base_url: None,
    cache_ttl: None,
    timeout: None,
})?;

Evaluate a Flag

evaluate.rs
let enabled = client
    .is_enabled("new-feature", None)
    .unwrap_or(false);

if enabled {
    // Show the new feature
}

Get All Flags

all-flags.rs
let flags = client.evaluate_all(None)?;
for (key, result) in &flags {
    println!("{key}: enabled={}", result.enabled);
}

Java

com.buildrlab:buildrflagsGA

JVM services and Spring apps

Java 11+Thread-safe cacheBuilder APISafe boolean helper

Installation

implementation "com.buildrlab:buildrflags:0.1.0"

Initialization

init.java
BuildrFlagsClient client = BuildrFlagsClient.builder()
    .apiKey("bf_production_xxxxxxxx")
    .build();

Evaluate a Flag

evaluate.java
EvaluationContext ctx = EvaluationContext.builder()
    .userId("user-123")
    .attribute("plan", "pro")
    .build();

if (client.isEnabled("new-feature", ctx)) {
    showNewFeature();
}

Get All Flags

all-flags.java
EvaluationResult result = client.evaluate("new-feature");
System.out.printf("%s: %b%n",
    result.getFlagKey(),
    result.isEnabled());

Terraform

BuildrLab/buildrflagsPreview

Provisioning environments, flags, and segments as code

Flags as codeEnvironment resourcesSegment resourcesImport support

Installation

terraform init

Initialization

init.tf
terraform {
  required_providers {
    buildrflags = {
      source = "BuildrLab/buildrflags"
    }
  }
}

provider "buildrflags" {
  api_key = var.buildrflags_api_key
}

Evaluate a Flag

evaluate.tf
resource "buildrflags_flag" "checkout" {
  env_key     = "production"
  flag_key    = "new_checkout"
  name        = "New Checkout"
  enabled     = false
}

Read Flags as Code

all-flags.tf
data "buildrflags_flags" "production" {
  env_key = "production"
}