github PostHog/posthog-js @posthog/core@1.71.0

one hour ago

1.71.0

Minor Changes

  • #5990 a393b4f Thanks @turnipdabeets! - PostHogCoreBase merges a caller $groups over the registered groups on that event, the caller's key winning per group type, and capture() and identify() no longer register it; PostHogCore keeps its behavior
    (2026-12-03)

  • #5990 a393b4f Thanks @turnipdabeets! - Let SDKs on capture v1 keep only the events capture didn't accept, halve a batch after a 413, and cap batches by event bytes, through opt-in sendBatch() outcomes, batch byte and resend size hooks, and a hold on flushes that shutdown() waits out when it fits in its timeout; SDKs that don't use them are unchanged.
    (2026-12-03)

  • #5990 a393b4f Thanks @turnipdabeets! - Add the @posthog/core/capture-v1 entry point, the Capture V1 transport the PostHog SDKs share. It follows semver like the rest of @posthog/core, so an installed SDK keeps working with a newer core; CaptureError, CaptureDroppedEvent, CaptureErrorParams and CaptureEndpoint are also exported by posthog-node.
    (2026-12-03)

  • #5990 a393b4f Thanks @turnipdabeets! - Mark a capture v1 send whose request timed out with timedOut on its deferral, so an SDK can resend those events in smaller batches
    (2026-12-03)

  • #5990 a393b4f Thanks @turnipdabeets! - - Accept capture options on alias(), setPersonProperties() and unsetPersonProperties(), apply identify()'s capture options to the $set event it sends for an already-identified user, and show an event's options to before_send

    • Fix setPersonProperties() ignoring a repeat call with the same properties after before_send dropped the earlier $set event or changed its distinct ID, $set or $set_once, or after that event was sent without person processing. A repeat call is now skipped only when the same properties went out on a $set event that processes the person (2026-12-03)
  • #5990 a393b4f Thanks @turnipdabeets! - - Accept sendFeatureFlagEvent as the per-call option of getFeatureFlag(), getFeatureFlagResult() and isFeatureEnabled(); it takes precedence over sendEvent

    • Add PostHogCoreBase, the client core without getFeatureFlagPayload(), getFeatureFlagPayloads(), getFeatureFlags(), getFeatureFlagsAndPayloads(), onFeatureFlag(), overrideFeatureFlag(), onFeatureFlags() and reloadFeatureFlagsAsync(), so an SDK can define its own. On PostHogCoreBase, a flag whose variant is an empty string reads as disabled, $active_feature_flags lists only enabled flags, bootstrapped string payloads stay strings, getAllFeatureFlags() returns undefined until flags are cached, $feature_flag_called carries $used_bootstrap_value only for a bootstrapped flag, and getFeatureFlag() returns undefined for a flag that isn't in the loaded flags. An SDK can override getFlagsRequestTimezone() to send timezone with /flags requests. PostHogCore keeps all of these unchanged
    • PostHogCoreBase lets a registered or caller $is_identified or $process_person_profile win (a null $process_person_profile counts as unset; a null $is_identified stays), sends the process_person_profile: false capture option instead of a $process_person_profile property on personless events, passes a capture call's options on to the queued event, leaves a registered $process_person_profile off identity and person-update events ($identify, $create_alias, $groupidentify, $set, $set_once, $merge_dangerously) and stamps person state on $autocapture events; PostHogCore keeps its behavior
    • Add isEnabledFlagValue(), which tells whether a flag value is on
    • Deprecate the per-call sendEvent option in favor of sendFeatureFlagEvent
    • Fix feature flags loaded for the previous user being stored and emitted when reset() runs during a flag request (2026-12-03)
  • #5990 a393b4f Thanks @turnipdabeets! - PostHogCoreBase lets a registered property replace the SDK's own value of the same name, fills $lib and $lib_version as a pair after the caller's properties, and lets a registered or caller $session_id or $geoip_disable win, with a per-call disableGeoip winning over a registered $geoip_disable and a caller $geoip_disable winning over both; PostHogCore keeps its behavior
    (2026-12-03)

  • #5990 a393b4f Thanks @turnipdabeets! - Add timedOut to SendBatchOutcome, which keeps the batch's events and halves the batch size for the next flush
    (2026-12-03)

Patch Changes

  • #5990 a393b4f Thanks @turnipdabeets! - Send a capture v1 request body uncompressed when compressing it takes longer than the request timeout, instead of waiting on the compressor
    (2026-12-03)

  • #5990 a393b4f Thanks @turnipdabeets! - Take the capture v1 sender's token as projectToken, and keep reading the deprecated apiKey from SDK builds that still pass it
    (2026-12-03)

  • #5990 a393b4f Thanks @turnipdabeets! - Let an SDK with its own gzip, such as React Native's native plugin, also compress the requests core sends, such as OTLP logs, where CompressionStream is missing
    (2026-12-03)

  • #5990 a393b4f Thanks @turnipdabeets! - Fix getAllFeatureFlags() on PostHogCore listing a flag set only with overrideFeatureFlag() without its key
    (2026-12-03)

  • #5990 a393b4f Thanks @turnipdabeets! - - identify() with a whitespace-only distinct ID logs a warning and does nothing, instead of saving it as the distinct ID; identify('') still sends $set for the current user

    • Keep a registered $cookieless_mode, $ignore_sent_at or $product_tour_id on minimal $feature_flag_called events
    • Log only the type of an error a before_send function throws, not the error
    • Add the protected generateEventUuid(), which an SDK can override to choose how event uuids are made
    • identify() and setPersonProperties() no longer throw for person properties that can't be serialized, such as a BigInt; they skip the duplicate check instead
    • The capture v1 sender stops its compression deadline timer when the send is aborted, such as by shutdown(), and stamps PostHog-Request-Timestamp after compressing the body (2026-12-03)

Don't miss a new posthog-js release

NewReleases is sending notifications on new releases.