@posthog/core
1.59.1 · 14 Oct 2026MIT16M / weekRepositorynpmAtom feed
222 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
1.59.2
21 Oct 2026Local flag evaluation now matches a null property with string operators like the flags service, so negated operators such as
not_icontainsmatch instead of failing.
(2026-10-21)
1.59.1
14 Oct 2026Capture the Freebuff click identifier (
bfcid) as a campaign parameter, so it is set on events and as$initial_bfcidlike every other ad click ID.
(2026-10-14)
1.59.0
13 Oct 2026Attach trace exemplars to metrics recorded inside sampled spans.
(2026-10-13)
Minor Changes
Attach trace exemplars to metrics recorded inside sampled spans.
(2026-10-13)
1.58.1
12 Oct 2026Fix
before_sendcallback types to accept non-null events while still allowingnullreturns to drop events.
(2026-10-12)
Patch Changes
Fix
before_sendcallback types to accept non-null events while still allowingnullreturns to drop events.
(2026-10-12)
1.58.0
10 Oct 2026Change properties passed to
capture()and the other event methods to override SDK context properties such as$app_version,$os_nameand$lib, matching posthog-js and posthog-android
(2026-10-10)
1.57.4
9 Oct 2026Recognize native bundler debug IDs and build-time error tracking release IDs.
(2026-10-09)
1.57.3
8 Oct 2026Stop keeping
$react_native_versionon minimal$feature_flag_calledevents
(2026-10-08)
1.57.2
7 Oct 2026Sanitize each tool response once instead of twice, and replace image, audio and binary blocks before the scan, so tool calls with large results cost less CPU. Redact PostHog tokens that URL field decoding exposes.
(2026-10-07)
1.57.1
7 Oct 2026Fix
Unable to resolve module @posthog/core/surveyswhen bundling posthog-react-native on React Native 0.71–0.78 without Metro package exports. posthog-react-native 4.47.0 and later also pick up the fix by updating@posthog/core.
(2026-10-07)
1.57.0
6 Oct 2026Capture WebMCP tool intent and model metadata by default.
(2026-10-06)
Minor Changes
Capture WebMCP tool intent and model metadata by default.
(2026-10-06)
1.56.1
5 Oct 2026Keep
$react_native_versionon minimal$feature_flag_calledevents
(2026-10-05)
1.55.3
1 Oct 2026Capture the OpenAI Ads click identifier (
oppref) as a campaign parameter, so it is set on events and as$initial_oppreflike every other ad click ID.
(2026-10-01)
1.55.2
23 Sep 2026Honor
filters.holdoutduring local feature flag evaluation. A user in an experiment holdout now receives theholdout-<id>variant instead of being bucketed into a regular variant, matching how the server evaluates the same flag. The holdout is resolved before the release conditions, so a held-out user never reaches the flag's targeting — including when those conditions would have excluded them, soisFeatureEnabledcan return true where it previously returned false. Experiments with an active holdout will see variant assignment change for the held-out share of traffic on upgrade, bringing locally evaluated assignments in line with server-evaluated ones.
(2026-09-23)
1.55.1
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)Respect the definitions response's
property_matching_versionduring local feature flag evaluation. Version 2 uses explicit boolean/string equality and per-member array matching, while missing or other versions retain service legacy matching (including empty-array truthiness). Preserve the version in Node definition caches and Convex persisted definitions, and propagate it through person, group, cohort and dependency evaluation without mixing snapshots during reloads. Existing numeric ambiguity fallback and SemVer parsing policies are unchanged.
(2026-09-21)
Patch Changes
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)Respect the definitions response's
property_matching_versionduring local feature flag evaluation. Version 2 uses explicit boolean/string equality and per-member array matching, while missing or other versions retain service legacy matching (including empty-array truthiness). Preserve the version in Node definition caches and Convex persisted definitions, and propagate it through person, group, cohort and dependency evaluation without mixing snapshots during reloads. Existing numeric ambiguity fallback and SemVer parsing policies are unchanged.
(2026-09-21)
1.55.0
18 Sep 2026Support partial survey responses and persistent resume in React Native, moving surveys toward feature parity across SDKs.
(2026-09-18)
1.54.5
18 Sep 2026Coerce survey and product tour property filter values to strings before matching, so a numeric filter value from the
/surveysresponse no longer throws inicontains/not_icontains
(2026-09-18)
1.54.4
17 Sep 2026Share survey choice and question shuffling between web and React Native through surveys core. Use Fisher-Yates for web questions, preserve Other-last choice ordering, and avoid mutating configured choices.
(2026-09-17)
1.54.3
17 Sep 2026Fix declaration source mappings for DOMExceptionCoercer.
(2026-09-17)
1.54.2
15 Sep 2026Server-side feature flags now resolve in posthog-node and posthog-edge even when a proxy rewrites the request's
User-Agent. Flags restricted to theclientruntime now resolve toundefinedin these SDKs, where a rewrittenUser-Agentpreviously let them through.
(2026-09-15)
1.54.1
15 Sep 2026Capture causes and AggregateError members with relationship metadata and individual stacks, limiting output to 50 entries and 1,000 member inspections.
(2026-09-15)
1.54.0
14 Sep 2026Export the shared Retry-After parser with safe integer caps, GMT HTTP-date handling and rejection of non-HTTP dates.
(2026-09-14)
1.53.3
14 Sep 2026Require final 2xx responses for successful writes while preserving immediate-call error handling.
(2026-09-14)
1.53.2
11 Sep 2026Share the trySafe utility through @posthog/core.
(2026-09-11)
1.53.1
11 Sep 2026Child spans now share their parent's clock, so a child no longer appears to start before or end after its parent by up to a millisecond, or by more when the system clock is adjusted mid-trace.
(2026-09-11)
1.53.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)Cap the retry delay for log exports at 30 seconds, the ceiling the logs contract states. It previously doubled to 64 times the flush interval — 192s on web, 640s on React Native — so a log export now resumes within 30 seconds of a failing endpoint recovering, at the cost of more retry requests while that endpoint is down.
(2026-09-10)Keep backing off a failing log flush while new records arrive, instead of the next record resetting the retry to the flush interval.
(2026-09-10)
Minor Changes
Add 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)
Patch Changes
Cap the retry delay for log exports at 30 seconds, the ceiling the logs contract states. It previously doubled to 64 times the flush interval — 192s on web, 640s on React Native — so a log export now resumes within 30 seconds of a failing endpoint recovering, at the cost of more retry requests while that endpoint is down.
(2026-09-10)Keep backing off a failing log flush while new records arrive, instead of the next record resetting the retry to the flush interval.
(2026-09-10)Stop a throwing getter in
metrics.resourceAttributesfrom breaking every metrics export — the key is recorded as[Unserializable]instead.
(2026-09-10)Honor
Retry-Afterwhen the ingestion endpoint refuses a logs or metrics batch, instead of retrying on the SDK's own schedule alone. A refusal naming a longer wait extends the one being served, up to five minutes from when it started. Retry delays now carry jitter so clients refused together do not return together, and metrics backs off exponentially across consecutive failures rather than retrying on a fixed interval.
(2026-09-10)Logs and metrics now always send
service.nameandtelemetry.sdk.*, even when aresourceAttributesvalue is too large to encode in full. Previously that value could crowd them out, and the records reached PostHog with no service attribution.
(2026-09-10)Stop sending logs and metrics batches over 10 MiB, or too large to serialize at all, instead of spending a request to discover the endpoint refuses them.
(2026-09-10)
1.52.2
10 Sep 2026Error tracking no longer counts an injected script as your own code. A stack frame is
in_apponly when its filename names a script your app was served —http(s),file,blob,app,capacitor,ionic, a bundler scheme, or a bare path. A frame served over any other scheme, such as an in-app browser bridge oniabjs://or an extension content script onchrome-extension://, is kept for context but no longer groups the issue under your code.
(2026-09-10)
1.52.1
10 Sep 2026Fix recording package exports, native ESM loading, and strict TypeScript 4.7 consumer compatibility.
(2026-09-10)
1.52.0
9 Sep 2026Add a shared isUrl helper for HTTP(S) URLs and explicit relative paths.
(2026-09-09)
Minor Changes
Add a shared isUrl helper for HTTP(S) URLs and explicit relative paths.
(2026-09-09)
1.51.2
9 Sep 2026Include the root license and attribution notices in the published core package.
(2026-09-09)
1.51.1
9 Sep 2026error-tracking: collapse repeated frame cycles in parsed stack traces to reduce grouping differences caused by recursion depth, while preserving distinct throw locations
(2026-09-09)
1.51.0
7 Sep 2026Add best-effort in-app browser attribution using
$webview_appand$webview_app_version, without changing existing$browseror$browser_versionvalues. Detect explicit user-agent markers for Facebook, Facebook Lite, Messenger, Instagram, Threads, LinkedIn, Twitter, TikTok, WhatsApp, Snapchat, WeChat, LINE, Google, Bing, Pinterest, Naver, and KakaoTalk. Unknown apps and versions are omitted; missing markers do not imply a standalone browser.
(2026-09-07)
1.50.6
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)
Patch Changes
Clarify 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)
1.50.5
4 Sep 2026Stop counting stack frames that have no filename (in-app browser bridge scripts and other code the runtime reports without a script URL) as in-app code.
(2026-09-04)
Patch Changes
Stop counting stack frames that have no filename (in-app browser bridge scripts and other code the runtime reports without a script URL) as in-app code.
(2026-09-04)
1.50.4
3 Sep 2026Preserve explicitly false feature flag values supplied through bootstrap configuration.
(2026-09-03)
1.50.3
3 Sep 2026Fix
clampToRangediscarding a valid fallback value of0. It usedfallbackValue || max, so a0fallback (a legitimate value) was treated as absent and replaced bymax; it now uses??so0is honored.
(2026-09-03)
Patch Changes
Fix
clampToRangediscarding a valid fallback value of0. It usedfallbackValue || max, so a0fallback (a legitimate value) was treated as absent and replaced bymax; it now uses??so0is honored.
(2026-09-03)
1.50.2
1 Sep 2026Drop attributes with an empty key from exported logs and metrics instead of sending them. OTLP requires a non-empty key, and the server stored one verbatim, where it appeared as a nameless attribute that filters could not match.
(2026-09-01)
1.50.1
1 Sep 2026Add
os.nameandos.versionresource attributes to logs from the browser SDK, overridable vialogs.resourceAttributes
(2026-09-01)
1.50.0
1 Sep 2026Detect the Claude, Codex, and ChatGPT apps from their user agent markers:
$browsernow reports the app name instead ofChrome.ChatGPT versions its apps differently per platform, so its
$browser_versionis not comparable across platforms. (2026-09-01)Match local feature flag string operators, exact-value coercion, and JSON stringification with the flags service.
(2026-09-01)Change
bigintattributes on logs, metrics and spans to send as an int64 rather than as a string.
(2026-09-01)
1.49.2
28 Aug 2026Re-translate popover surveys when the display language changes while the survey is on screen, either from a browser
languagechangeevent or fromidentify()updating thelanguageperson property. In-progress answers are preserved.$survey_questions.questionand$survey_languageonsurvey sent/survey dismissednow report the text and language the user saw when they answered, not the language active when the event fired. Feedback-button (widget) surveys are unchanged.
(2026-08-28)
1.49.1
27 Aug 2026Narrow the
pinterestentry in the bot-detection blocklist topinterestbot, so real users on Pinterest's in-app browser (whose UA also contains the substringpinterest) are no longer misclassified as bots and silently excluded from analytics. The crawler's other UA variant remains covered by the existing genericbot.htmentry, so no bot-detection coverage is lost.
(2026-08-27)
1.49.0
27 Aug 2026Add
capturedAttoPostHogLogs.captureLog()for stamping a record with the time and context of when the event occurred, andPostHogLogs.clearQueue()for dropping every queued record
(2026-08-27)Fix request timeouts never firing on pages where a browser extension makes
Error.prototype.namenon-writable
(2026-08-27)
1.48.12
27 Aug 2026Stop crashing when the environment's
Math.random()misbehaves. The vendored UUIDv7 generator builds its random fields from aMath.random()-basednextUint32(), and a nonconformant implementation that returns a value of 1 or greater, or NaN, pushed those fields out of range, sofromFieldsV7threwRangeError: invalid field valueon every event captured. On React Native this is not hypothetical: Hermes implementsMath.randomwith C++std::uniform_real_distribution, which is documented to occasionally return its upper bound, and affected Android devices crash-looped on startup during the SDK's internal event-queue flush — a path applications cannot wrap in a try/catch.nextUint32()now clamps its result to a valid unsigned 32-bit integer (>>> 0), so a bad random value degrades UUID entropy for that id instead of taking the app down; the timestamp bits are untouched and generated ids remain spec-valid UUIDv7.
(2026-08-27)Treat omitted local evaluation properties as inconclusive for
is_not_set.
(2026-08-27)
1.48.11
25 Aug 2026Share feature flag matching, hashing, variant, and payload evaluation helpers across the Node.js and Convex SDKs without changing their runtime-specific SemVer behavior.
(2026-08-25)Share survey property matching between the browser and React Native SDKs while preserving their existing missing-value behavior.
(2026-08-25)
1.48.10
24 Aug 2026Fix buffered logs being dropped instead of retried after HTTP 408, 429 or 5xx
(2026-08-24)
1.48.9
24 Aug 2026The Node SDK now sends the raw gzip bytes as the request body instead of wrapping them in a
Blob. On Node 24.16 and later, reading aBlobrequest body leaks a nativeBlobReaderthat is never released, so a service callingcapture()andflush()once per request grew by roughly 2.3 KB of heap per event and never gave it back. This completes the work in #4423: switching tonode:zlibremoved the compression-time Blob reads, but the body itself was still a Blob and still got read once per request. Compression behaviour, headers and the wire format are unchanged, and the edge build keeps usingCompressionStream.
(2026-08-24)
1.48.8
21 Aug 2026Fix
reloadFeatureFlagsandreloadFeatureFlagsAsyncreturning flags evaluated before the caller's most recent identity or person-property change when several reloads overlap, and stop overlapping reloads from skipping the remote config refresh
(2026-08-21)
1.48.7
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)
Patch Changes
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.48.6
20 Aug 2026- removed
Drop events when a before-send hook throws instead of sending the unmodified event.
(2026-08-20) Stop building a stack frame for a
window.onerrorreport that carries no code position, such as theResizeObserverloop warning. The frame named the document URL rather than a script, so no source map could resolve it. These exceptions now arrive with no stack trace.
(2026-08-20)
1.48.5
19 Aug 2026Stop counting Chromium
<anonymous>stack frames (extension-injected, devtools or string-evaluated code) as in-app code.
(2026-08-19)