@fireweaveai/sdk is the FireWeave server SDK for JavaScript runtimes. It evaluates control points, optionally registers targets, drives a release lifecycle, and records exposures and signals. OpenFeature and the wire protocol still use the parameter name flagKey.
FireWeave is pre-release. Package names and the MIT license await company ratification. Do not redistribute packages built from the SDK repository until publication is authorized.
Supported runtimes
Frompackage.json#engines and the SDK runtime docs:
The package is ESM, has zero runtime dependencies, and a peer of
@openfeature/server-sdk ^1.22.0 (needed only if you use the OpenFeature provider).
The native FireWeave surface (control points, targets, releases, exposures, signals, capabilities) is covered on Node, Bun, and Deno. The OpenFeature provider import is gated by Node/Bun CI. Deno’s npm compatibility layer is used for
@openfeature/server-sdk but is not asserted by this repo’s smoke job.Install
- npm 2.1.0
- From checkout
Published versions on npm: Bun:An unpinned
0.1.0, 2.0.0, 2.1.0. Dist-tag latest is 2.1.0 (verified 2026-08-17).npm install @fireweaveai/sdk currently resolves to 2.1.0. Pin anyway so you do not silently land on 2.0.0 if tags move.Deno needs no install step:Initialize
Build an adapter, aFireweaveRuntime, then a FireweaveClient and/or FireweaveProvider. There is no hidden global client.
FireweaveProvider defaults lazyReady to true: initialize returns immediately and evaluations surface NotReady until the runtime is READY. Pass { lazyReady: false } (as above) to wait.
Lifecycle states: UNINITIALIZED | INITIALIZING | READY | STALE | ERROR | FATAL | SHUTDOWN. Default shutdown timeout is 10000 ms.
Configuration and authentication
FireweaveRemoteAdapter is the production adapter. It speaks POST /v1/flags/evaluate and POST /v1/capture (and POST /v1/targets/register). Auth on the wire is Authorization: Bearer <key>.
FireweaveRuntimeConfig also accepts projectApiKey, host, allowedHosts, requireTargetingKey, limits, reservedAttributeKeys, shutdownTimeoutMs.
Other env:
FW_DEPRECATION_WARNINGS=1— one notice per process when you use theclient.flagsalias.- Deno:
readEnv()treats a denied--allow-envas absence. PassapiUrlandapiKeyexplicitly if you do not want--allow-env.
DEFAULT_ALLOWED_HOSTS): app-server.fireweave.ai, staging-app-server.fireweave.ai, localhost, 127.0.0.1, ::1. https is required off-loopback; http is allowed on loopback only. Pass allowedHosts: ['*'] to opt out of host pinning.
Whether
app-server.fireweave.ai is the customer-facing production host is NEEDS VERIFICATION (named in the allowlist; not proven live from the SDK repo). Current key prefix in the spec is project-api-key_…. Never send PostHog phc_ / phs_ / phx_ keys on this path.x-api-key. This adapter documents Bearer. Whether it also sends x-api-key is NEEDS VERIFICATION.
See Configuration and auth.
Targets
RegisterTargetOptions: kind?: 'user' | 'device', properties?, environment?, signal?. Returns { ok, error? } and never throws (login-path contract). Wire: POST /v1/targets/register.
InMemoryAdapter and FireweaveLocalAdapter do not implement registration — they report UnsupportedCapability so a harness does not look registered when it is not.
See Targeting and targets.
Control points
OpenFeature and the wire still sayflagKey. The product name is control point. client.controlPoints is the native API. client.flags is the same object (deprecated JSDoc alias; not scheduled for removal in 2.x).
Types (ExpectedFlagType): 'boolean' | 'string' | 'number' | 'object'. 'number' is a single IEEE-754 double. Integers beyond ±(2^53−1) are not lossless.
getBooleanValue, getStringValue, getNumberValue, getObjectValue. evaluate returns a Decision and never throws — failures are reason: ERROR with the caller default.
EvaluateOptions: includePayload?, sendExposure? (default false), signal?.
See Control points.
Releases
ReleaseContext requires rolloutId (1–128 characters) and stampIds (stmp_ + 26 Crockford characters, 1–64 unique). Optional changeId (chg_ + 26).
Whether release transitions always reach fw-server (versus in-process record) is NEEDS VERIFICATION. Compatibility notes a delivery skew across languages.
Exposures
Evaluate-path emission is opt-in.sendExposure defaults to false. Record explicitly, then flush.
(targetingKey, flagKey, variant, value). shutdown() flushes exposures first.
See Exposures.
Signals
Kinds:health | error | metric | outcome.
DEFAULT_SIGNAL_ATTRIBUTE_ALLOWLIST): name, kind, status, value, unit, rolloutId, changeId, stampId, errorKind, message, flagKey, variant, environment, service.
See Signals and outcomes.
Capabilities
guardrails.evaluate is a typed stub: every call degrades with UnsupportedCapability. Do not treat guardrails as a working feature.
See Capabilities.
Adapters
./posthog export and no in-process local evaluation (secret-key poll) on 2.1. Both shipped adapters report localEvaluation: false.
See Adapters and Testing.
OpenFeature
FireweaveProvider — runsOn = 'server', metadata name 'fireweave'.
Resolvers: resolveBooleanEvaluation, resolveStringEvaluation, resolveNumberEvaluation, resolveObjectEvaluation.
Options: includePayload?, sendExposure? (default false), lazyReady? (default true).
Releases, exposures, signals, targets, and capabilities live on FireweaveClient, not on the OpenFeature client. OpenFeature Tracking (spec §6) is not implemented.
See OpenFeature.
Errors
Single classFireweaveError with 15 kinds: NotReady, FlagNotFound, TypeMismatch, InvalidContext, Authentication, Authorization, RateLimited, Timeout, Network, BackendUnavailable, MalformedResponse, UnsupportedCapability, Configuration, AlreadyClosed, Internal.
Evaluation never throws. Helpers: isFireweaveError, ERROR_TAXONOMY, redactSecrets.
See Errors.
Testing
UseInMemoryAdapter so nothing needs a network. The repo test-server stub implements POST /v1/flags/evaluate, POST /v1/capture, and GET /health. It does not implement POST /v1/targets/register.
See Testing.
Shutdown
AlreadyClosed.
See Initialize, ready, shutdown.
Not in this SDK (2.1)
@fireweaveai/sdk/posthog/PostHogAdapter/posthog-nodepeer — removed. Stay on 2.0.0 only if you still need that path.- In-process local evaluation (
onlyEvaluateLocally, secret-key definition poll). - Working guardrails.
- OpenFeature Tracking.
Next
Quickstart
Offline evaluate in every language.
Compatibility
Type split, adapters, and conformance.
Migrate from 2.0.0
The three 2.1 breaking changes, quoted from the CHANGELOG.