Skip to main content
This walkthrough goes Install → Configure → Initialize → Register target → Evaluate → Record outcome → Shutdown. Examples use the deterministic in-memory adapter, so you do not need a network or a project key. Example keys match the SDK docs: new-checkout and user_42. OpenFeature and the wire still say flagKey. The product name is control point. Evaluation never throws — a failure returns your default.
Lead with the registry where the package is published (verified 2026-08-17): npm @fireweaveai/sdk@2.1.0 (latest = 2.1.0), @fireweaveai/web-sdk@2.1.0, and PyPI fireweave 0.1.0. Pin Node 2.1.0 — npm 2.0.0 is a different API (direct PostHog adapter and ./posthog). The Go module and Java 0.1.0-SNAPSHOT artifacts are still unpublished. Checkout remains an alternative for contributing or an unreleased tree.

Prerequisites

  • Node / Bun / Deno: Node.js ≥ 20.20, or Bun ≥ 1.2, or Deno ≥ 2.0. Optional peer @openfeature/server-sdk only if you use the provider.
  • Python: Python ≥ 3.10 and a virtualenv.
  • Go: Go 1.25. The module is unpublished — clone FireWeave-HQ/fireweave-sdk and use a replace directive.
  • Java: JDK 11+ and Maven. Clone the SDK repo; artifacts install to your local ~/.m2 as 0.1.0-SNAPSHOT.
  • Browser: A frontend toolchain. @fireweaveai/web-sdk@2.1.0 is on npm. The package reads no environment variables.
Offline steps need no FireWeave credentials. Production needs a project key (project-api-key_…) and a fw-server base URL — see Configuration.
1

Install

Use the published registry where it exists. Checkout is optional except for Go and Java.
npm latest is 2.1.0 (verified 2026-08-17). Pin it. 2.0.0 is still published and still ships PostHog / ./posthog.
Add @openfeature/server-sdk only if you use the provider. Deno can import { … } from 'npm:@fireweaveai/sdk' with no install step; that follows npm latest (2.1.0 today). Pin @2.1.0 in an import map if you need to stay off 2.0.0.
APIs on this page are from SDK master. The npm 2.1.0 tarball gitHead is fd19cad, not audit commit dfeb478NEEDS VERIFICATION that every snippet matches that tarball exactly. Checkout if you need a specific tree.
2

Configure

Construct an adapter and a runtime. In-memory fixtures use type, enabled, value, and variant.
3

Initialize

Wait until the runtime is usable before treating values as live. After shutdown, evaluations return defaults with AlreadyClosed.
4

Register a target

Node, Python, and Web can register durable properties (kind, properties). The call never throws (Node returns { ok, error? }). Go and Java have no registerTarget on master — skip this step and pass targetingKey on evaluate.
InMemoryAdapter / InMemoryWebAdapter do not implement registration. They return UnsupportedCapability so a harness does not look registered when it is not. The repo test-server stub also does not implement POST /v1/targets/register. This step is real against FireweaveRemoteAdapter (Node/Python/Web).
5

Evaluate a control point

Pass a stable targetingKey. Do not invent an SDK helper named fw.isOn — that API does not exist.
Detailed Decision: fireweave.controlPoints.evaluate('new-checkout', 'boolean', false, { targetingKey: 'user_42' }). client.flags is the same object as client.controlPoints (deprecated alias; not removed in 2.x).
Evaluate-path exposures are off unless you pass sendExposure: true (or the language equivalent). Default is false in every language.
6

Record an outcome

Optional for a first run; this completes the release-safety loop. recordOutcome is a signal (kind outcome), not releases.complete.
7

Shut down

One runtime, one shutdown. Node, Python, and Web flush exposures inside shutdown. Java does not.

Production (remote adapter)

Swap the in-memory adapter for FireweaveRemoteAdapter (Web: FireweaveRemoteWebAdapter). Auth is Authorization: Bearer <key>. Use a FireWeave project key (project-api-key_…), not a PostHog phc_ / phs_ / phx_ key.
Reads FW_API_URL and FW_PROJECT_API_KEY when omitted.
https is required off-loopback; http is loopback-only.
Which hostname is the customer-facing fw-server URL is not verified from the SDK repository. Set FW_API_URL / apiUrl / Java host from your project.

OpenFeature

You can evaluate through OpenFeature instead of (or in addition to) FireweaveClient. Extensions stay on the FireWeave client. Providers exist in all five packages. Tracking (OF spec §6) is not implemented. Node example (wait for READY; lazyReady defaults true on FireweaveProvider):
Per-language providers and resolver tables: OpenFeature.

Next steps

Last modified on August 18, 2026