Packages

@posthog/types

1.427.1 · 23 Nov 2026MIT38.9M / weekRepositorynpmAtom feed

Your version

283 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 1.427.1

    23 Nov 2026
    • Capture the Snapchat click ID as sccid when the landing URL spells it ScCid or SsCid. When mask_personal_data_properties is on, also mask ScCid, SsCid and sscid in captured URLs, including landing URLs stored by older SDK versions.
      (2026-11-23)

  2. 1.427.0

    19 Nov 2026
    • Add an explicit per-select session replay masking policy.
      (2026-11-19)

  3. 1.426.0

    19 Nov 2026
    • Add opt-in require_subresource_integrity to verify lazy-loaded extension scripts against SHA-384 hashes built into the trusted SDK bundle; it disables site apps and the toolbar and doesn't cover the initial loader unless pinned, third-party widgets or a malicious release with valid hashes.
      (2026-11-19)

  4. 1.425.1

    13 Nov 2026
    • When the experimental metrics.flags option is on, the browser SDK splits each /flags attempt that gets a response into three histograms with the same attributes as posthog.flags.request.duration. posthog.flags.request.pre_send_duration runs from dispatch until the request starts, which includes body compression. posthog.flags.request.network_duration runs from the request start until the last byte of the response arrives, taken from the request's Resource Timing entry. posthog.flags.request.main_thread_duration runs from that last byte until the SDK's callback runs, which includes reading and parsing the response body. The three add up to the total. An attempt records them only when the browser reports its Resource Timing entry within 5 seconds of the callback and that entry can't belong to another /flags request that this copy of the SDK sends to the same URL, so it may record the total without them. posthog.flags.request.duration is unchanged. The option, the metric names, and their attributes may change or be removed in any release.
      (2026-11-13)

  5. 1.425.0

    13 Nov 2026
    • Add trace_propagation_targets: an opt-in allowlist of hostnames or origins that receive a W3C traceparent header on fetch and XMLHttpRequest requests, so backend traces can continue from the browser. Unlisted hosts never get the header, and a traceparent set by the app or by OpenTelemetry instrumentation is never overwritten or duplicated.
      (2026-11-13)

  6. 1.424.1

    12 Nov 2026
    • metrics: Export browser metrics once a minute by default instead of every 10 seconds. Every tab of an app writes to the same series, so busy series exceeded the backend's per-series point limit and were undercounted. An explicit metrics.flushIntervalMs still wins.
      (2026-11-12)

    • metrics: metrics.network no longer records server-sent event streams. A text/event-stream response stays open for as long as the page listens, so it was timed as a request lasting minutes and pinned the duration percentiles to the top bucket.
      (2026-11-12)

  7. 1.424.0

    11 Nov 2026
    • Add imageUrl to the EarlyAccessFeature type
      (2026-11-11)

  8. 1.423.0

    10 Nov 2026
    • node: Expose traceId and spanId getters on the Span handle, for correlating logs from other loggers with a trace without parsing traceparent()
      (2026-11-10)

    • Warn once in the console, even outside debug mode, when the bot user agent filter drops events, and document that captureLog logs bypass the filter.
      (2026-11-10)

  9. 1.422.0

    9 Nov 2026
    • node: Expose traceId and spanId getters on the Span handle, for correlating logs from other loggers with a trace without parsing traceparent()
      (2026-11-09)

  10. 1.421.1

    6 Nov 2026
    • Mask hidden input values in session replay when maskAllInputs is enabled, and accept hidden in maskInputOptions.
      (2026-11-06)

  11. 1.421.0

    5 Nov 2026
    • metrics.histogram() accepts a bounds option that sets the histogram's bucket boundaries, and beforeSend sees and can change them. The first sample of a histogram (name and unit) fixes its bounds until the client resets. A later sample with different bounds is recorded in the fixed buckets and logs a warning, and a sample with invalid bounds is dropped. The experimental posthog.flags.request.duration histogram now uses the bounds [50, 75, 100, 150, 200, 300, 400, 500, 750, 1000, 1500, 2000, 3000, 5000, 10000] ms, so its p50 and p95 resolve between 50ms and 5s. This changes the metric's buckets, which its experimental status allows.
      (2026-11-05)

  12. 1.420.0

    4 Nov 2026
    • Add the experimental metrics.flags option. When it is on, the browser SDK records the round trip of every /flags HTTP attempt as the histogram posthog.flags.request.duration, with the server host, the response status or error type, and the browser's timezone as attributes. The option, the metric name, and its attributes may change or be removed in any release.
      (2026-11-04)

  13. 1.419.0

    30 Oct 2026
    • Add support widget theming: conversations.theme init option, posthog.conversations.setTheme(), dark mode, and --ph-conv-* CSS custom properties
      (2026-10-30)

  14. 1.418.0

    28 Oct 2026
    • Add $input_value to autocapture change events for fields marked data-ph-capture-value, or matched by the new autocapture.capture_value_css_selector_allowlist option (CSS selectors or an (element) => boolean predicate).
      (2026-10-28)

  15. 1.417.0

    27 Oct 2026
    • Add defaults: 'latest' to follow the newest defaults and report the applied date in events.
      (2026-10-27)

  16. 1.416.1

    26 Oct 2026
    • Correct the documented default for synchronous session replay fetch capture.
      (2026-10-26)

  17. 1.416.0

    13 Oct 2026
    • Attach trace exemplars to metrics recorded inside sampled spans.
      (2026-10-13)

  18. 1.415.3

    12 Oct 2026
    • Fix before_send callback types to accept non-null events while still allowing null returns to drop events.
      (2026-10-12)

  19. 1.415.2

    8 Oct 2026
    • replay: Add a private opt-in to preserve application stacks for failed fetch requests
      (2026-10-08)

  20. 1.415.1

    6 Oct 2026
    • Stop carousel and pager arrow controls from capturing false $rageclick events. The rageclick content ignorelist, active from the 2025-11-30 config defaults, now also covers arrow glyphs (→, ←, ›, ‹, », «, ▶, ◀, ❯, ❮). The built-in word keywords match whole words wherever they appear, including inside a list you pass yourself, so "Preview" keeps capturing; other word keywords you add still match as substrings. Keywords now match against the clicked control (the nearest button, link, ARIA control or cursor: pointer wrapper), reading its label from the control's whole subtree instead of every ancestor up to the body, so a region labelled "Featured carousel" no longer suppresses the buttons inside it. A control's own text or aria-label wins over an icon's aria-label inside it, so clicking the icon and clicking the text agree. Set rageclick: { content_ignorelist: false } to keep capturing these events.
      (2026-10-06)

  21. 1.415.0

    6 Oct 2026
    • Capture WebMCP tool intent and model metadata by default.
      (2026-10-06)

  22. 1.414.0

    6 Oct 2026
    • Add opt-in WebMCP tool call capture for MCP Analytics.
      (2026-10-06)

  23. 1.413.0

    29 Sep 2026
    • Add onActiveMatchingSurveysChanged to subscribe to survey eligibility updates with safe unsubscribe and recoverable load-error reporting.
      (2026-09-29)

  24. 1.412.4

    21 Sep 2026
    • Retry /flags in the browser SDK on HTTP 502/504 and on request timeouts, bounded by the new feature_flag_request_max_retries config (default 1, set 0 to disable). Plain transport failures are deliberately left to the existing status-zero circuit breaker.
      (2026-09-21)

  25. 1.412.3

    21 Sep 2026
    • Stop dropping long spans that end: maxSpanAgeMs now evicts spans only once maxLiveSpans is reached, so a span that runs past the age limit and then ends is exported, and its children are no longer orphaned.
      (2026-09-21)

  26. 1.412.2

    17 Sep 2026
    • Rename the metrics.network default attributes to the OTel HTTP client semantic conventions: http.request.method, server.address, server.port, url.scheme, url.template, http.response.status_code and error.type replace method, host, path and status_class.
      (2026-09-17)

  27. 1.412.1

    15 Sep 2026
    • Docstrings for identity_hash and setIdentity() now say the hash is signed with the Secret API key from Support settings, not a project secret API key or a personal API key.
      (2026-09-15)

  28. 1.412.0

    14 Sep 2026
    • Add metrics.network config to record HTTP and HTTPS fetch and XMLHttpRequest durations as histograms, with an optional custom metric name and attributes.
      (2026-09-14)

  29. 1.411.1

    11 Sep 2026
    • Back off automatic feature flag refreshes on idle visible pages only when remote_config_refresh_interval_ms is omitted, preserving explicitly configured intervals.
      (2026-09-11)

  30. 1.411.0

    10 Sep 2026
    • Add experimental distributed tracing to posthog-node: startSpan, withSpan and getActiveSpan record spans against a new traces client option. A service with tracing off still forwards an inbound traceparent, including from spans nested inside the one that received it, so a distributed trace is not severed. A traceparent may be passed as the one-element array req.headersDistinct gives. A beforeSpanSend hook sees every span before it is exported and may edit or drop it, and maxAttributesPerSpan, maxEventsPerSpan, maxAttributeValueLength, maxLiveSpans and maxSpanAgeMs bound what a single span and a single process may hold.
      (2026-09-10)

  31. 1.410.1

    10 Sep 2026
    • Allow null bootstrap values and treat null or empty distinct IDs as missing.
      (2026-09-10)

    • Log a console message when advanced_disable_feature_flags stops surveys from displaying
      (2026-09-10)

  32. 1.410.0

    9 Sep 2026
    • Segment integration: allow segment to accept an integration config with filterProperties, so customers can filter PostHog-generated enrichment properties before Segment sends an event to its destinations. Returning null or throwing leaves the original Segment event unenriched.
      (2026-09-09)

    • Fix dead-click detection for text selection and editable caret gestures when mouse release is delayed, while continuing to report inert text clicks.
      (2026-09-09)

    • web: Avoid reporting clicks that select or unselect text as dead clicks
      (2026-09-09)

  33. 1.409.4

    9 Sep 2026
    • Apply replay URL privacy settings to URL values in captured JSON-LD payloads.
      (2026-09-09)

  34. 1.409.3

    9 Sep 2026
    • Include the masked page URL with JSON-LD replay events.
      (2026-09-09)

  35. 1.409.2

    8 Sep 2026
    • Prefer sendBeacon for unbatched events, such as { send_instantly: true } captures, once PostHog's own pagehide handler (or unload fallback) marks the page as unloading. Captures from beforeunload or earlier pagehide listeners retain their normal transport. Preserve response-capable transports on active pages so failed requests can be retried, including when fetch is unavailable.
      (2026-09-08)

  36. 1.409.1

    7 Sep 2026
    • Clarify feature flag return-value terminology across SDK APIs. A false value is a conclusive off evaluation, while undefined means no evaluation is available. Remote evaluation omits globally inactive flags, whereas backend local evaluation can resolve cached inactive definitions to false.
      (2026-09-07)

    • Preserve universally safe JSON-LD properties and allowlisted tree structure when replay redacts other fields. Keep only DOM-backed ID fragments. Keep only @type values shaped like a Schema.org term, and limit types and payloads. Publish a reusable sanitization contract fixture.
      (2026-09-07)

  37. 1.409.0

    4 Sep 2026
    • Add reuseAnonymousId support to browser identify calls.
      (2026-09-04)

  38. 1.408.1

    3 Sep 2026
    • Require a distinct ID when calling identify and correct its API documentation to match the existing runtime validation.
      (2026-09-03)

  39. 1.408.0

    2 Sep 2026
    • Forward generic server-signed identity claims with conversations widget requests.
      (2026-09-02)

  40. 1.407.2

    1 Sep 2026
    • Document the session replay input masking defaults in the session_recording config reference: inputs are masked by default, password inputs stay masked on a partial maskInputOptions override, non-input text and images need maskTextSelector, and client-side masking options override the project privacy setting.
      (2026-09-01)

  41. 1.407.1

    28 Aug 2026
    • Session replay can now bound DOM mutation bytes with an opt-in budget. Set __mutationBytesBucketSize (e.g. 1MB) to enable: mutations beyond the sustained budget (__mutationBytesRefillRate, default 25KB/s) are dropped and the recording resyncs with a full snapshot, keeping recordings from apps with very high DOM churn playable. Off by default.
      (2026-08-28)

  42. 1.407.0

    26 Aug 2026
    • Add the 2026-08-30 config defaults. These defaults enable sanitized JSON-LD replay events.
      (2026-08-26)

  43. 1.406.2

    26 Aug 2026
    • Capture paste interactions with clipboard autocapture without collecting pasted text.
      (2026-08-26)

    • Add opt-in Schema.org JSON-LD capture to session replay through session_recording.captureJsonLd. When enabled, the recorder emits sanitized JSON-LD as custom replay events and excludes all script elements from replay snapshots.
      (2026-08-26)

  44. 1.406.1

    25 Aug 2026
    • browser: Refresh configured feature flags when a hidden tab becomes visible

      Feature flags now own their automatic refresh timer and visibility listener.
      Hidden tabs reload due flags when they become visible. The existing five-minute
      default and remote_config_refresh_interval_ms behavior remain unchanged. (2026-08-25)

  45. 1.406.0

    25 Aug 2026
    • Web vitals now capture attribution by default for INP and LCP, so a slow interaction or paint arrives with the target element and phase breakdown that make it diagnosable. CLS stays without attribution by default, because its attribution holds detached DOM nodes and can leak memory in single-page apps. Set capture_performance.web_vitals_attribution to false to opt out, true for every metric, or an array to name the metrics. The captured metric also drops the empty entries array and bounds attribution to a small set of useful fields, and the attributed INP observer no longer collects the processedEventEntries we never read.
      (2026-08-25)

  46. 1.405.3

    24 Aug 2026
    • Drop exceptions thrown by user scripts the browser injects into every page (Firefox for iOS, Chrome for iOS) instead of reporting them as the page's own errors. Set error_tracking.captureExtensionExceptions: true to keep capturing them.
      (2026-08-24)

  47. 1.405.2

    24 Aug 2026
    • Add granular automatic pageview options for SPA navigation

      capture_pageview now accepts an object with path, search, and hash options. Each selected URL component triggers a $pageview when it changes, including direct hash changes used by hash-based routers. The existing 'history_change' option continues to capture pathname changes. (2026-08-24)

  48. 1.405.1

    21 Aug 2026
    • Fix logs and metrics being silently dropped when an attribute holds a very large integer, a function, a symbol, a sparse array, or a truncated emoji.
      Cap log and metric attributes at 20 levels of nesting, 1,000 entries per object and 10,000 values in total, marking anything beyond as [Truncated].
      Type OtlpAnyValue.intValue as string | number — code reading that field must handle both. (2026-08-21)

  49. 1.405.0

    18 Aug 2026
    • Deprecated

      Add cookieWinsOnConflict to keep shared cross-subdomain identity and session state ahead of stale per-origin localStorage, deprecate __preview_cookie_wins_on_conflict, and enable the new behavior for the 2026-08-29 defaults.
      (2026-08-18)

  50. 1.404.1

    14 Aug 2026
    • dead-clicks: Treat visibility and focus changes as liveness signals, not dead-click evidence

      The dead-click detector treated a visibilitychange as evidence a click was dead: it measured Math.abs(clickTimestamp - lastVisibilityChange) and, once that exceeded the threshold, timed the click out as dead. Because it only recorded the tab becoming visible, any click in a session where the tab had ever been backgrounded (median gap ~1 minute) was flagged.

      A visibility or focus change near a click is the opposite — a sign the click did something (it woke/focused the tab, opened a new tab, or opened a new window/popup) — so these signals now only ever suppress a dead click, never cause one:

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.