SIGN IN SIGN UP

feat(node): isEnabled() accepts a caller-supplied default value (#4484)

* feat(node): FeatureFlagEvaluations.isEnabled() accepts a caller-supplied default value

Brings `isEnabled()` into compliance with the cross-SDK `is-feature-enabled` contract in PostHog/sdk-specs: a hard `SHALL`, `@both`-tagged requirement that the SDK accept a caller-supplied boolean default and return it whenever the flag has no value (missing key, not loaded, failed request) — while any present value, including `false` and variant strings, always wins over the default.

Flagged in the sdk-specs compliance matrix (posthog-node.md#n11, "Is Feature Enabled — Fail"): neither `isFeatureEnabled()` (deprecated) nor its successor `FeatureFlagEvaluations.isEnabled()` accepted a caller default, hardcoding `false` on a miss. Since `isFeatureEnabled()` is deprecated, this fix targets the non-deprecated successor instead.

Purely additive — `defaultValue: boolean = false` is a new optional parameter; omitting it preserves byte-for-byte identical behavior.

Generated-By: PostHog Code
Task-Id: 50720824-50da-498f-a6c8-66a6c223979a

* fix(node): accept isEnabled default through options

---------

Co-authored-by: posthog[bot] <206114724+posthog[bot]@users.noreply.github.com>
Co-authored-by: Manoel Aranda Neto <marandaneto@gmail.com>
P
posthog[bot] committed
557140e4bb344eb22b5bbd1d324487b3fcef895e
Parent: 4451274
Committed by GitHub <noreply@github.com> on 8/21/2026, 1:53:17 PM