Skip to main content
An adapter (BackendAdapter) is the vendor-neutral evaluate / capture / lifecycle backend behind FireweaveRuntime. You construct one adapter, pass it to the runtime, and share that runtime with FireweaveClient and (optionally) the OpenFeature provider. OpenFeature and the wire still say flagKey. Remote evaluate is POST /v1/flags/evaluate.

Why it exists

Application code should not import a vendor SDK or hold a vendor key on the intended FireWeave path. The runtime owns lifecycle, context bounds, and error mapping. The adapter owns HTTP (or fixtures).

When to use which

How it relates

Remote — FireweaveRemoteAdapter

Production HTTP client to fw-server. Auth: Authorization: Bearer <project key>. Current key prefix in the spec: project-api-key_…. Never send phc_ / phs_ / phx_ on this path. https is required off-loopback; http is loopback only. Host allowlists differ: Node/Web default to FireWeave hosts + loopback (app-server.fireweave.ai, staging-app-server.fireweave.ai, localhost). Python/Go/Java defaults include PostHog hosts + loopback. Whether app-server.fireweave.ai is the customer-facing URL is NEEDS VERIFICATION.
See Configuration for auth and allowlists.

In-memory — InMemoryAdapter

Deterministic fixture adapter for tests and offline quickstarts. Present in all five languages (Java: ai.fireweave.testing.InMemoryAdapter; Web: InMemoryWebAdapter). Fixture fields used in tests and SDK docs: type, enabled, value, variant, optional matchAttribute / MatchAttributes, payload, metadata.
Node also accepts fault, initError, initGate, and setFlags() for live mutation. Does not implement registerTarget. Registration returns UnsupportedCapability so a harness cannot look registered when it is not. InMemory is not the same class as the local/dev adapter. Node reports InMemory name: 'inmemory' and Local name: 'other'.

Local / dev — Node, Python, Web only

FireweaveLocalAdapter / FireweaveLocalWebAdapter plus makeFireweaveLocalProvider() / make_fireweave_local_provider().
  • Input: devFlags: Record<string, boolean> (Python equivalent)
  • Key present → mapped boolean, reason STATIC
  • Key absent → caller default (FLAG_NOT_FOUND rewritten to DEFAULT on the local provider only)
  • Boolean-only. Reading an overridden key as string/number → TypeMismatch
  • No network, no credentials, no exposure sink (exposureEmission: false)
Absent in Go and Java on master. This is not Node in-process secret-key local evaluation. That mode was removed in tree 2.1. Both shipped Node adapters report localEvaluation: false on the remote path; the Local adapter reports localEvaluation: true because it resolves in-process from devFlags.

PostHog extra (language-gated)

Do not document Node PostHogAdapter except on the 2.0 → 2.1 migration page.

Runtime relationship

Construct one runtime per backend. Share it.
  1. Create an adapter
  2. new FireweaveRuntime(adapter) (or language equivalent)
  3. initialize and wait for READY (Web may enter STALE if prefetch loses a 5s ceiling)
  4. Pass the runtime into FireweaveClient and/or FireweaveProvider
  5. shutdown once — flush rules differ on Java
Lifecycle states: UNINITIALIZED | INITIALIZING | READY | STALE | ERROR | FATAL | SHUTDOWN. Details: Lifecycle.
Last modified on August 18, 2026