posthog-node
6.0.5 · 19 Nov 2026MIT23.9M / weekRepositorynpmAtom feed
5.74.0 is the newest release of 5.x.
In short
1 new
Release note
Minor Changes
Add
evaluateFlags()and a newflagsoption oncapture()so a single/flagsrequest powers both flag branching and event enrichment per incoming request:const flags = await posthog.evaluateFlags(distinctId, { personProperties: { plan: 'enterprise' } }) if (flags.isEnabled('new-dashboard')) { renderNewDashboard() } posthog.capture({ distinctId, event: 'page_viewed', flags })The returned
FeatureFlagEvaluationssnapshot exposesisEnabled(),getFlag(),getFlagPayload()for branching, plusonlyAccessed()andonly([keys])for filtering which flags get attached to a captured event. PassflagKeys: [...]toevaluateFlags()to scope the underlying/flagsrequest itself.captureException()/captureExceptionImmediate()accept aflagsargument so$exceptionevents carry the same flag context as the rest of your request's events.Deprecates
isFeatureEnabled(),getFeatureFlag(),getFeatureFlagPayload(), andcapture({ sendFeatureFlags }). They continue to work but now log a deduped[PostHog] ... is deprecatedwarning the first time they're used. Removal is planned for the next major version. (2026-05-02)
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.