Why @xtandard/flags
Why another flag tool?
Section titled “Why another flag tool?”Unleash / Flagsmith / GO Feature Flag are great, but most assume a server in (or
near) the request path and a heavier deployment. @xtandard/flags owns a narrow,
sharp gap:
- 🏠 Self-hosted OpenFeature admin — your data, your infra, no SaaS.
- 🔌 Pluggable storage — memory, file, Redis, Postgres, MongoDB, SQLite, libSQL/Turso, Cloudflare KV, or any unstorage driver. Bring your own with four methods.
- ⚡ Local-first evaluation — a tiny, zero-dependency evaluator + provider run in-process (JS/TS). The panel can be offline.
- 🌐 Any language, standard protocol — every other language evaluates over OFREP (the OpenFeature Remote Evaluation Protocol): point any OpenFeature SDK’s generic OFREP provider at the panel — no vendor SDK to write or install.
- 🧩 Embeddable or standalone — mount the panel in your app, or run the Docker image.
- 📦 One npm package — explicit subpath exports, optional peer deps; install only what you use.
- 🎛️ Bundled admin SPA — consumers mounting the panel don’t install React.
It is intentionally not a LaunchDarkly clone: no experiment analytics, no hosted SaaS, no mandatory Redis/Postgres/auth. Batteries included, not required — everything official is just an implementation of a public contract you can replace.
How it works — the two planes
Section titled “How it works — the two planes”flowchart LR
subgraph Admin["🛠️ Admin / control plane"]
direction TB
UI["Admin UI / CLI"] --> API["JSON API"]
API --> SRC[("Source storage<br/>drafts · history · audit")]
API -- "publish → compile<br/>immutable snapshot" --> RT[("Runtime storage<br/>published snapshots")]
end
subgraph App["🚀 Application runtime"]
direction TB
PROV["OpenFeature provider"] -- "load snapshot once" --> MEM[["In-memory snapshot"]]
MEM --> EVAL["Evaluate in-process<br/>(zero deps, never throws)"]
PROV -. "background refresh<br/>(poll or watch)" .-> RT
end
RT --> PROV
| Plane | What | Reads / writes |
|---|---|---|
| Admin / control plane | UI + JSON API + CLI | reads/writes source storage; compiles immutable snapshots; publishes to runtime storage |
| Application runtime | OpenFeature provider | loads a whole snapshot into memory; evaluates in-process; refreshes in the background |
type FlagsPanelOptions = { sourceStorage: FlagsStorage; // canonical: drafts, history, audit runtimeStorage?: FlagsStorage; // published snapshots (default = sourceStorage)};