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 areFATAL. Transient failures land in ERROR. Init is idempotent — registering an OpenFeature provider and constructing a FireweaveClient against the same runtime initializes once.
- Node
- Python
- Go
- Java
- Web
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).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).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.After shutdown
- OpenFeature evaluations return defaults with
PROVIDER_NOT_READYandflagMetadata["fireweave.errorKind"] = "AlreadyClosed". - Extension calls fail fast with
AlreadyClosed. - A shut-down runtime is terminal.
initialize()after shutdown fails withAlreadyClosed. 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