@posthog/types
1.427.1 · 23 Nov 2026MIT38.9M / weekRepositorynpmAtom feed
283 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
1.427.1
23 Nov 2026Capture the Snapchat click ID as
sccidwhen the landing URL spells itScCidorSsCid. Whenmask_personal_data_propertiesis on, also maskScCid,SsCidandsscidin captured URLs, including landing URLs stored by older SDK versions.
(2026-11-23)
1.427.0
19 Nov 2026Add an explicit per-select session replay masking policy.
(2026-11-19)
1.426.0
19 Nov 2026Add opt-in
require_subresource_integrityto 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)
1.425.1
13 Nov 2026When the experimental
metrics.flagsoption is on, the browser SDK splits each/flagsattempt that gets a response into three histograms with the same attributes asposthog.flags.request.duration.posthog.flags.request.pre_send_durationruns from dispatch until the request starts, which includes body compression.posthog.flags.request.network_durationruns 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_durationruns 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/flagsrequest that this copy of the SDK sends to the same URL, so it may record the total without them.posthog.flags.request.durationis unchanged. The option, the metric names, and their attributes may change or be removed in any release.
(2026-11-13)
1.425.0
13 Nov 2026Add
trace_propagation_targets: an opt-in allowlist of hostnames or origins that receive a W3Ctraceparentheader onfetchandXMLHttpRequestrequests, so backend traces can continue from the browser. Unlisted hosts never get the header, and atraceparentset by the app or by OpenTelemetry instrumentation is never overwritten or duplicated.
(2026-11-13)
1.424.1
12 Nov 2026metrics: 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.flushIntervalMsstill wins.
(2026-11-12)metrics:
metrics.networkno longer records server-sent event streams. Atext/event-streamresponse 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)
1.424.0
11 Nov 2026Add
imageUrlto theEarlyAccessFeaturetype
(2026-11-11)
1.423.0
10 Nov 2026node: Expose
traceIdandspanIdgetters on theSpanhandle, for correlating logs from other loggers with a trace without parsingtraceparent()
(2026-11-10)Warn once in the console, even outside debug mode, when the bot user agent filter drops events, and document that
captureLoglogs bypass the filter.
(2026-11-10)
1.422.0
9 Nov 2026node: Expose
traceIdandspanIdgetters on theSpanhandle, for correlating logs from other loggers with a trace without parsingtraceparent()
(2026-11-09)
1.421.1
6 Nov 2026Mask hidden input values in session replay when
maskAllInputsis enabled, and accepthiddeninmaskInputOptions.
(2026-11-06)
1.421.0
5 Nov 2026metrics.histogram()accepts aboundsoption that sets the histogram's bucket boundaries, andbeforeSendsees 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 experimentalposthog.flags.request.durationhistogram 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)
1.420.0
4 Nov 2026Add the experimental
metrics.flagsoption. When it is on, the browser SDK records the round trip of every/flagsHTTP attempt as the histogramposthog.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)
1.419.0
30 Oct 2026Add support widget theming:
conversations.themeinit option,posthog.conversations.setTheme(), dark mode, and--ph-conv-*CSS custom properties
(2026-10-30)
1.418.0
28 Oct 2026Add
$input_valueto autocapturechangeevents for fields markeddata-ph-capture-value, or matched by the newautocapture.capture_value_css_selector_allowlistoption (CSS selectors or an(element) => booleanpredicate).
(2026-10-28)
1.417.0
27 Oct 2026Add
defaults: 'latest'to follow the newest defaults and report the applied date in events.
(2026-10-27)
1.416.1
26 Oct 2026Correct the documented default for synchronous session replay fetch capture.
(2026-10-26)
1.416.0
13 Oct 2026Attach trace exemplars to metrics recorded inside sampled spans.
(2026-10-13)
1.415.3
12 Oct 2026Fix
before_sendcallback types to accept non-null events while still allowingnullreturns to drop events.
(2026-10-12)
1.415.2
8 Oct 2026replay: Add a private opt-in to preserve application stacks for failed fetch requests
(2026-10-08)
1.415.1
6 Oct 2026Stop carousel and pager arrow controls from capturing false
$rageclickevents. The rageclick content ignorelist, active from the2025-11-30config 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 orcursor: pointerwrapper), 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 oraria-labelwins over an icon'saria-labelinside it, so clicking the icon and clicking the text agree. Setrageclick: { content_ignorelist: false }to keep capturing these events.
(2026-10-06)
1.415.0
6 Oct 2026Capture WebMCP tool intent and model metadata by default.
(2026-10-06)
1.414.0
6 Oct 2026Add opt-in WebMCP tool call capture for MCP Analytics.
(2026-10-06)
1.413.0
29 Sep 2026Add
onActiveMatchingSurveysChangedto subscribe to survey eligibility updates with safe unsubscribe and recoverable load-error reporting.
(2026-09-29)
1.412.4
21 Sep 2026Retry
/flagsin the browser SDK on HTTP 502/504 and on request timeouts, bounded by the newfeature_flag_request_max_retriesconfig (default 1, set 0 to disable). Plain transport failures are deliberately left to the existing status-zero circuit breaker.
(2026-09-21)
1.412.3
21 Sep 2026Stop dropping long spans that end:
maxSpanAgeMsnow evicts spans only oncemaxLiveSpansis 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)
1.412.2
17 Sep 2026Rename the
metrics.networkdefault attributes to the OTel HTTP client semantic conventions:http.request.method,server.address,server.port,url.scheme,url.template,http.response.status_codeanderror.typereplacemethod,host,pathandstatus_class.
(2026-09-17)
1.412.1
15 Sep 2026Docstrings for
identity_hashandsetIdentity()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)
1.412.0
14 Sep 2026Add
metrics.networkconfig to record HTTP and HTTPSfetchandXMLHttpRequestdurations as histograms, with an optional custom metric name and attributes.
(2026-09-14)
1.411.1
11 Sep 2026Back off automatic feature flag refreshes on idle visible pages only when
remote_config_refresh_interval_msis omitted, preserving explicitly configured intervals.
(2026-09-11)
1.411.0
10 Sep 2026Add experimental distributed tracing to
posthog-node:startSpan,withSpanandgetActiveSpanrecord spans against a newtracesclient option. A service with tracing off still forwards an inboundtraceparent, including from spans nested inside the one that received it, so a distributed trace is not severed. Atraceparentmay be passed as the one-element arrayreq.headersDistinctgives. AbeforeSpanSendhook sees every span before it is exported and may edit or drop it, andmaxAttributesPerSpan,maxEventsPerSpan,maxAttributeValueLength,maxLiveSpansandmaxSpanAgeMsbound what a single span and a single process may hold.
(2026-09-10)
1.410.1
10 Sep 2026Allow 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)
1.410.0
9 Sep 2026Segment integration: allow
segmentto accept an integration config withfilterProperties, so customers can filter PostHog-generated enrichment properties before Segment sends an event to its destinations. Returningnullor 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)
1.409.4
9 Sep 2026Apply replay URL privacy settings to URL values in captured JSON-LD payloads.
(2026-09-09)
1.409.3
9 Sep 2026Include the masked page URL with JSON-LD replay events.
(2026-09-09)
1.409.2
8 Sep 2026Prefer
sendBeaconfor unbatched events, such as{ send_instantly: true }captures, once PostHog's ownpagehidehandler (orunloadfallback) marks the page as unloading. Captures frombeforeunloador earlierpagehidelisteners retain their normal transport. Preserve response-capable transports on active pages so failed requests can be retried, including whenfetchis unavailable.
(2026-09-08)
1.409.1
7 Sep 2026Clarify feature flag return-value terminology across SDK APIs. A
falsevalue is a conclusive off evaluation, whileundefinedmeans no evaluation is available. Remote evaluation omits globally inactive flags, whereas backend local evaluation can resolve cached inactive definitions tofalse.
(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
@typevalues shaped like a Schema.org term, and limit types and payloads. Publish a reusable sanitization contract fixture.
(2026-09-07)
1.409.0
4 Sep 2026Add
reuseAnonymousIdsupport to browser identify calls.
(2026-09-04)
1.408.1
3 Sep 2026Require a distinct ID when calling
identifyand correct its API documentation to match the existing runtime validation.
(2026-09-03)
1.408.0
2 Sep 2026Forward generic server-signed identity claims with conversations widget requests.
(2026-09-02)
1.407.2
1 Sep 2026Document the session replay input masking defaults in the
session_recordingconfig reference: inputs are masked by default, password inputs stay masked on a partialmaskInputOptionsoverride, non-input text and images needmaskTextSelector, and client-side masking options override the project privacy setting.
(2026-09-01)
1.407.1
28 Aug 2026Session 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)
1.407.0
26 Aug 2026Add the
2026-08-30config defaults. These defaults enable sanitized JSON-LD replay events.
(2026-08-26)
1.406.2
26 Aug 2026Capture 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)
1.406.1
25 Aug 2026browser: 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 andremote_config_refresh_interval_msbehavior remain unchanged. (2026-08-25)
1.406.0
25 Aug 2026Web 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_attributiontofalseto opt out,truefor every metric, or an array to name the metrics. The captured metric also drops the emptyentriesarray and bounds attribution to a small set of useful fields, and the attributed INP observer no longer collects theprocessedEventEntrieswe never read.
(2026-08-25)
1.405.3
24 Aug 2026Drop 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: trueto keep capturing them.
(2026-08-24)
1.405.2
24 Aug 2026Add granular automatic pageview options for SPA navigation
capture_pageviewnow accepts an object withpath,search, andhashoptions. Each selected URL component triggers a$pageviewwhen it changes, including direct hash changes used by hash-based routers. The existing'history_change'option continues to capture pathname changes. (2026-08-24)
1.405.1
21 Aug 2026Fix 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].
TypeOtlpAnyValue.intValueasstring | number— code reading that field must handle both. (2026-08-21)
1.405.0
18 Aug 2026- Deprecated
Add
cookieWinsOnConflictto 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 the2026-08-29defaults.
(2026-08-18)
1.404.1
14 Aug 2026dead-clicks: Treat visibility and focus changes as liveness signals, not dead-click evidence
The dead-click detector treated a
visibilitychangeas evidence a click was dead: it measuredMath.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.