@posthog/types
1.427.2
Patch Changes
- #5864
b3ce2a8Thanks @joaohenriquesfr! - Add the private__preview_replay_early_fetch_responseoption, which stops Session Replay from holding back streamed fetch responses while it records their body. In WebKit, a request aborted while its body is being read then rejects with aTypeErrorinstead of anAbortError. (2026-11-25)
1.427.1
Patch Changes
- #5851
54220f6Thanks @ella-c-ph! - Capture the Snapchat click ID assccidwhen 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
Minor Changes
- #5709
1016d81Thanks @marandaneto! - Add an explicit per-select session replay masking policy. (2026-11-19)
1.426.0
Minor Changes
- #5766
6680554Thanks @marandaneto! - Add opt-inrequire_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
Patch Changes
- #5721
6cebc6cThanks @haacked! - When the experimentalmetrics.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
Minor Changes
- #5675
6af1863Thanks @DanielVisca! - Addtrace_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
Patch Changes
-
#5685
d669687Thanks @DanielVisca! - fix(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 explicitmetrics.flushIntervalMsstill wins. (2026-11-12) -
#5686
9e97237Thanks @DanielVisca! - fix(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
Minor Changes
- #5663
d6dbd3aThanks @rafaeelaudibert! - AddimageUrlto theEarlyAccessFeaturetype (2026-11-11)
1.423.0
Minor Changes
- #5599
fee9beeThanks @DanielVisca! - feat(node): exposetraceIdandspanIdgetters on theSpanhandle, for correlating logs from other loggers with a trace without parsingtraceparent()(2026-11-10)
Patch Changes
- #5595
b5e9b69Thanks @DanielVisca! - Warn once in the console, even outside debug mode, when the bot user agent filter drops events, and document thatcaptureLoglogs bypass the filter. (2026-11-10)
1.422.0
Minor Changes
- #5594
bfbaff7Thanks @DanielVisca! - feat(node): exposetraceIdandspanIdgetters on theSpanhandle, for correlating logs from other loggers with a trace without parsingtraceparent()(2026-11-09)
1.421.1
Patch Changes
- #5561
ab49034Thanks @adityareddy-dev! - Mask hidden input values in session replay whenmaskAllInputsis enabled, and accepthiddeninmaskInputOptions. (2026-11-06)
1.421.0
Minor Changes
- #5580
aa66d4cThanks @haacked! -metrics.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
Minor Changes
- #5547
742f73fThanks @haacked! - Add the experimentalmetrics.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
Minor Changes
- #5480
9bd0e80Thanks @veryayskiy! - Add support widget theming:conversations.themeinit option,posthog.conversations.setTheme(), dark mode, and--ph-conv-*CSS custom properties (2026-10-30)
1.418.0
Minor Changes
- #5269
950d034Thanks @dustinbyrne! - Add$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
Minor Changes
- #5405
3150079Thanks @marandaneto! - Adddefaults: 'latest'to follow the newest defaults and report the applied date in events. (2026-10-27)
1.416.1
Patch Changes
- #5335
cb34fe0Thanks @hpouillot! - Correct the documented default for synchronous session replay fetch capture. (2026-10-26)
1.416.0
Minor Changes
- #5291
7c10169Thanks @DanielVisca! - Attach trace exemplars to metrics recorded inside sampled spans. (2026-10-13)
1.415.3
Patch Changes
- #5281
8f2d581Thanks @marandaneto! - Fixbefore_sendcallback types to accept non-null events while still allowingnullreturns to drop events. (2026-10-12)
1.415.2
Patch Changes
- #5200
34cdfa6Thanks @hpouillot! - fix(replay): add a private opt-in to preserve application stacks for failed fetch requests (2026-10-08)
1.415.1
Patch Changes
- #5004
730d92bThanks @posthog! - Stop 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
Minor Changes
- #5191
6cd5496Thanks @gesh! - Capture WebMCP tool intent and model metadata by default. (2026-10-06)
1.414.0
Minor Changes
1.413.0
Minor Changes
- #4794
e89d224Thanks @AyobamiH! - AddonActiveMatchingSurveysChangedto subscribe to survey eligibility updates with safe unsubscribe and recoverable load-error reporting. (2026-09-29)
1.412.4
Patch Changes
- #5008
3a8035fThanks @nachogarcia! - Retry/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
Patch Changes
- #5018
9cd8ebdThanks @turnipdabeets! - Stop 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
Patch Changes
- #5014
5e86154Thanks @pauldambra! - Rename themetrics.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
Patch Changes
- #4962
85b775aThanks @posthog! - Docstrings foridentity_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
Minor Changes
- #4918
c666606Thanks @pauldambra! - Addmetrics.networkconfig to record HTTP and HTTPSfetchandXMLHttpRequestdurations as histograms, with an optional custom metric name and attributes. (2026-09-14)
1.411.1
Patch Changes
- #4860
8207df8Thanks @posthog! - Back off automatic feature flag refreshes on idle visible pages only whenremote_config_refresh_interval_msis omitted, preserving explicitly configured intervals. (2026-09-11)
1.411.0
Minor Changes
- #4579
19e78ccThanks @turnipdabeets! - Add experimental distributed tracing toposthog-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
Patch Changes
-
#4878
14ba783Thanks @dustinbyrne! - Allow null bootstrap values and treat null or empty distinct IDs as missing. (2026-09-10) -
#4831
9498567Thanks @posthog! - Log a console message when advanced_disable_feature_flags stops surveys from displaying (2026-09-10)
1.410.0
Minor Changes
- #4707
b441eb2Thanks @posthog! - Segment integration: allowsegmentto 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)
Patch Changes
-
#4876
0c2a15fThanks @dustinbyrne! - 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) -
#4733
24fa541Thanks @dustinbyrne! - fix(web): avoid reporting clicks that select or unselect text as dead clicks (2026-09-09)
1.409.4
Patch Changes
- #4869
891eefaThanks @robbie-c! - Apply replay URL privacy settings to URL values in captured JSON-LD payloads. (2026-09-09)
1.409.3
Patch Changes
- #4864
e8b2be1Thanks @robbie-c! - Include the masked page URL with JSON-LD replay events. (2026-09-09)
1.409.2
Patch Changes
- #4791
b2affdcThanks @posthog! - PrefersendBeaconfor 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
Patch Changes
-
#4785
74ca945Thanks @marandaneto! - Clarify feature flag return-value terminology across SDK APIs. Afalsevalue 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) -
#4666
5e74132Thanks @robbie-c! - 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
Minor Changes
- #4774
426e1fdThanks @Fhatu12! - AddreuseAnonymousIdsupport to browser identify calls. (2026-09-04)
1.408.1
Patch Changes
- #4760
41ed3afThanks @marandaneto! - Require a distinct ID when callingidentifyand correct its API documentation to match the existing runtime validation. (2026-09-03)
1.408.0
Minor Changes
- #4741
61a26e5Thanks @veryayskiy! - Forward generic server-signed identity claims with conversations widget requests. (2026-09-02)
1.407.2
Patch Changes
- #4712
7f009dcThanks @posthog! - Document the session replay input masking defaults in thesession_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
Patch Changes
- #4665
d5ef459Thanks @fasyy612! - 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)
1.407.0
Minor Changes
- #4655
4f80973Thanks @robbie-c! - Add the2026-08-30config defaults. These defaults enable sanitized JSON-LD replay events. (2026-08-26)
1.406.2
Patch Changes
-
#4635
ab1383aThanks @robbie-c! - Capture paste interactions with clipboard autocapture without collecting pasted text. (2026-08-26) -
#4640
0d2cf49Thanks @robbie-c! - Add opt-in Schema.org JSON-LD capture to session replay throughsession_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
Patch Changes
-
#4476
ed4dd97Thanks @posthog! - fix(browser): refresh configured feature flags when a hidden tab becomes visibleFeature 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_msbehavior remain unchanged. (2026-08-25)
1.406.0
Minor Changes
- #4598
334159bThanks @posthog! - 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. Setcapture_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
Patch Changes
- #4607
7ec4f0dThanks @posthog! - 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. Seterror_tracking.captureExtensionExceptions: trueto keep capturing them. (2026-08-24)
1.405.2
Patch Changes
-
#4418
be2161dThanks @posthog! - feat: add granular automatic pageview options for SPA navigationcapture_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
Patch Changes
- #4583
6322f09Thanks @turnipdabeets! - 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]. TypeOtlpAnyValue.intValueasstring | number— code reading that field must handle both. (2026-08-21)
1.405.0
Minor Changes
- #4496
1ade666Thanks @marandaneto! - AddcookieWinsOnConflictto 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
Patch Changes
-
#4503
eb05237Thanks @pauldambra! - fix(dead-clicks): treat visibility and focus changes as liveness signals, not dead-click evidenceThe 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:
- Visibility changes are recorded in both directions (a click that opens a new tab sends the current tab to
hidden), and a windowfocus/blurobserver is added, since a click that opens a new window/popup may leave the tab visible and only surface as the current window losing focus. - A click within a wake-up/interaction window (1s, wide enough for a real "tab back, then click" gesture) of any such change is suppressed.
- The visibility signal no longer feeds the dead-marking path at all.
$dead_click_visibility_changed_timeoutstays in the payload (always false) for shape compatibility, and a new$dead_click_focus_changed_delay_msis emitted for observability. - Visibility/focus changes are now recorded onto each queued candidate the instant they fire (like scroll), instead of being read from a single shared timestamp when the click is checked ~1s later. A click that hides or blurs the tab (opening a new tab/window) suspends that check while the tab is backgrounded; by the time it resumes the tab has usually returned, and the shared timestamp would have been overwritten by that later transition — losing the click-correlated one and wrongly flagging the click dead. Stamping the candidate as the event fires makes delayed hide→show and blur→focus sequences suppress correctly. (2026-08-14)
- Visibility changes are recorded in both directions (a click that opens a new tab sends the current tab to
1.404.0
Minor Changes
- #4485
8bc63c3Thanks @dustinbyrne! - Default external dependency loading to versioned asset paths with automatic fallback to legacy paths, and add astrict_script_versioning: 'fallback'mode. (2026-08-13)
1.403.1
Patch Changes
- #4443
b2c6830Thanks @arnohillen! - Harden the session replay stylesheet inlining budget (inlineStylesheetBudgetRules):- The default budget (10,000 rules) moves from the recorder chunk into posthog-js session recording options, so npm-pinned or cached bundles keep their configured override (including
0to disable) and directrrweb.record()consumers keep unbounded inlining unless they opt in. - Deferred inlining is bounded inside a sheet: a resumable cursor stringifies 200 rules per idle slice and emits a sheet's
_cssTextatomically, so monolithic sheets no longer produce one long task and partial CSS never reaches the wire. - Deferred sheets are flushed synchronously when recording stops and on
pagehide; residual failure modes are counted via$sdk_debug_replay_deferred_stylesheets_failed/_abandoned. - CSSOM-only styles (
insertRuleoutput,adoptedStyleSheets) no longer charge the budget, since deferring<link>sheets buys those pages nothing. - Telemetry fixes: full-snapshot duration wraps the whole synchronous task, deferred counts are cumulative per session, new gauges cover non-deferrable rules and idle stringification cost, and duration samples straddling tab suspension are discarded (
$sdk_debug_replay_discarded_duration_samples). (2026-08-13)
- The default budget (10,000 rules) moves from the recorder chunk into posthog-js session recording options, so npm-pinned or cached bundles keep their configured override (including
1.403.0
Minor Changes
-
#4495
e4b9947Thanks @marandaneto! - feat(browser): addrewriteRequestPathto customize API, feature flag, and asset paths for reverse proxies (2026-08-12) -
#4493
e34ebf9Thanks @marandaneto! - Add reset options for applying bootstrapped identity, feature flag, and session values afterposthog.reset()while preserving the legacy boolean argument. (2026-08-12)
1.402.3
Patch Changes
- #4494
deb6bb0Thanks @marandaneto! - fix(types): accept current and legacy Segment Analytics SDK types in the Segment integration config (2026-08-11)
1.402.2
Patch Changes
- #4434
75fb719Thanks @arnohillen! - Make the session replay attribute masking options mutually exclusive: when bothmaskAllElementAttributesandmaskAttributeFnare set, the coarse option wins and the callback is ignored (with a console warning), so a callback can no longer accidentally unmask whatmaskAllElementAttributeshides. (2026-08-06)
1.402.1
Patch Changes
-
#4286
d108d66Thanks @posthog! - fix(replay): preserve privacy masking for initial network metadataInitial navigation and performance-timing entries are now passed through
maskCapturedNetworkRequestFn, including when they have no method. URL rewrites are respected. When the callback returns nullish for an initial entry, replay-required timing metadata is retained without its URL, headers, or body so method-gated callbacks do not drop the metadata or expose deliberately filtered customer data. Derived server-timing entries are also suppressed when this strict fallback is used. Enforced PostHog filtering and payload cleaning still run first. (2026-08-05)
1.402.0
Minor Changes
- #4376
2da12b8Thanks @posthog! - Add attribute-level masking to session replay:maskAttributeFnprovides per-attribute control over the final serialized value, whilemaskAllElementAttributesmasks all source DOM string attributes (including rendering attributes and synthesized form values) at the cost of replay fidelity. (2026-08-05)
1.401.1
Patch Changes
- #4380
3c40b6cThanks @marandaneto! - Keep request timeouts active through response body consumption and clarify eventual event UUID deduplication semantics. (2026-08-05)
1.401.0
Minor Changes
-
#4266
43d1850Thanks @posthog! - feat: add opt-incapture_performance.__preview_web_vitals_soft_navsto fix inflated web vitals on single-page appsClient-side route changes in SPAs previously left web vitals (LCP especially) accumulating against the original hard-navigation timestamp, inflating the top tail of Core Web Vitals. Setting
capture_performance: { __preview_web_vitals_soft_navs: true }now scopes metrics to the browser's Soft Navigation entries so each route change starts a fresh measurement window. It's a preview option because it relies on Chrome's experimental Soft Navigation Detection API and loads pinned stable web-vitals 6.x callbacks; when disabled (the default), the existing web-vitals 5.x behavior remains unchanged. (2026-08-04)
1.400.2
Patch Changes
- #4339
f865818Thanks @posthog! - Report privacy-aware dropped-event count, page and session context in the client rate limit warning (2026-08-04)
1.400.1
Patch Changes
-
#4314
feb9e2aThanks @posthog! - fix: warn whenreset()silently opts the user back outreset()clears stored consent along with the rest of the user's state. Withopt_out_capturing_by_default, this returns the instance to the opted-out default, so callingreset()afteropt_in_capturing()would stop capturing without warning. It now logs a warning when that happens and documents the required ordering. (2026-08-04)
1.400.0
Minor Changes
- #4125
fde7145Thanks @DerGeraetK! - Addsession_recording.samplingto disable or throttle mousemove capture (and optionally mouseInteraction) in session replay. Canvas recording now merges its canvas sampling with user-provided sampling instead of overwriting it. (2026-08-03)
1.399.0
Minor Changes
-
#4270
92427a1Thanks @turnipdabeets! - Add canvas mask regions to session replay canvas capture:session_recording.canvasCapture.maskRegionsFnis called once per canvas per captured frame, and the returned regions (CSS pixels, relative to the canvas) are painted black in the captured frame before it is encoded — letting apps that render into canvas (e.g. Flutter web via CanvasKit) mask content that DOM-based masking cannot see.The return value decides what happens to that canvas's frame:
[]— nothing to mask; the frame is recorded as is.null— regions could not be computed; the frame is skipped rather than recorded unmasked.maskRegionsFnnot set — canvases are recorded unmasked and canvas capture behavior is unchanged.
Configuring
maskRegionsFnalso disables canvas pixel serialization in DOM full snapshots (rr_dataURL) — that path never sees the mask regions, so skipping it closes the route that could otherwise embed unmasked canvas stills in a snapshot; the canvas repaints from the masked frame stream instead. Every canvas the provider answers — with regions or[]— re-sends an unchanged frame as a keyframe every 30s, so after a full snapshot or a seek an idle canvas repaints within at most 30s.An app whose real provider only exists once its runtime has booted chooses what happens in between by what it declares in
posthog.init: a function covering the whole canvas blacks those frames out,() => nullskips them, and declaring nothing records them. Client-side only, cannot be set via remote configuration. (2026-07-29)
1.398.0
Minor Changes
-
#4222
0f2407bThanks @turnipdabeets! - feat: add a default-value option toisFeatureEnabledisFeatureEnabled(key, { defaultValue: false })now returns the given default when the flag has no value — flags not loaded yet, or no flag with that key — and the return type narrows toboolean. The option name is the same in posthog-js, posthog-js-lite, and posthog-react-native. WithoutdefaultValue, behavior is unchanged:boolean | undefined. (2026-07-22)
1.397.1
Patch Changes
- #4198
fbfc84fThanks @pauldambra! - feat: make the pending session recording trigger buffer interval configurable (2026-07-20)
1.397.0
Minor Changes
- #4149
607bf54Thanks @pauldambra! - Add dead swipe detection to dead clicks autocapture. When dead clicks autocapture is enabled, touch swipe gestures that produce no observable screen change (no scroll, mutation, selection or visibility change) are now captured as$dead_swipeevents, surfacing failed navigations on touch devices. Configurable viacapture_dead_swipes(defaulttrue) andswipe_threshold_px(default30) on thecapture_dead_clicksconfig. Swipes over surfaces whose response cannot be observed (canvas, video and other media elements under the finger) are skipped, and captures are limited per page load viamax_dead_swipes_per_page_load(default10). (2026-07-16)
1.396.0
Minor Changes
-
#4159
fad6d9aThanks @haacked! - add$feature_flag_has_experimentto$feature_flag_calledevents$feature_flag_calledevents now carry a$feature_flag_has_experimentboolean sourced from the server'shas_experimentflag metadata (the/flags?v=2response for remote evaluation, the/api/feature_flag/local_evaluationdefinitions for posthog-node local evaluation). The property is only sent when the server explicitly reportshas_experiment; it is omitted entirely when the value is unknown (older servers, missing metadata, bootstrapped or locally injected flags). (2026-07-16)
1.395.0
Minor Changes
- #4129
800af7cThanks @pauldambra! - feat: addsession_recording.attributeFilteroption that passes an attribute allowlist through to the native MutationObserver, so mutations to unlisted attributes (e.g. animation-driven inlinestylechurn) never cost recording CPU (port of upstream rrweb #1873) (2026-07-15)
1.394.0
Minor Changes
- #4101
dc2aa5bThanks @posthog! - Normalize the error tracking rate-limiter config to first-class options. The browser SDK now readsexceptionRateLimiterRefillRate/exceptionRateLimiterBucketSizeonerror_tracking, with the previous double-underscore__exceptionRateLimiterRefillRate/__exceptionRateLimiterBucketSizeoptions deprecated but still honoured as a fallback. The option shape (ExceptionRateLimiterConfig) and default-resolution logic (resolveExceptionRateLimiterConfig) now live in@posthog/coreand are shared between the browser and Node SDKs. (2026-07-14)
1.393.0
Minor Changes
-
#4115
86bb3a5Thanks @DanielVisca! - add the posthog.metrics API (count, gauge, histogram) — alphaA statsd-style pre-aggregating metrics client for the PostHog Metrics product (alpha). Samples are folded into per-series aggregates in memory (counts sum, gauges keep the last value, histograms accumulate buckets) and flushed periodically as OTLP/JSON to
/i/v1/metrics— one data point per series per flush window, no matter how many calls. No OpenTelemetry SDK setup required:1posthog.metrics.count("orders_created", 1); 2posthog.metrics.gauge("active_connections", 42); 3posthog.metrics.histogram("api_latency", 187, { unit: "ms" });Configure via
metrics: { serviceName, environment, flushIntervalMs, maxSeriesPerFlush, beforeSend, ... }. (2026-07-08)
1.392.1
Patch Changes
- #4053
45d1b36Thanks @posthog! - feat(web): add a gracefulshutdown()to the browser client for parity with posthog-node, so isomorphic teardown code (e.g. the Nuxt module) that callsposthog.shutdown()on the client no longer throwsTypeError: shutdown is not a function. It best-effort flushes the queued events and always resolves. (2026-07-03)
1.392.0
Minor Changes
- #3987
74cc6bbThanks @TueHaulund! - Add aget_current_urlconfig option that overrides the URL used for client-side URL targeting — session replay URL triggers, the session replay URL blocklist, survey URL display conditions, product tour URL conditions, web experiment URL conditions, and autocapture URL allow/ignore lists. These match againstwindow.location.hrefdirectly, which does not reflect a$current_urlrewritten inbefore_send. Apps where the browser URL is not meaningful for targeting (e.g. Electron/desktop builds served from a generated host) can now return the logical URL to match against. Defaults towindow.location.hrefwhen not set. (2026-06-29)
1.391.1
Patch Changes
- #3919
99bad9cThanks @pauldambra! - Session replay network capture: add an opt-in streaming reader for request/response bodies that stops at the payload size limit instead of buffering the whole body and then discarding it — bounding memory and pre-request latency when a body is very large. It reads only a clone of the body, so it never consumes the stream the page itself reads, and always resolves (never rejects) into the page'sfetch. Off by default; enabled fordefaults: '2026-06-25'and settable directly viasession_recording.streamNetworkBody. (2026-06-24)
1.391.0
Minor Changes
-
#3921
c28b161Thanks @marandaneto! - Adddisable_capture_url_hashesto strip URL fragments from automatically captured URLs. It is disabled by default for backwards compatibility, and enabled automatically whenconfig.defaultsis'2026-06-25'or later. Enabling it (either explicitly or via the'2026-06-25'defaults) is a breaking behavior change for SPAs that rely on URL hashes for routing or analytics, because hash-based routes will be collapsed to the same URL without the fragment in fields such as$current_url,$initial_current_url,$session_entry_url, autocapture$elements[*].attr__href,$external_click_url, replayhrefURLs, heatmaps, web vitals$current_url, logsurl.full, conversationscurrent_url/request_url, or Next.js Pages Router$pageview$current_url.If you only want to capture some hashes, leave hash capture enabled and use
before_sendto remove or redact sensitive hash values before events are sent. (2026-06-23)
1.390.2
Patch Changes
- #3903
6b21f77Thanks @marandaneto! - Validate custom event UUID overrides and generate new UUIDs when invalid. (2026-06-19)
1.390.1
Patch Changes
-
#3885
5392a55Thanks @pauldambra! - feat(replay): capture canvas at reduced resolutionAdds
session_recording.canvasCapture.resolutionScale- a(0, 1]fraction of the canvas display size to capture replay frames at. The captured bitmap is downscaled (pixel-area savings are quadratic) while the canvas's true display size is still recorded, so playback stretches the smaller frame back to the correct dimensions and aspect ratio - only sharpness drops, never layout. It defaults to1(full resolution, matching today's behaviour), and the latestdefaultsbundle (2026-05-30) opts new installs into0.6.The canvas's true display size travels with each frame through the encode worker (as required message fields), so the encoded reply is always drawn back to the correct dimensions — no per-canvas state is retained on the main thread, and downscaling can never mislabel a canvas's dimensions. At full resolution the captured pixels are unchanged (the quality resampling hint is only applied when actually downscaling); the emitted
drawImagenow always uses the explicit destination-size form, which is pixel-equivalent on replay.Mechanically,
@posthog/rrweb's canvas FPS-snapshot observer takes an optionalcanvasResolutionScalerecord option and downscales each captured frame accordingly. (2026-06-19)
1.390.0
Minor Changes
-
#3869
81b79fbThanks @turnipdabeets! - Add abeforeSendoption to the logs config, so you can inspect, redact, or drop log records before they're sent:1posthog.init("<token>", { 2 logs: { 3 beforeSend: (log) => { 4 // return null to drop the log, or return the (optionally modified) log to keep it 5 if (log.body.includes("password")) { 6 return null; 7 } 8 return log; 9 }, 10 }, 11});beforeSendaccepts a single function or an array of functions (applied left to right); returningnullfrom any of them drops the record. It runs for logs sent via bothposthog.captureLog()andposthog.logger.*. (2026-06-17)
1.389.0
Minor Changes
- #3865
b469830Thanks @turnipdabeets! - The browser's programmatic logs API (posthog.captureLog()/posthog.logger.*) now runs through the shared@posthog/corelogs pipeline that React Native already uses — no change to the public API or existing behavior. Log delivery is more resilient as a result: oversized batches are split automatically, failed sends retry with exponential backoff, and delivery resumes when the browser comes back online. (2026-06-17)
1.388.0
Minor Changes
- #3863
b6bc9beThanks @marandaneto! - Add autocapture-only CSS selector opt-outs for web interactions. (2026-06-17)
1.387.0
Minor Changes
- #3709
c6c163aThanks @posthog! - AddunsetPersonProperties()to remove person properties, the counterpart tosetPersonProperties(). Previously the only way to unset a person property was to hand-pass a$unsetarray inside acapture()call. (2026-06-16)
Patch Changes
- #3860
c9c7df1Thanks @marandaneto! - Add$unsetto capture options and pass it through in browser capture payloads. (2026-06-16)
1.386.4
Patch Changes
- #3837
29bf8e3Thanks @marandaneto! - Add missing bugs metadata to package manifests. (2026-06-15)
1.386.3
Patch Changes
-
#3690
dbf2377Thanks @pauldambra! - fix(sessionid): keep the session id stable across tabsA session now rotates only when every tab has been idle past the timeout, rather than whenever a single background tab decides it is idle. On the active event path an idle tab re-reads the session id from storage before rotating: if a sibling tab kept the session alive it does not rotate, and if a sibling already rotated it adopts that id instead of minting a new one. This removes spurious cross-tab session fragmentation (inflated session counts, truncated session durations, split replays). When a sibling session is adopted,
onSessionIdhandlers fire withchangeReason.crossTabAdoption: trueso session recording, pageview state, and session-scoped properties follow the new session. Whenpersistence_save_debounce_ms > 0(the2026-05-30default) the refresh reads only the session-id key so it cannot clobber a sibling's write.Note: projects with significant multi-tab usage will see fewer but longer sessions after upgrading — this is a correction of previously over-counted sessions, not a traffic change. (2026-06-11)
1.386.2
1.386.1
1.386.0
1.385.0
Minor Changes
- #3777
f601c49Thanks @dustinbyrne! - Promote external dependency script versioning to supportedstrict_script_versioningandasset_hostconfig options. (2026-06-10)
Patch Changes
- #3753
c11794dThanks @dustinbyrne! - Reload feature flags by default when resetting person properties for flags. (2026-06-10)
1.384.3
Patch Changes
- #3791
2d21adaThanks @marandaneto! - Deprecate__preview_disable_beaconin favor ofdisable_beaconand mark__preview_disable_xhr_credentialsas a no-op. (2026-06-10)
1.384.2
Patch Changes
- #3789
d9462b3Thanks @marandaneto! - Deprecate__preview_eager_load_replayas a no-op now that session replay lazy loading is the default. (2026-06-10)
1.384.1
1.384.0
Minor Changes
-
#3782
0c2acb9Thanks @pauldambra! - Detect the Google Search App (GSA) as its own$browservalue (Google Search App) via the cross-platformGSA/UA marker, instead of reporting the embedded webview as Mobile Safari (iOS) or Chrome (Android). Gated behind the newdetect_google_search_appconfig option, which the2026-05-30config defaults opt into automatically — left off otherwise to keep existing browser attribution backwards-compatible.Note:
$browser_versionforGoogle Search Appis not comparable across platforms — iOS yields a version like284.0(fromGSA/284.0.564099828) while Android yields a version like14.21(fromGSA/14.21.20.28.arm64), since Google maintains separate versioning schemes for the two apps. Avoid building cross-platform version dashboards on$browser_versionfor this browser. (2026-06-10)
1.383.3
Patch Changes
- #3776
783ba46Thanks @marandaneto! - Deprecate the no-op__preview_flags_v2browser SDK config option. The SDK already uses the/flags/?v=2endpoint by default. (2026-06-09)
1.383.2
1.383.1
1.383.0
Minor Changes
-
#3771
227c9b0Thanks @dustinbyrne! - feat(persistence): addsplit_storageconfig option to store the feature-flag config cluster in its own localStorage entry (<name>__flags) instead of the single main persistence blob. This payload is large and changes rarely, so keeping it out of the main blob stops it riding on every high-frequency main-blob write and broadcasting on cross-tabstorageevents. Reads are unchanged: on load the entry is merged back into the in-memory props, and the old main-blob location is read once and migrated forward so upgrades never miss a cached flag. The split only applies when persistence resolves tolocalStorage/localStorage+cookie(it is pointless formemory/sessionStorageand impossible forcookie), andreset()/ opt-out wipe every entry. Defaults tofalsefor backwards compatibility; the new2026-05-30config default opts in automatically. (2026-06-08) -
#3727
393f9e2Thanks @pauldambra! - feat(surveys): extendsplit_storageto also move the survey config ($surveys) out of the main persistence blob into its own<name>__surveyslocalStorage entry, on top of the feature-flag split. Surveys now stamp a$surveys_loaded_atfreshness timestamp on every/surveysload — the survey analogue of$feature_flag_evaluated_at— so a stale__surveysentry can no longer win over a fresher survey payload written back into the main blob by a gate-off / older-SDK tab. With no timestamp on either side (migration leftover) the group entry still wins, so the migration path is unchanged. Same backend andreset()/ opt-out semantics as the flag split. (2026-06-08)
1.382.0
1.381.0
Minor Changes
- #3719
a7bd828Thanks @lricoy! - Add__preview_cookie_wins_on_conflictopt-in config to prefer cookie values over localStorage when merging persistence state inlocalStorage+cookiemode, fixing cross-subdomain identify and session disconnects. (2026-06-05)
1.380.1
1.380.0
Minor Changes
- #3715
2387084Thanks @dustinbyrne! - Promote browser tracing header configuration to the publictracing_headersoption while keepingaddTracingHeadersand__add_tracing_headersas deprecated aliases. (2026-06-04)
1.379.3
1.379.2
1.379.1
1.379.0
1.378.1
1.378.0
Minor Changes
- #3688
8181354Thanks @pauldambra! - feat(persistence): addpersistence_save_debounce_msconfig option to coalesce rapid storage saves into a single write. Setting a positive value debounces writes to localStorage/cookie by that window; the in-memorypropsobject still updates synchronously so within-tab reads see the latest values immediately, and pending writes flush onbeforeunloadandpagehideso no state is lost on tab close. Cross-tabstorageevents are reduced proportionally to the debounce window. Defaults to0(no debouncing) for backwards compatibility. On pages that capture many events per second,250is a reasonable starting point. The new2026-05-30config default opts intopersistence_save_debounce_ms: 250automatically. (2026-06-01)
1.377.0
1.376.6
1.376.5
1.376.4
1.376.3
1.376.2
1.376.1
1.376.0
1.375.0
Minor Changes
- #3641
2e1d5f4Thanks @dustinbyrne! - Addflag_keysconfig to restrict browser feature flag remote evaluation to specific flag keys. (2026-05-21)
1.374.4
1.374.3
Patch Changes
- #3607
557b893Thanks @eli-r-ph! - Enable $web_vitals reporting when cookieless mode is enabled (2026-05-20)
1.374.2
1.374.1
1.374.0
Minor Changes
- #3620
594ea11Thanks @pauldambra! - Dead clicks: add a.ph-no-deadclickCSS class (andcapture_dead_clicks.css_selector_ignorelistconfig option) to exclude specific elements from dead-click detection without affecting autocapture, session replay, or heatmaps. Mirrors the existing.ph-no-rageclickpattern. (2026-05-18)
1.373.5
1.373.4
1.373.3
1.373.2
1.373.1
1.373.0
Minor Changes
- #3547
4c0c7d9Thanks @williamchong! -capture()now accepts an optionaluuidonCaptureOptions. (2026-05-11)
Patch Changes
- #3559
0a835faThanks @marandaneto! - Skip remote config background refreshes when no document is available. (2026-05-11)
1.372.10
1.372.9
1.372.8
1.372.7
1.372.6
1.372.5
1.372.4
1.372.3
1.372.2
1.372.1
1.372.0
1.371.4
1.371.3
1.371.2
Patch Changes
- #3453
96f19b7Thanks @turnipdabeets! - Lift OTLP log serialization helpers from posthog-js into @posthog/core so the upcoming React Native logs feature consumes the same builders. Browser gains two fixes as a side effect: NaN and ±Infinity attribute values no longer get silently dropped during JSON encoding, and the scope.version OTLP field is now populated with the SDK version (changes the server's instrumentation_scope column from "posthog-js@" to "posthog-js@
1.371.1
1.371.0
Minor Changes
-
#3432
1a8b727Thanks @richardsolomou! - refactor: rename__add_tracing_headerstoaddTracingHeaders. The__prefix signalled an internal/experimental option, but the config is a public API (documented for linking LLM traces to session replays).__add_tracing_headerscontinues to work as a deprecated alias on the browser SDK.Also exposes
patchFetchForTracingHeadersfrom@posthog/coreso non-browser SDKs can reuse the implementation. (2026-04-23)
1.370.1
1.370.0
Minor Changes
- #3389
922a1c1Thanks @hpouillot! - Add exception steps to error tracking (aka breadcrumbs) (2026-04-22)
1.369.5
1.369.4
1.369.3
1.369.2
Patch Changes
- #3386
4a65604Thanks @dustinbyrne! - Add a preview flag for versioned browser lazy bundle asset paths. (2026-04-16)
1.369.1
1.369.0
1.368.2
1.368.1
1.368.0
Minor Changes
- #3345
3fcf5c4Thanks @jonmcwest! - Add posthog.captureLog() API for sending structured log entries to PostHog logs (2026-04-13)
1.367.0
1.366.2
1.366.1
1.366.0
1.365.5
1.365.4
1.365.3
1.365.2
Patch Changes
- #3323
c387f6dThanks @pauldambra! - perf(replay): reduce memory and CPU cost of event compression by caching gzipped empty arrays and eliminating redundant JSON.stringify for size estimation (2026-04-08)
1.365.1
1.365.0
1.364.7
1.364.6
1.364.5
1.364.4
1.364.3
1.364.2
1.364.1
1.364.0
1.363.6
1.363.5
Patch Changes
- #3274
ba08262Thanks @pauldambra! - fix: document visibility change shoudln't capture dead click (2026-03-25)
1.363.4
1.363.3
1.363.2
1.363.1
1.363.0
Patch Changes
- #3245
1acd6fdThanks @dmarticus! - handle plain array and object forms in overrideFeatureFlags (2026-03-20)
1.362.0
1.361.1
1.361.0
Minor Changes
- #3241
fe1fd7bThanks @dustinbyrne! - feat: addadvanced_feature_flags_dedup_per_sessionconfig option to scope$feature_flag_calleddeduplication to the current session (2026-03-18)
Patch Changes
1.360.2
1.360.1
1.360.0
Minor Changes
- #3207
c5a37cbThanks @dustinbyrne! - feat: Add TreeShakeable
1.359.1
1.359.0
1.358.1
1.358.0
1.357.2
1.357.1
1.357.0
Minor Changes
- #3169
4f885c0Thanks @marandaneto! - feat: add local sampleRate config for session recording (2026-03-02)
1.356.2
1.356.1
1.356.0
Minor Changes
- #3142
ec54fd8Thanks @dmarticus! - Add feature_flag_cache_ttl_ms config to prevent stale flag values (2026-02-26)
Patch Changes
- #3145
d741668Thanks @dmarticus! - Adds a remote_config_refresh_interval_ms config option to control how often feature flags are automatically refreshed in long-running sessions. (2026-02-26)
1.355.0
1.354.4
1.354.3
1.354.2
1.354.1
1.354.0
1.353.1
1.353.0
1.352.1
1.352.0
1.351.4
Patch Changes
- #3119
2649a9aThanks @dmarticus! - Adds a fresh option to getFeatureFlag(), getFeatureFlagResult(), and isFeatureEnabled() that only returns values loaded from the server, not cached localStorage values. (2026-02-19)
1.351.3
1.351.2
1.351.1
1.351.0
Patch Changes
- #3107
9dbc05eThanks @ablaszkiewicz! - warning on manual capture('$exception') (2026-02-18)
1.350.0
Minor Changes
- #2895
1b47203Thanks @benjackwhite! - RemoteConfig (config.js) has been loaded for ages and is in use by us in production. This PR makes it the sole config loading mechanism for posthog-js, removing the legacy /flags/?v=2&config=true path and the __preview_remote_config gate. (2026-02-17)
1.349.0
Minor Changes
1.348.0
1.347.2
1.347.1
1.347.0
1.346.0
1.345.5
Patch Changes
- #3060
7437982Thanks @pauldambra! - Add missingfeatureFlagsproperty andOverrideFeatureFlagsOptionstype toPostHoginterface, restoreset_configto the loaded callback type, and addfeatureFlagsReloadingtoon()event types (2026-02-11)
1.345.4
1.345.3
1.345.2
1.345.1
1.345.0
Minor Changes
- #2919
fe8090cThanks @dustinbyrne! - Adderrorproperty toRequestResponse(2026-02-09)
1.344.0
1.343.2
1.343.1
1.343.0
1.342.1
1.342.0
1.341.2
1.341.1
1.341.0
1.340.0
1.339.1
1.339.0
Minor Changes
- #3006
b3ec434Thanks @robbie-c! - Add a function isTestUser() and config option test_user_hostname (2026-02-03)
1.338.1
1.338.0
1.337.1
1.337.0
Minor Changes
- #2996
7768010Thanks @matheus-vb! - Filter out flags marked as failed before merging with cached values, preventing transient backend errors from overwriting previously evaluated flag states (2026-02-03)
1.336.4
1.336.3
1.336.2
1.336.1
1.336.0
Minor Changes
- #2954
228930aThanks @dustinbyrne! - feat: AddFeatureFlagResulttype (2026-01-28)
1.335.5
1.335.4
1.335.3
1.335.2
1.335.1
1.335.0
Minor Changes
- #2953
c8d3fbeThanks @pauldambra! - allows using web vitals with and without attribution (2026-01-23)
1.334.1
1.334.0
1.333.0
1.332.0
1.331.3
1.331.2
1.331.1
1.331.0
1.330.0
1.329.0
1.328.0
1.327.0
1.326.0
1.325.0
1.324.1
1.324.0
1.323.0
1.322.0
1.321.3
1.321.2
1.321.1
1.321.0
1.320.0
1.319.2
Patch Changes
- #2864
f64ebefThanks @rafaeelaudibert! - We were missing some public definitions inside@posthog/typesso let's fix them here. We've also fixed the typing inside theloadedcallback (2026-01-13)
1.319.1
1.319.0
1.318.2
1.318.1
1.318.0
Minor Changes
1.317.1
1.317.0
1.316.1
1.316.0
1.315.1
1.315.0
Minor Changes
- #2839
83b03feThanks @rafaeelaudibert! - Release new @posthog/types library to make it easy for those using the script version ofposthog-jsto properly typewindow.posthog(2026-01-06)