Skip to main content
One state machine in every language:
OpenFeature mapping is on the OpenFeature page. Recommended pattern: one runtime per process per backend project, created at boot, shared, shut down once on exit.

Initialize

Init order: validate config → construct adapter → adapter init → READY. Configuration and auth failures are FATAL. Transient failures land in ERROR. Init is idempotent — registering an OpenFeature provider and constructing a FireweaveClient against the same runtime initializes once.
Default lazyReady: true: initialize() returns immediately, init continues in the background, and evaluations return defaults with PROVIDER_NOT_READY / fireweave.errorKind: NotReady until READY.Observe: runtime.getState(), runtime.onStateChange(listener).
Wait for READY before treating values as live. On Node, that means lazyReady: false or waiting for the READY event.

Shutdown and flush

Shutdown belongs to the runtime. It is idempotent. Default deadline: 10 s. Shutdown on Node/Python does not throw; flush failures are swallowed (telemetry loss is acceptable, evaluation correctness is not).
Java close() flushes nothing implicitly (client Javadoc). Always exposures().flush() then close(). Go’s runtime.Shutdown closes the adapter (the remote adapter’s Close posts adapter-pending capture events) but does not drain client.Exposures().
Web unload prefers keepalive fetch so it can send Authorization: Bearer. sendBeacon cannot set that header and is a fallback. Whether fw-server accepts an unauthenticated beacon is unverified — do not rely on it.
Injected vendor clients (PostHog extras on Python/Go) are your responsibility to close. FireWeave will not shut them down.

After shutdown

  • OpenFeature evaluations return defaults with PROVIDER_NOT_READY and flagMetadata["fireweave.errorKind"] = "AlreadyClosed".
  • Extension calls fail fast with AlreadyClosed.
  • A shut-down runtime is terminal. initialize() after shutdown fails with AlreadyClosed. Construct a new runtime.

Concurrency

Runtimes and clients are safe for concurrent evaluation on one instance (Go: race-tested; Java: volatile-state reads; Python: thread-safe sync core, fireweave.aio for asyncio; Node: single-threaded async). Evaluations racing shutdown either complete or observe AlreadyClosed — never a crash.

Next

Configuration and auth

Timeouts and credentials

Troubleshooting shutdown

Hangs, missing exposures, AlreadyClosed
Last modified on August 18, 2026