Skip to main content
This walkthrough goes Install → Initialize → Register target → Evaluate → Shutdown. Examples use local mode, so you do not need a network or a project key. Example keys match the SDK docs: new-checkout and user_42. The wire protocol still says flagKey. The product name is control point. Evaluation never throws — a failure returns your default. mode is required and never inferred. Remote without credentials is a boot error. The SDK never falls back to local.

Prerequisites

  • Node / Bun / Deno: Node.js >=20.20, or Bun >=1.2, or Deno >=2.0.
  • Python: Python >=3.10 and a virtualenv.
  • Go: Go 1.25.13 or later. The module path requires the /v2 suffix.
  • Java: JDK 11+.
  • Rust: Rust 1.75 or later.
  • Browser: A frontend toolchain. Use a fw_public_ key in production — see Configuration.
Offline steps need no Fireweave credentials. Production needs a project key and a fw-server base URL. Pass them as explicit init options. The SDK reads no environment variables.
1

Install

Packages published 2026-09-09 at 2.3.0.
Install @fireweaveai/server-sdk. Do not install @fireweaveai/sdk — that name is frozen at 2.1.0.
Bun:
Deno needs no install step:
2

Initialize

Call the language entry point with mode: 'local' and a seeded map. Init fails loudly on bad configuration. Reads on the returned client never throw.
3

Register a target

Register durable properties once per login. The call never throws. Check ok — a silently unregistered target is how targeting rules match nobody.In local mode the adapter records the target in-process, emits a [fireweave:local] trace line, and returns { ok: true }. Nothing is sent to fw-server.
4

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.getBooleanDetails('new-checkout', false, { targetingKey: 'user_42' }).
A v1 read is side-effect free. It does not record exposures or emit telemetry because you called it.
5

Shut down

One runtime, one shutdown.

Production (remote mode)

Swap local mode for mode: 'remote' and pass apiUrl / apiKey (or the language equivalent) as explicit options. The SDK does not read FW_API_URL or FW_PROJECT_API_KEY. Your app may read those itself and pass them in. Auth is Authorization: Bearer <key>. Use a Fireweave project key (project-api-key_…), not a PostHog phc_ / phs_ / phx_ key. In the browser, use a fw_public_ key — see Configuration.
https is required off-loopback; http is loopback-only.
Set the fw-server URL from your project. A self-hosted host must appear in allowedHosts, or pass ['*'] / language equivalent to opt out of the allowlist.

Next steps

Last modified on September 11, 2026