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.
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.
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_FOUNDrewritten toDEFAULTon the local provider only) - Boolean-only. Reading an overridden key as string/number →
TypeMismatch - No network, no credentials, no exposure sink (
exposureEmission: false)
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.- Create an adapter
new FireweaveRuntime(adapter)(or language equivalent)initializeand wait for READY (Web may enter STALE if prefetch loses a 5s ceiling)- Pass the runtime into
FireweaveClientand/orFireweaveProvider shutdownonce — flush rules differ on Java
UNINITIALIZED | INITIALIZING | READY | STALE | ERROR | FATAL | SHUTDOWN. Details: Lifecycle.
Related
- Architecture — layers and wire paths
- Configuration — env vars, Java/Web exceptions
- Testing — InMemory fixtures
- Compatibility — adapter matrix