Skip to content
SDKs

One integration, five platforms

The SDKs are open-source and ship in this repository. Public registry releases (npm, pub.dev, Maven Central, SPM, NuGet) are planned but not shipped yet — today you vendor via a local path or project reference.

Beta · local source only

Source lives in this repo as @ctrlapp/sdk. No public npm release yet — vendor via the documented local path.

Install (local)
// package.json
"@ctrlapp/sdk": "file:../packages/ctrl-sdk"
Initialize · read · track
import { Ctrl } from "@ctrlapp/sdk";

const ctrl = Ctrl.init({
  apiKey: "ck_sdk_...",
  deviceId: getOrCreateDeviceId(),
  platform: "web",
});

await ctrl.register();      // ensures the device exists server-side
await ctrl.load();           // resolved controls map
ctrl.startPolling();         // background refresh (default 60s)

if (ctrl.flag("checkout_v2").isOn) showNewCheckout();
ctrl.track("checkout_v2", "impression");
See full docs for per-type reads, streaming, and offline behavior.
Behavior

Same contract, platform-appropriate lifecycle

AspectWeb / .NETFlutter / iOS / Android
Sync cadencePoll (default 60s) + SSE stream when supportedPoll + SSE stream; app foreground triggers refresh
Offline cacheBrowser localStorage / on-disk JSONPlatform-native persistent store
Screen captureBest-effort visual maskOS-level (FLAG_SECURE / iOS masking)
Public REST endpoints/register, /session, /sync, /controls (+ delta / SSE stream), /controls/events, /flags/ruleset, /flags/impressions

Vendor the SDK, create an account, ship a control.

Each SDK exposes a small, identical surface: initialize, read a flag, track an event.