Fixes race conditions, unhandled rejections, SSE reconnect state, deterministic variant hashing, and renames FlagifyFlaggy to FlagifyFlag.
Critical fixes
- Race condition prevention — deduplicate concurrent refetch calls to prevent overlapping flag syncs
- Config validation — throw on missing
projectKeyorpublicKeyinstead of silently failing - Secret key header — send
secretKeyasx-secret-keyheader when provided (server-side evaluation) - Deterministic variant distribution — use FNV-1a hash for consistent A/B test assignment across sessions
High-severity fixes
- Frozen HTTP headers — prevent mutation of API key headers after client initialization
- Multiline SSE support — handle multiline
data:fields per the SSE specification - React hooks loading state — hooks return
undefinedbefore client is ready, preventing flash of wrong content - NestJS typed constants — use typed constant key instead of untyped
anycast in middleware - Astro single init — middleware initializes client only once, skipping env reads on subsequent requests
- Cookie security — restrict cookie overrides to dev environment only
Medium-severity improvements
- Rename
FlagifyFlaggytoFlagifyFlag— professional public API naming - Event emitter pattern — replace single
onFlagChangecallback withon/offevent emitter - Project key header — send
projectKeyasx-project-keyheader in all HTTP requests - React hooks optimization — replace void version hack with
useMemo - Fetch timeout — add 10s timeout to all fetch calls via
AbortSignal.timeout - Retry with backoff — initial
syncFlagsretries once with 1s delay on failure - Provider reactivity —
FlagifyProviderrecreates client whenuser,realtime, orpollingoptions change - JSDoc fix — correct API URL from
api.flagify.apptoapi.flagify.dev
Low-severity fixes
- Unhandled promise rejection — catch
evaluateWithUserpromise inonInitialSynccallback - SSE reconnect state — reset
hasConnectedBeforeon disconnect so reconnect firesonConnectedcorrectly
Packages affected
@flagify/node@flagify/react@flagify/nestjs@flagify/astro