Packages

posthog-node

6.0.5 · 19 Nov 2026MIT23.9M / weekRepositorynpmAtom feed

Your version

5.33.0

2 May 2026Where it was published

5.74.0 is the newest release of 5.x.

In short

1 new

Release note

Minor Changes

  • Add evaluateFlags() and a new flags option on capture() so a single /flags request 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 FeatureFlagEvaluations snapshot exposes isEnabled(), getFlag(), getFlagPayload() for branching, plus onlyAccessed() and only([keys]) for filtering which flags get attached to a captured event. Pass flagKeys: [...] to evaluateFlags() to scope the underlying /flags request itself. captureException() / captureExceptionImmediate() accept a flags argument so $exception events carry the same flag context as the rest of your request's events.

    Deprecates isFeatureEnabled(), getFeatureFlag(), getFeatureFlagPayload(), and capture({ sendFeatureFlags }). They continue to work but now log a deduped [PostHog] ... is deprecated warning 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.