posthog-node
6.0.6
Patch Changes
- #5816
ffdb355Thanks @NikitaKurpas! - Document thatisLocalEvaluationReady()andwaitForLocalEvaluationReady()require at least one loaded flag; use thelocalEvaluationFlagsLoadedevent to observe empty loads. (2026-11-23)
6.0.5
Patch Changes
- #5817
4ae28afThanks @NikitaKurpas! - fix: keep falsy payloads (0,false,"") for locally evaluated flags inevaluateFlagsandgetAllFlagsAndPayloads(2026-11-19)
6.0.4
Patch Changes
- #5782
13f08eeThanks @rafaeelaudibert! - Send transactional email requests to/api/messaging/instead of the/api/projects/@current/alias, which PostHog is removing. Needs PostHog Cloud, or a self-hosted PostHog from 2026-11-18 or later. Older self-hosted versions answer these calls with a 404. (2026-11-18)
6.0.3
Patch Changes
-
#5747
59d9656Thanks @marandaneto! - Drop null-valued custom exception properties afterbeforeSendwithout undoing redaction or changing array positions. (2026-11-18) -
#5747
59d9656Thanks @marandaneto! - Preserve falsy JSON payloads in feature flag snapshots from legacy flag responses. (2026-11-18) -
Updated dependencies [
3000ae0,59d9656]:- @posthog/core@1.69.1
6.0.2
Patch Changes
- #5776
4495a66Thanks @gewenyu99! - Accept the 5.x option namesbefore_send,custom_blocked_useragents,disable_capture_url_hashes, and__preview_capture_bot_pageviewsagain as deprecated aliases. Each one maps to its camelCase name and logs one deprecation error per process. When both names are set, the camelCase one wins. In 6.0.0 the old names were ignored without a warning, so abefore_sendhook stopped running. (2026-11-17)
6.0.1
Patch Changes
- #5775
a410583Thanks @gewenyu99! - Add the missing commas to thecaptureImmediateandidentifydoc comment examples, so the examples parse when you copy them. (2026-11-17)
6.0.0
Major Changes
-
#5407
6405dfdThanks @eli-r-ph! - RemoveenterContext(); usewithContext()to scope async context to a callback. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Use camelCase SDK configuration names and typed boolean event options with support for additional JSON-valued options. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! -captureException()andcaptureExceptionImmediate()take an options object (distinctId,properties,options,uuid,flags,level). The old positional form still works in posthog-node 6.x.x and logs a deprecation error once per method.levelis read case-insensitively, with the same aliases as posthog-python (critical→fatal,warn→warning). An unknown level keepserror.registerOptions()andunregisterOptions()return a promise, andprepareEventMessage()returns a flat message with top-leveloptions,uuid,timestampanddisableGeoip. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Generated event uuids and personless distinct ids take their random bits fromcrypto.getRandomValuesinstead ofMath.random. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - A personal API key (phx_...) passed as the project API key now disables the client, like a missing key, and either case logs one error that never includes the key. Debug mode logs event names, uuids and counts instead of whole events, and abefore_sendfunction that throws is logged with the error's type instead of its message. In debug mode, a capture error can still include the server or proxy response text. A new client option,captureTracingHeaders(defaulttrue), controls whether the Express and NestJS integrations read theX-POSTHOG-DISTINCT-IDandX-POSTHOG-SESSION-IDrequest headers into the request context. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Analytics and AI events are batched and sent on separate lanes, in batches of about 5 MiB at most, and events that fail with a network error are kept and retried on the next flush.flush()no longer rejects on delivery failures (they arrive through the'error'event), andmaxQueueSizenow applies to analytics events only. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Values set on the event, in context or withregister()/ the newregisterOptions()now win over the values the SDK adds ($is_server,$geoip_disable, feature flag properties, trace ids), andbefore_sendsees and can change all of them. Context and registered properties and options, including the new contextoptions, also reach identify, alias and group identify events, but they do not setprocess_person_profileon$identify,$create_alias,$merge_dangerously,$groupidentify,$setor$set_onceevents whose distinct id the SDK did not generate, which default totrueunless the call sets it. An empty or whitespace distinct id counts as missing, and$groupidentifywithout a distinct id uses the context id, then$<type>_<key>.$geoip_disableand$groupsare filled beforebefore_send, so a hook that changes the message'sdisableGeoiporgroupsfield has no effect: edit the properties instead. Reserved exception properties such as$exception_levelpassed incaptureException()properties are now ignored, so the SDK's value is sent. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Every capture call takes a per-eventoptionsmap that is sent to capture unchanged (the SDK no longer converts option values). Legacy option properties still work, but an option overrides its legacy property. Use options. A$session_idor$window_idthat is not a string is dropped with a warning. Capture drops an event whose option value it cannot read, such ascookieless_mode: [1, 2, 3], and the SDK reports it through'error'withdetails: 'invalid_options'. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Events send$liband$lib_versionin their properties: a$libset on the event, in context or withregister()wins over the SDK's own pair, andbefore_sendcan change or remove them. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Capture follows only same-origin 307 and 308 redirects. Invalid event uuids are replaced with a warning, and dropped duplicate copies are reported. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Capture retries only 404, 408, 429, 500, 502, 503, 504 and network errors, waiting 100 ms doubled per retry with jitter (at most 30 s, at leastRetry-After). AddscaptureMaxRetries,captureCompression,captureAiCompression,captureAiMaxQueueSizeandcaptureAiRequestTimeoutMs. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Capture always uses capture v1:POSTHOG_CAPTURE_MODEis no longer read,captureAisends to/i/v1/ai/events, andCaptureV1Erroris nowCaptureError. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Send events only through capture v1, with AI events on their own lane. See the posthog-node 6.0.0 migration guide. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - An event whose name is missing, empty or not a string, or whose name, distinct id, session id or window id is not well-formed Unicode (a lone surrogate), is dropped before sending and reported through the'error'event, instead of being sent and failing at capture (an object name was sent as"[object Object]"). Lone surrogates in property strings are replaced with U+FFFD, so one bad character no longer fails the whole request. An unparseable event timestamp is still replaced with the current time, and now logs a warning that never includes the value. (2026-11-17)
Patch Changes
-
#5407
6405dfdThanks @eli-r-ph! - Export the table of per-event options and the event properties posthog-node 5.x.x reads instead, so posthog-node,@posthog/aiand@posthog/mcpshare one copy. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - A 2xx capture response whose JSON body has noresultsfield now fails the whole batch and reports it through the'error'event, like a body that is not JSON or has aresultsvalue that is not an object. The batch is not resent. A response with an emptyresultsobject still means every event was delivered. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - An event whosebefore_sendhook leavesdistinctIdmissing,nullor not a string is now dropped before sending and reported through the'error'event as a local drop (details: 'invalid event'). Before, the SDK sent the value as text, or sent""when the hook removed it. A caller's non-stringdistinctIdis now turned into a string beforebefore_sendruns, so a hook that leaves it alone still sends it. A hook that setsdistinctIdto""still sends it, and capture drops that event and reports it. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - Abefore_sendhook that throws is now logged withconsole.erroreven whendebugis off, so the dropped event is never silent. The line still names only the event and the error's type. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - An event with a property value that throws when the SDK reads or serializes it, such as a getter or atoJSONmethod that throws, is now dropped alone and reported through the'error'event as a local drop (details: 'unserializable event'). This covers the call's properties, the copy made forbefore_send, and serialization, on the analytics and AI lanes. In posthog-node 5.x.x, a value that threw while the client read the call's properties printed the raw error withconsole.error, and one that threw during serialization failed the whole batch and emitted the raw error on'error'. With no'error'listener, the SDK logs one line with the count and reason only. (2026-11-17) -
Updated dependencies [
6405dfd,6405dfd,6405dfd,6405dfd]:- @posthog/core@1.69.0
5.74.0
Minor Changes
- #5693
d8389d7Thanks @marandaneto! - Treat failed flag evaluations as unavailable: NodegetFeatureFlag()/isFeatureEnabled()returnundefined,getAllFlags()omits failed keys, and no failed values or payloads are exposed. (2026-11-15)
Patch Changes
- Updated dependencies [
d8389d7]:- @posthog/core@1.68.0
5.73.1
Patch Changes
- #5676
e8e850aThanks @DanielVisca! - fix(node):shutdown()now also sends logs captured while its logs flush was in flight, instead of dropping them (2026-11-14)
5.73.0
Minor Changes
-
#5538
db28c59Thanks @andehen! - Send$experiment_exposurefor config version 2 experiment splits, and send the reason code and rule attribution on$feature_flag_calledfor config version 2 flags in place of$feature_flag_reason. (2026-11-13) -
#5538
db28c59Thanks @andehen! - Request/flags/?v=4instead of/flags/?v=2and read its typed flag records. For a well-formed response, flag getters and$feature_flag_calledevents return the same values as before. A PostHog server that does not servev=4answers as it does forv=2, and that response is read as before.A flag record with a field of the wrong JSON type, such as a string
metadata.version, now reads as disabled: flag getters returnfalseand it has no payload. Other flags in the same response are not affected. This applies to both response versions, so tests that mock/flagsmay need to match the new URL and send correctly typed fields. (2026-11-13)
Patch Changes
- Updated dependencies [
db28c59]:- @posthog/core@1.67.3
5.72.0
Minor Changes
- #5514
4a2cbe7Thanks @Silthus! - Send cc, bcc and attachments with email from code. The SDK uploads each file PostHog doesn't have yet, then sends the email with the files' hashes. An email carries at most 10 files and 40 MB after Base64 encoding, about 29 MB of files. (2026-11-13)
5.71.0
Minor Changes
-
#5630
2877954Thanks @Silthus! - A send withtemplateKeynow takestrackingandsensitive.trackingchooses what PostHog tracks for the email.tracking: trueturns on opens, clicks and engagement events.tracking: falseturns them all off. An object such as{ clicks: true }or{ engagement: false }turns each kind on or off, and a key you leave out keeps its default. Without it, PostHog counts opens, captures engagement events, and counts clicks only when the email isn't sensitive.sensitivemarks an email that carries login links, reset tokens or codes. A sensitive email keeps its links as they are unlesstrackingturns clicks on, leaves its subject off engagement events, and keeps its content out of PostHog's logs. Without it, a send whosetemplateKeymatches a template saved in PostHog follows that template's setting, and any other send is sensitive. PostHog refusessensitive: falsewhen the matching template is sensitive. A send that sets neither option works exactly as before.captureEngagementis deprecated in favor oftracking: { engagement: false }. It keeps working, but PostHog refuses a send that sets both.trackingandsensitiveneed PostHog's API support, which is rolling out. Until it reaches your PostHog instance, PostHog refuses a send that sets either one. (2026-11-12)
5.70.0
Minor Changes
- #5511
b64482aThanks @Silthus! - Opt a recipient out of email topics, or back in, withposthog.emails.setPreferences({ to, topics, allMarketing }). One call sends the whole change in one request, using the client'ssecretKey. (2026-11-12)
5.69.0
Minor Changes
- #5634
ccd042aThanks @Silthus! -posthog.emails.send()takes a React Email element asreactand renders it with the optional peer@react-email/render. (2026-11-11)
5.68.2
Patch Changes
- #5637
5fc2aabThanks @andehen! - WithPOSTHOG_CAPTURE_MODE=v1, capture now retries404and429responses like408and5xxinstead of failing the batch at once. (2026-11-10)
5.68.1
Patch Changes
- #5649
69b3cb8Thanks @marandaneto! - Fix empty OR and legacy cohort group matching, and fall back to the server for unsupported group types. (2026-11-10)
5.68.0
Minor Changes
- #5642
21eb6bbThanks @rafaeelaudibert! - feat(node): let the NestJS interceptor take the request's distinct ID from agetDistinctIdoption or from identity already set in the PostHog context (2026-11-10)
5.67.2
Patch Changes
- #5648
f413efcThanks @marandaneto! - Fix nested cohortnot_inconditions in local feature flag evaluation. (2026-11-10)
5.67.1
Patch Changes
- #5626
44e6251Thanks @luantaraschi! - Relative date filters in local flag evaluation no longer roll past the end of a shorter month.1mon March 31 now resolves to February 28, matching the flags service. (2026-11-10) - Updated dependencies [
44e6251]:- @posthog/core@1.67.1
5.67.0
Minor Changes
-
#5596
9ffdaf6Thanks @DanielVisca! - feat(node): addinstrumentRequestandposthogHonoMiddlewarefor fetch-API servers (Hono, Bun, Deno, Next route handlers). They readx-posthog-session-id, wrap the request inwithContext, open a server span that continuestraceparentand is named by route, mark 5xx as errors, and recordhttp.server.request.durationandhttp.server.request.count.feat(core): add
PostHogMetrics.flushCoalesced(), a flush that callers can request once per unit of work: concurrent calls share one queued send, and it waits out a metrics backoff. (2026-11-10)
Patch Changes
- Updated dependencies [
9ffdaf6]:- @posthog/core@1.67.0
5.66.0
Minor Changes
- #5633
12d1f15Thanks @Silthus! - Convex functions in the default runtime can now importposthog-nodewithout"use node". (2026-11-10)
5.65.0
Minor Changes
-
#5598
fb313feThanks @DanielVisca! - feat(node): stamp the configuredserviceName(fromtracesormetrics) on events asservice_name(2026-11-10) -
#5599
fee9beeThanks @DanielVisca! - feat(node): add a logs API,posthog.logger.info(...)andposthog.captureLog(...), configured with thelogsoption. Records attach the active span's trace and span ids and thewithContextdistinctId and sessionId, andserviceNamedefaults to the traces or metrics one. (2026-11-10) -
#5599
fee9beeThanks @DanielVisca! - feat(node): exposetraceIdandspanIdgetters on theSpanhandle, for correlating logs from other loggers with a trace without parsingtraceparent()(2026-11-10)
Patch Changes
- Updated dependencies [
fee9bee]:- @posthog/core@1.66.0
5.64.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)
Patch Changes
- Updated dependencies [
fac34e4,bfbaff7]:- @posthog/core@1.65.0
5.63.2
Patch Changes
- #5540
f8e4866Thanks @andehen! - Treat a/flagsresponse whoseflagsfield is not an object as a failed request instead of throwing aTypeError, and report it toerrorevent listeners. (2026-11-09)
5.63.1
Patch Changes
- #5545
28fe8c0Thanks @onmax! - Parse Node stack frames for functions namedasyncwithout a leading parenthesis in the filename. (2026-11-06) - Updated dependencies [
28fe8c0]:- @posthog/core@1.64.1
5.63.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)
Patch Changes
- Updated dependencies [
aa66d4c]:- @posthog/core@1.64.0
5.62.0
Minor Changes
-
#5509
71c2464Thanks @Silthus! -posthog.emails.send()can now send email content your code rendered, such as HTML from React Email. Give the email atemplateKeyand asubject, and passhtml,textor both.1const posthog = new PostHog("phc_...", { secretKey: "phs_..." }); 2 3const { data, error } = await posthog.emails.send({ 4 to: "user@example.com", 5 distinctId: "user_123", 6 templateKey: "password-reset", 7 subject: "Reset your password", 8 html: renderedHtml, 9}); 10if (error) throw error; 11 12// 'delivered', 'bounced', ... 13const { data: status } = await posthog.emails.get(data.id);You need a project secret API key, the kind that starts with
phs_. Create one under Project secret API keys in your project settings. Set its Transactional email scope to Write to send emails, or to Read for a key that only reads statuses. Pass it to the client assecretKey. SetappHostto your PostHog app URL when you self-host PostHog or send through a reverse proxy.PostHog records each email's delivery, opens and clicks on the person with that
distinctId. It groups every email with the sametemplateKey, so you see their metrics and logs in one place. The SDK retries a request that hits a network error, a rate limit or an outage twice by default. Every send carries an idempotency key, so a retry never sends the email twice. Pass your ownidempotencyKey, such aswelcome:user_123, and your job runner's retries are safe too.A send with your own content also takes
from,replyToandcaptureEngagement: false. SetmigratedFromon the client to tell PostHog which email provider you moved from. A failed call returns anEmailErrorwith PostHog'scodeand the HTTPstatusCode.Docs: Send transactional emails with Node.js and the transactional email overview. (2026-11-05)
5.61.3
Patch Changes
- #5532
88744a9Thanks @marandaneto! - Skip client-only flag warnings and unnecessary server fallback during bulk evaluation. (2026-11-05)
5.61.2
Patch Changes
- #5487
c019e96Thanks @mayteio! -posthog.emails.send()now sends a flat request body withtemplate_idanddistinct_idat the top level. (2026-11-02)
5.61.1
Patch Changes
- #5472
de8435fThanks @ablaszkiewicz! - fix: exception autocapture now captures unhandled promise rejections when the app or framework (for example Next.js, Nitro or PM2) has its ownunhandledRejectionlistener, without changing what Node does with the rejection. Each occurrence is captured once per project, however many clients the app creates, and an error reported more than once in the same turn of the event loop (rethrown by a host listener, or one Error object rejected by two promises) is captured once. When the process survives the error, autocapture captures it at the end of the current turn of the event loop, so that acaptureExceptioncall for the same error in that turn, from the app's own listener or a framework's error hook such as Nitro's, is the one sent, with itsdistinctIdand properties. AcaptureExceptioncall for an error that autocapture already captured in the same turn is skipped. When the app flushes or shuts down a client, that client captures at once what is still waiting for the end of the turn, so a crash handler that flushes or shuts down and then exits still sends the error. A crash is captured whatever the error, anAbortErroror a framework's control flow included. A rejection that the app handles only later is still captured, as Node reports it as unhandled. Next.js and React control-flow errors andAbortErrorrejections are skipped when the process survives them. (2026-10-30)
5.61.0
Minor Changes
- #5418
c705824Thanks @mayteio! - Send transactional email from a PostHog email template withposthog.emails.send(), using the newappHost,emailRequestTimeoutMsandemailRequestMaxRetriesclient options. Read what happened to a sent email withposthog.emails.get(id), using the message ID thatsend()returned. (2026-10-30)
Patch Changes
- Updated dependencies [
c705824]:- @posthog/core@1.62.0
5.60.1
Patch Changes
-
#5471
0058ef9Thanks @gustavohstrassburger! - fix: let later conditions resolve a flag locally when an unexpected error follows a filter that local evaluation cannot check, instead of failing the whole flag (2026-10-29) -
#5471
0058ef9Thanks @gustavohstrassburger! - fix: fall back to the server when a flag depends on a flag that only the server can evaluate (for example, one with a static cohort), instead of letting a later condition choose a different value locally.unresolvedFlagsreports such a flag asunresolved_dependency(2026-10-29)
5.60.0
Minor Changes
- #5270
4b25f7fThanks @DanielVisca! - The Express and NestJS integrations can read the session ID, and the distinct ID of an identified user, from the posthog-js cookie when a request has no tracing headers, so backend events link to browser sessions on same-site requests without frontend configuration. Turn it on with thereadPostHogCookieoption. (2026-10-29)
5.59.0
Minor Changes
- #5252
503c3eaThanks @andehen! - Reads from anevaluateFlags()snapshot now honorsendFeatureFlagEvent: false, andisEnabled()/getFlag()accept asendFeatureFlagEventsoption that overrides it for one read. If you setsendFeatureFlagEvent: falseand rely on snapshot reads for experiment exposures, passsendFeatureFlagEvents: trueon those reads. (2026-10-28)
Patch Changes
- Updated dependencies [
503c3ea]:- @posthog/core@1.61.2
5.58.0
Minor Changes
- #5314
096131dThanks @pauldambra! - Add an optional OpenTelemetry context processor, and an optionalsignalthat ends a context's lifetime. (2026-10-28)
5.57.2
Patch Changes
- #5422
b5036c4Thanks @posthog! - fix: esbuild no longer fails to bundle posthog-node when the optional@opentelemetry/apipeer is not installed (2026-10-25)
5.57.1
Patch Changes
-
#5385
faacff0Thanks @carlos-marchal-ph! - Apply the clientprivacyModeoption to AI integrations, keep prompts out of errors, provider metadata and OTel spans in privacy mode, and redact MCP tool credentials (2026-10-23) -
#5354
f827137Thanks @marandaneto! - Fall back instead of returning inconsistent local regex flag results for Unicode and advanced patterns. (2026-10-23) -
Updated dependencies [
f827137]:- @posthog/core@1.60.1
5.57.0
Minor Changes
-
#5234
1991b99Thanks @gustavohstrassburger! - feat: report flags local evaluation could not resolve onevaluateFlags()snapshots viaunresolvedFlags, tag reads of them withlocal_evaluation_inconclusive, and warn once about flags whose definition local evaluation does not supportBehavior changes:
- A condition with a filter local evaluation cannot check and a filter that does not match now resolves locally as no match, instead of falling back to a server request or staying unresolved.
$feature_flag_calledevents from snapshot reads reportlocal_evaluation_inconclusiveinstead offlag_missingfor these flags.- The load-time warning now also logs with
strictLocalEvaluation: true. (2026-10-22)
Patch Changes
- Updated dependencies [
1991b99]:- @posthog/core@1.60.0
5.56.4
Patch Changes
- #5350
17260e5Thanks @marandaneto! - Fall back from local flag evaluation when a required property value is undefined. (2026-10-21) - Updated dependencies [
17260e5]:- @posthog/core@1.59.3
5.56.3
Patch Changes
- #5307
189da75Thanks @quotentiroler! - Local flag evaluation now matches a null property with string operators like the flags service, so negated operators such asnot_icontainsmatch instead of failing. (2026-10-21) - Updated dependencies [
189da75]:- @posthog/core@1.59.2
5.56.2
Patch Changes
- #5263
cd31356Thanks @dustinbyrne! - Allow local feature flag evaluation from a shared definition cache without a secret or personal API key. (2026-10-16)
5.56.1
Patch Changes
- #5289
e6598beThanks @pauldambra! - Link captured exceptions to active OpenTelemetry traces when the API is available. (2026-10-14)
5.56.0
Minor Changes
- #5291
7c10169Thanks @DanielVisca! - Attach trace exemplars to metrics recorded inside sampled spans. (2026-10-13)
Patch Changes
- Updated dependencies [
7c10169]:- @posthog/core@1.59.0
5.55.3
Patch Changes
- #5281
8f2d581Thanks @marandaneto! - Fixbefore_sendcallback types to accept non-null events while still allowingnullreturns to drop events. (2026-10-12) - Updated dependencies [
8f2d581]:- @posthog/core@1.58.1
5.55.2
Patch Changes
- #5268
74d7eb2Thanks @marandaneto! - Clarify which server-only credentials to use for local evaluation when a project API key is supplied instead. (2026-10-11)
5.55.1
Patch Changes
- #5134
175413fThanks @posthog! - Evict only the least recently used distinct ids from the$feature_flag_calleddedupe cache instead of clearing it entirely.distinctIdHasSentFlagCallsnow returns a snapshot, so writing or deleting individual keys on it no longer changes deduplication. (2026-10-08)
5.55.0
Minor Changes
- #5140
2d2560aThanks @dustinbyrne! - AllowfeatureFlagsPollingInterval: nullto disable automatic local flag polling while retaining initialization and manual refresh. (2026-09-30)
5.54.1
Patch Changes
- #4832
ac479dbThanks @dustinbyrne! - Support snake_case feature flag cache payloads while preserving compatibility with camelCase providers and cached data. (2026-09-25)
5.54.0
Minor Changes
- #5099
e3955f8Thanks @marandaneto! - Expose feature flag evaluation reasons and preserve them in OpenFeature resolution metadata. (2026-09-25)
5.53.0
Minor Changes
- #5050
31dd1adThanks @posthog! - Read a feature flag's evaluation runtime withgetFeatureFlagEvaluationRuntime(key)andgetFeatureFlagKeysByEvaluationRuntime(runtime)(2026-09-23)
5.52.6
Patch Changes
- #5078
f4704acThanks @rubychilds! - Honorfilters.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) - Updated dependencies [
f4704ac]:- @posthog/core@1.55.2
5.52.5
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) -
#4800
aad7464Thanks @marandaneto! - Respect the definitions response'sproperty_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) -
Updated dependencies [
9cd8ebd,aad7464]:- @posthog/core@1.55.1
5.52.4
Patch Changes
- #4885
39a8980Thanks @decknamec! - Server-side feature flags now resolve in posthog-node and posthog-edge even when a proxy rewrites the request'sUser-Agent. Flags restricted to theclientruntime now resolve toundefinedin these SDKs, where a rewrittenUser-Agentpreviously let them through. (2026-09-15) - Updated dependencies [
39a8980]:- @posthog/core@1.54.2
5.52.3
Patch Changes
- #4941
07c1045Thanks @marandaneto! - Capture causes and AggregateError members with relationship metadata and individual stacks, limiting output to 50 entries and 1,000 member inspections. (2026-09-15) - Updated dependencies [
07c1045]:- @posthog/core@1.54.1
5.52.2
Patch Changes
- #4951
55c5142Thanks @marandaneto! - Fix Express exception events reporting the initial response status instead of the final HTTP status. (2026-09-14)
5.52.1
Patch Changes
- #4908
4a3c74bThanks @turnipdabeets! - Child 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) - Updated dependencies [
4a3c74b]:- @posthog/core@1.53.1
5.52.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)
Patch Changes
-
#4579
19e78ccThanks @turnipdabeets! - Stop a throwing getter inmetrics.resourceAttributesfrom breaking every metrics export — the key is recorded as[Unserializable]instead. (2026-09-10) -
#4579
19e78ccThanks @turnipdabeets! - HonorRetry-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) -
#4579
19e78ccThanks @turnipdabeets! - Logs and metrics now always sendservice.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) -
#4579
19e78ccThanks @turnipdabeets! - 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) -
Updated dependencies [
19e78cc,19e78cc,19e78cc,19e78cc,19e78cc,19e78cc,19e78cc]:- @posthog/core@1.53.0
5.51.8
Patch Changes
- #4798
4358915Thanks @posthog! - fix(error-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) - Updated dependencies [
4358915]:- @posthog/core@1.51.1
5.51.7
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) - Updated dependencies [
74ca945]:- @posthog/core@1.50.6
5.51.6
Patch Changes
- #4719
56148bdThanks @github-actions! - Expose exception capture methods through theIPostHoginterface. (2026-09-01)
5.51.5
Patch Changes
-
#4661
444bf35Thanks @marandaneto! - Match local feature flag string operators, exact-value coercion, and JSON stringification with the flags service. (2026-09-01) -
#4708
6723395Thanks @turnipdabeets! - Changebigintattributes on logs, metrics and spans to send as an int64 rather than as a string. (2026-09-01) -
Updated dependencies [
444bf35,6ae173f,6723395]:- @posthog/core@1.50.0
5.51.4
Patch Changes
-
#4636
74ff567Thanks @yfwmaniish! - Narrow thepinterestentry 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) -
#4660
dfc3b59Thanks @posthog! - HonorevaluationContextsduring local evaluation — flags whose evaluation contexts don't overlap the configured list are no longer evaluated locally and resolve toundefined. (2026-08-27) -
Updated dependencies [
74ff567]:- @posthog/core@1.49.1
5.51.3
Patch Changes
- #4651
e899b1cThanks @marandaneto! - Treat omitted local evaluation properties as inconclusive foris_not_set. (2026-08-27) - Updated dependencies [
7902e44,e899b1c]:- @posthog/core@1.48.12
5.51.2
Patch Changes
-
#4639
1faeb74Thanks @marandaneto! - Handle empty feature flag evaluation key scopes without running local or remote evaluation. (2026-08-25) -
#4610
930de19Thanks @marandaneto! - Share 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) -
Updated dependencies [
930de19,d4eee8f]:- @posthog/core@1.48.11
5.51.1
Patch Changes
- #4614
3593c43Thanks @iamomiid! - The Node SDK now sends the raw gzip bytes as the request body instead of wrapping them in aBlob. 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) - Updated dependencies [
3593c43]:- @posthog/core@1.48.9
5.51.0
Minor Changes
- #4564
233ac88Thanks @marandaneto! - Fall back to remote evaluation when a requested flag is missing from loaded local definitions. This changes scoped calls that previously omitted the flag without making a request. (2026-08-24)
5.50.0
Minor Changes
- #4484
557140eThanks @posthog! -FeatureFlagEvaluations.isEnabled()now accepts an optionaldefaultValueoption, returned whenever the flag has no value (missing key, not loaded, or a failed request). A flag with a present value — includingfalseand variant strings — always wins overdefaultValue. Purely additive; omitting the option preserves the existingfalse-on-miss behavior. (2026-08-21)
5.49.4
Patch Changes
- #4569
00d22eaThanks @v11t! - fix getFeatureFlagResult returning null variant instead of undefined when remotely evaluated (2026-08-21)
5.49.3
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) - Updated dependencies [
6322f09]:- @posthog/core@1.48.7
5.49.2
Patch Changes
- #4578
bae46bfThanks @marandaneto! - Drop events when a before-send hook throws instead of sending the unmodified event. (2026-08-20) - Updated dependencies [
bae46bf,aef2f49]:- @posthog/core@1.48.6
5.49.1
Patch Changes
- #4521
0a0206fThanks @marandaneto! - Normalize capture timestamp overrides to equivalent UTC ISO strings in the browser and Node.js SDKs and shared core. (2026-08-14) - Updated dependencies [
0a0206f]:- @posthog/core@1.48.1
5.49.0
Minor Changes
- #4289
c9086deThanks @carlos-marchal-ph! - Public betacaptureAi()/captureAiImmediate(): AI events on a dedicated isolated endpoint with the event UUID returned. NewenableFullAiCaptureoption replaces the internal_useAiLane/_enableMultimodalCapture; wrappers route through the AI endpoint and skip redaction/truncation when set (privacy mode still wins). (2026-08-13)
Patch Changes
- Updated dependencies [
c9086de]:- @posthog/core@1.48.0
5.48.2
Patch Changes
- #4506
a77115bThanks @marandaneto! - Log shutdown timeouts without rejecting, and correct the Node.jsshutdown()return type toPromise<void>. (2026-08-12) - Updated dependencies [
a77115b]:- @posthog/core@1.47.1
5.48.1
Patch Changes
-
#4346
4751b33Thanks @marandaneto! - Enforce configured request timeouts while consuming Capture V1 response bodies. (2026-08-06) -
#4423
64ba193Thanks @marandaneto! - Use Node's zlib gzip implementation for Node SDK payloads to avoid sustained memory growth from frequent Web Streams compression. (2026-08-06) -
Updated dependencies [
64ba193]:- @posthog/core@1.46.9
5.48.0
Minor Changes
- #4342
fa3457fThanks @haacked! - Support thestarts_with,not_starts_with,ends_with, andnot_ends_withproperty filter operators in feature flag local evaluation. Matching is case-insensitive and mirrorsicontains, so flags using these operators no longer fall back to remote evaluation. (2026-08-05)
5.47.11
Patch Changes
- #4380
3c40b6cThanks @marandaneto! - Keep request timeouts active through response body consumption and clarify eventual event UUID deduplication semantics. (2026-08-05) - Updated dependencies [
3c40b6c]:- @posthog/core@1.46.8
5.47.10
Patch Changes
- #4287
d3c4538Thanks @posthog! - Keep$referring_domainand canonicalutm_*/campaign parameters on minimal$feature_flag_calledevents. Previously the minimal allowlist stripped every campaign parameter, so a flag-called event landing first in a session could set the session's UTM attribution and channel type to NULL in web analytics. (2026-08-04) - Updated dependencies [
d3c4538]:- @posthog/core@1.46.7
5.47.9
Patch Changes
- #4350
facb4c1Thanks @marandaneto! - FixenableExceptionAutocapturesuppressing Node's default crash on unhandled promise rejections; fatal rejections instrictorwarn-with-error-codemode and rejections handled by anotherunhandledRejectionlistener are no longer captured. (2026-08-04)
5.47.8
Patch Changes
- #4348
d4ffb83Thanks @marandaneto! - Schedule local feature flag polls after each request settles. (2026-08-04) - Updated dependencies [
821a2c6]:- @posthog/core@1.46.6
5.47.7
Patch Changes
- #4352
1cf9c6dThanks @marandaneto! - Bound stack source context reads and skip non-regular or oversized files. (2026-08-03)
5.47.6
Patch Changes
- #4381
f3a71a1Thanks @marandaneto! - Clear completed lifecycle timeout handles so successful shutdowns do not leave timers running. (2026-08-03) - Updated dependencies [
f3a71a1]:- @posthog/core@1.46.4
5.47.5
Patch Changes
- #4155
eb0a793Thanks @ATKasem! - fix:personPropertiesandgroupPropertieson the feature flag methods are no longer typed asRecord<string, string>, so numeric and boolean values type-check without a cast. Local evaluation already handled them —matchPropertytakesRecord<string, any>and compares numerically forgt/gte/lt/lte— only the public types disagreed. These now use the sharedPropertiestype (personProperties?: Properties,groupProperties?: Record<string, Properties>), matchingsetPersonPropertiesForFlags/setGroupPropertiesForFlagsso theanycan be narrowed later. Types only, no runtime change. (2026-08-03) - Updated dependencies [
eb0a793]:- @posthog/core@1.46.3
5.47.4
Patch Changes
- #4347
7c3a9afThanks @marandaneto! - Preserve events added to a full queue while an earlier batch is being flushed. (2026-08-03) - Updated dependencies [
7c3a9af]:- @posthog/core@1.46.2
5.47.3
Patch Changes
-
#4349
0e2b371Thanks @marandaneto! - Apply the feature flag definition request timeout while consuming the response body. (2026-07-31) -
#4349
0e2b371Thanks @marandaneto! - Keep the feature flag definition request timeout active until the request settles. (2026-07-31)
5.47.2
Patch Changes
- #4332
b9a241eThanks @ioannisj! - Fixidentify()leaving a user anonymous when the supplied ID already matches the persisted distinct ID (for example after a non-identified bootstrap seeded the same ID). The user is now marked identified and a person-processed$setevent is captured. Ports the same fix from posthog-js (browser) to the shared core used by React Native, Node, and posthog-js-lite. (2026-07-31) - Updated dependencies [
b9a241e]:- @posthog/core@1.46.1
5.47.1
Patch Changes
- #4351
15aad20Thanks @marandaneto! - Isolate NestJS request context per Observable subscription. (2026-07-31)
5.47.0
Minor Changes
- #4308
6e7f3aeThanks @ablaszkiewicz! - Emit the release id that posthog-cli injects into your bundle as$release_idon$exceptionevents, so PostHog can attach exceptions to a release without joining through symbol sets. AddsgetInjectedReleaseId()to@posthog/core. The property is only attached when an injected release id can be read. (2026-07-30)
Patch Changes
- Updated dependencies [
6e7f3ae]:- @posthog/core@1.46.0
5.46.1
Patch Changes
- #4234
6c8fde0Thanks @hpouillot! - Normalize V8 Promise combinator stack frames so input indexes are not treated as source filenames. (2026-07-23) - Updated dependencies [
6c8fde0]:- @posthog/core@1.45.1
5.46.0
Minor Changes
-
#4172
9621830Thanks @haacked! - send minimal$feature_flag_calledevents when the server enables itWhen the v2
/flagsresponse carriesminimalFlagCalledEvents: true(or, for posthog-node local evaluation, the flag-definitions payload carriesminimal_flag_called_events: true) and the evaluated flag is not linked to an experiment ($feature_flag_has_experiment === false),$feature_flag_calledevents are rebuilt from a strict allowlist of flag-evaluation, processing-control, and SDK-identity properties. Super properties,$set/$set_once, the$feature/<key>enumeration,$active_feature_flags, and the context envelope are stripped. Any missing signal (no gate on the response, bootstrapped or locally injected flags,has_experimentunknown) falls back to the full event, and experiment-linked flags always send the full envelope. The gate is stored alongside the cached flags (posthog-js persistence, posthog-node poller state) and is server-controlled, with no SDK-side configuration.before_sendruns after the filter and may re-add stripped properties. (2026-07-20)
Patch Changes
- Updated dependencies [
9621830]:- @posthog/core@1.44.0
5.45.2
Patch Changes
- #4168
06d19a2Thanks @dustinbyrne! - Avoid Next.js Edge runtime warnings for native compression and fatal error handling. (2026-07-16) - Updated dependencies [
06d19a2]:- @posthog/core@1.43.1
5.45.1
Patch Changes
- #4164
9eb2b28Thanks @dustinbyrne! - Fix the default Node.js event flush interval at 5 seconds. (2026-07-16)
5.45.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)
Patch Changes
- Updated dependencies [
fad6d9a]:- @posthog/core@1.43.0
5.44.0
Minor Changes
- #4153
fc2cb2eThanks @eli-r-ph! - Raise the defaultmaxQueueSizefrom 1000 to 10000. Backend workloads are more likely to burst-enqueue events synchronously ahead of a flush than browser/mobile clients, so the previous default risked silently dropping events under bursty load. An explicitmaxQueueSizeoption still overrides this default. (2026-07-15)
Patch Changes
- Updated dependencies [
fc2cb2e]:- @posthog/core@1.42.1
5.43.0
Minor Changes
-
#4117
1eddff7Thanks @DanielVisca! - add the posthog.metrics API (count, gauge, histogram) to posthog-node — alphaBackend services can now record metrics through the same statsd-style pre-aggregating client the browser SDK ships, with no OpenTelemetry setup:
1const client = new PostHog("phc_...", { 2 metrics: { serviceName: "billing-worker" }, 3}); 4client.metrics.count("invoices.processed", 1, { 5 attributes: { plan: "pro" }, 6}); 7client.metrics.gauge("queue.depth", 42); 8client.metrics.histogram("job.duration", 187, { unit: "ms" });Samples aggregate in memory and flush as OTLP/JSON to
/i/v1/metrics(one data point per series per window). Pending metrics are flushed onshutdown(). Core gains_sendMetricsBatchonPostHogCoreStateless(same outcome contract as_sendLogsBatch) and a sharedresolveMetricsConfig, so any core-based SDK can hostPostHogMetrics. (2026-07-15)
Patch Changes
- Updated dependencies [
1eddff7]:- @posthog/core@1.42.0
5.42.0
Minor Changes
- #4101
dc2aa5bThanks @posthog! - Expose the error tracking rate-limiter config via the newexceptionRateLimiterRefillRateandexceptionRateLimiterBucketSizeoptions. Burst protection is scoped per exception type (each distinct$exceptiontype gets its own token bucket, with no aggregate cap across types), so these let customers with high-cardinality exception types tune the per-type allowance. (2026-07-14)
Patch Changes
- Updated dependencies [
dc2aa5b]:- @posthog/core@1.41.0
5.41.0
Minor Changes
-
#4105
203284aThanks @eli-r-ph! - Add opt-in Capture V1 support. Set thePOSTHOG_CAPTURE_MODE=v1environment variable to submit analytics events to the Capture V1 endpoint (/i/v1/analytics/events) instead of the legacy/batch/endpoint, on both the batched and immediate send paths. The default remainsv0, so existing behavior is unchanged unless you opt in. Opt-in is env-var-only during the transition (no public option), so nothing on the API surface has to be removed when v1 later becomes the default.Capture V1 uses Bearer auth, lifts legacy
$-sentinel properties into a typedoptionsobject, and does per-event partial retry with exponential backoff clamped againstRetry-After. Dropped and undelivered events are surfaced on the clienterrorchannel as aCaptureV1Error.$ai_*events continue to use the legacy submitter for now, regardless of the capture mode.In
v1mode,$ai_*events are routed to an isolated in-memory queue and flushed independently of the Capture V1 queue, so the two transports never share a batch and a failure on one cannot re-send events already accepted on the other. Each queue keeps its own retry/durability semantics: the legacy queue re-queues on network failure (retrying on later flushes), while the V1 queue exhausts the sender's own attempt budget per cycle and then surfaces the failure rather than re-queuing. (2026-07-11)
Patch Changes
- Updated dependencies [
203284a]:- @posthog/core@1.40.2
5.40.0
Minor Changes
- #4060
0b49a4cThanks @turnipdabeets! - AddsecretKeyconfig as the canonical alias for the deprecatedpersonalApiKey(accepts a Personal API Key or Project Secret API Key). (2026-07-07)
5.39.4
Patch Changes
- #4047
0c11747Thanks @marandaneto! - Stop duplicatingdistinct_idinside/flagsperson properties. (2026-07-02) - Updated dependencies [
5e7e132]:- @posthog/core@1.39.5
5.39.3
Patch Changes
- #4055
64e04baThanks @marandaneto! - Retry/flagsrequests that receive HTTP 502 or 504 responses across SDKs that use the shared core flags client. (2026-07-02) - Updated dependencies [
64e04ba]:- @posthog/core@1.39.4
5.39.2
Patch Changes
- #4028
a664b81Thanks @marandaneto! - Make Nodeflush()wait for pending asynchronous SDK work before draining the event queue, so events produced by helpers likecaptureException()are not missed. Pending work rejections no longer prevent queued events from flushing. (2026-07-01) - Updated dependencies [
a664b81]:- @posthog/core@1.39.3
5.39.1
Patch Changes
-
#4029
b36b1ccThanks @marandaneto! - Callbefore_sendfor identify, group identify, and alias events. (2026-06-30) -
#4027
ab118d2Thanks @marandaneto! - Safely serialize event batches with circular property references instead of crashing during flush. (2026-06-30) -
Updated dependencies [
ab118d2]:- @posthog/core@1.39.2
5.39.0
Minor Changes
- #4006
0063128Thanks @github-actions! - AddgroupIdentifyImmediate()to await the network request when identifying a group, mirroringcaptureImmediate/identifyImmediate/aliasImmediate. Useful in edge/serverless environments where the background queue may not flush. The Convex integration now uses it directly instead of routing$groupidentifythroughcaptureImmediate. (2026-06-30)
Patch Changes
- Updated dependencies [
0063128]:- @posthog/core@1.39.0
5.38.8
Patch Changes
- #3974
08b404bThanks @mjfaga! - Fix local evaluation ignoring thein/not_inoperator on cohort-based flag conditions. "Not in cohort" was evaluated as "in cohort", inverting cohort-exclusion flags. Now applies the operator to the cohort membership result. (2026-06-29)
5.38.7
Patch Changes
- #3961
619a25cThanks @marandaneto! - Retry feature flag requests after transient network errors only. The feature flag request retry count defaults to 1 and can be set to 0 to disable retries. (2026-06-29) - Updated dependencies [
619a25c]:- @posthog/core@1.38.1
5.38.6
Patch Changes
- #3896
606ef43Thanks @GauthierPLM! - Only stamp $groups from the top-levelgroupswhen present (2026-06-26)
5.38.5
Patch Changes
- #3955
8e9689aThanks @marandaneto! - Dedupe feature flag called events per returned flag value. (2026-06-24) - Updated dependencies [
8e9689a]:- @posthog/core@1.37.3
5.38.4
Patch Changes
- #3938
6391106Thanks @dustinbyrne! - Respectdisable_capture_url_hasheswhen capturing Express and NestJS request URLs. (2026-06-23)
5.38.3
Patch Changes
- #3937
4d59d0eThanks @marandaneto! - Deprecate the Node SDK Sentry integration and point users to PostHog Error Tracking for Node. (2026-06-23) - Updated dependencies [
440e370]:- @posthog/core@1.37.0
5.38.2
Patch Changes
- #3903
6b21f77Thanks @marandaneto! - Validate custom event UUID overrides and generate new UUIDs when invalid. (2026-06-19) - Updated dependencies [
6b21f77]:- @posthog/core@1.35.3
5.38.1
Patch Changes
- #3886
e6d7fe2Thanks @marandaneto! - Stop sending deprecated no-op top-leveltype,library, andlibrary_versionfields in event batch payloads. Useproperties.$libandproperties.$lib_versionfor SDK metadata; legacy queuedlibraryandlibrary_versionvalues are used as fallbacks when the official$properties are missing. (2026-06-18) - Updated dependencies [
e6d7fe2]:- @posthog/core@1.35.2
5.38.0
Minor Changes
- #3845
a0553b3Thanks @marandaneto! - AddsetPersonProperties()andunsetPersonProperties()helpers to manage person properties from the Node.js SDK. (2026-06-16)
Patch Changes
- Updated dependencies [
b3ec845,c6c163a]:- @posthog/core@1.33.0
5.37.1
Patch Changes
- #3837
29bf8e3Thanks @marandaneto! - Add missing bugs metadata to package manifests. (2026-06-15) - Updated dependencies [
29bf8e3]:- @posthog/core@1.32.4
5.37.0
Minor Changes
- #3705
d6fc0a5Thanks @gustavohstrassburger! - feat(feature-flags): support theearly_exitcondition option in local evaluation. When a flag enables early exit, evaluation now stops and returnsfalseas soon as a condition group's property filters match but the rollout percentage excludes the user, instead of falling through to later groups — matching the server-side evaluation behavior. (2026-06-12)
5.36.17
Patch Changes
- Updated dependencies []:
- @posthog/core@1.32.3
5.36.16
Patch Changes
- Updated dependencies [
25822ac]:- @posthog/core@1.32.2
5.36.15
Patch Changes
- Updated dependencies []:
- @posthog/core@1.32.1
5.36.14
Patch Changes
- Updated dependencies [
612f97a]:- @posthog/core@1.32.0
5.36.13
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.4
5.36.12
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.3
5.36.11
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.2
5.36.10
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.1
5.36.9
Patch Changes
- Updated dependencies [
0c2acb9]:- @posthog/core@1.31.0
5.36.8
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.14
5.36.7
Patch Changes
- #3748
7820929Thanks @marandaneto! - Reduce duplicate internal code found by dry4ts. (2026-06-09) - Updated dependencies []:
- @posthog/core@1.30.13
5.36.6
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.12
5.36.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.11
5.36.4
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.10
5.36.3
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.9
5.36.2
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.8
5.36.1
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.7
5.36.0
Minor Changes
- #3728
9287c87Thanks @turnipdabeets! - Add a configurable$is_serverevent property (defaulttrue) so PostHog can identify server-side events. SetisServer: falsewhen using the SDK as a client/CLI so the device OS is attributed normally. (2026-06-04)
5.35.15
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.6
5.35.14
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.5
5.35.13
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.4
5.35.12
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.3
5.35.11
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.2
5.35.10
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.1
5.35.9
Patch Changes
- #3703
f3cc6faThanks @marandaneto! - Disable/no-op initialization paths instead of throwing or sending requests when PostHog project tokens are missing or blank. (2026-06-01) - Updated dependencies [
3d4a76f]:- @posthog/core@1.30.0
5.35.8
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.15
5.35.7
Patch Changes
- Updated dependencies [
d9ad199]:- @posthog/core@1.29.14
5.35.6
Patch Changes
- #3681
7b84b75Thanks @ablaszkiewicz! - unify captureException in posthog core (2026-05-28) - Updated dependencies [
7b84b75]:- @posthog/core@1.29.13
5.35.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.12
5.35.4
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.11
5.35.3
Patch Changes
- Updated dependencies [
5568f12]:- @posthog/core@1.29.10
5.35.2
Patch Changes
- #3658
5d7a2d3Thanks @gustavohstrassburger! - Include group context in the $feature_flag_called deduplication key in _captureFlagCalledEventIfNeeded, so events fire independently per group combination. (2026-05-25)
5.35.1
Patch Changes
- Updated dependencies [
c806cca]:- @posthog/core@1.29.9
5.35.0
Minor Changes
- #3642
18ea8b5Thanks @dustinbyrne! - Promote feature flag definition cache provider types to the mainposthog-nodeexport and deprecateposthog-node/experimentalimports. (2026-05-21)
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.8
5.34.10
Patch Changes
- #3643
f42f371Thanks @dmarticus! - Reject semver values with leading zeros in local flag evaluation. Per semver 2.0.0 §2, numeric identifiers must not include leading zeros — values like1.07.3are not valid semver and should not match targeting conditions. Both override values and flag values are now validated; invalid inputs surface asInconclusiveMatchErrorso the condition does not match. (2026-05-21)
5.34.9
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.7
5.34.8
Patch Changes
- #3640
12ef3f6Thanks @hpouillot! - FixidentifyImmediateto await the underlying network request. Previously the returned promise resolved before the$identifyevent was sent, causing events to be dropped when called from short-lived runtimes (Vercel/Cloudflare Workers, Convex actions) that exit immediately afterawait. (2026-05-21)
5.34.7
Patch Changes
- Updated dependencies [
a880dbc]:- @posthog/core@1.29.6
5.34.6
Patch Changes
- #3623
e119eecThanks @richardsolomou! - Fix six edge cases in local feature flag evaluation.gt/gte/lt/ltenow compare numerically when both sides parse as finite numbers — previously a string override like"10"against numeric value9slipped into lexicographic comparison and returned false, andparseFloat's NaN return value leaked through the old!= nullguard.is_not_setnow resolves locally — true when the property key is absent, false when present — instead of always throwingInconclusiveMatchErrorand forcing the flag to return undefined. Flag-level condition properties withnegation: trueare now correctly inverted, matching the existing cohort-path behavior inmatchPropertyGroup. An inactive flag (active: false) now short-circuits to false even whenensure_experience_continuity: true— previously it threwInconclusiveMatchErrorand resolved to undefined.is_setnow returns true for properties whose value isnullorundefinedas long as the key is present —is_setis about key presence, not value. Cohort property groups containing a flag-type property no longer silently skip the dependency; the cohort eval is now marked inconclusive so the flag returns undefined instead of a wrong definitive answer. (2026-05-19)
5.34.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.5
5.34.4
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.4
5.34.3
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.3
5.34.2
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.2
5.34.1
Patch Changes
- Updated dependencies [
4b895bf]:- @posthog/core@1.29.1
5.34.0
Minor Changes
- #3599
ad60818Thanks @turnipdabeets! - Expose UUID and cookie helpers from@posthog/coreandposthog-nodefor users managing distinct_id outside the browser SDK (e.g. Lambda functions handing out cross-domain redirects). The helpers were already implemented in@posthog/next— this change lifts them to core so all SDKs can re-use them.@posthog/nextnow re-exports the same surface from@posthog/coreto keep existing consumers working without churn. Closes #2143. (2026-05-12)
Patch Changes
- Updated dependencies [
ad60818]:- @posthog/core@1.29.0
5.33.7
Patch Changes
- Updated dependencies [
223d925]:- @posthog/core@1.28.7
5.33.6
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.6
5.33.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.5
5.33.4
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.4
5.33.3
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.3
5.33.2
Patch Changes
- #3516
220cd61Thanks @marandaneto! - fix: consume fetch response body to prevent CF Workers runtime warnings (2026-05-04) - Updated dependencies [
220cd61,255b273]:- @posthog/core@1.28.2
5.33.1
Patch Changes
- Updated dependencies [
8aee3d5]:- @posthog/core@1.28.1
5.33.0
Minor Changes
-
#3476
f8bc02fThanks @dmarticus! - AddevaluateFlags()and a newflagsoption oncapture()so a single/flagsrequest powers both flag branching and event enrichment per incoming request:1const flags = await posthog.evaluateFlags(distinctId, { 2 personProperties: { plan: "enterprise" }, 3}); 4if (flags.isEnabled("new-dashboard")) { 5 renderNewDashboard(); 6} 7posthog.capture({ distinctId, event: "page_viewed", flags });The returned
FeatureFlagEvaluationssnapshot exposesisEnabled(),getFlag(),getFlagPayload()for branching, plusonlyAccessed()andonly([keys])for filtering which flags get attached to a captured event. PassflagKeys: [...]toevaluateFlags()to scope the underlying/flagsrequest itself.captureException()/captureExceptionImmediate()accept aflagsargument so$exceptionevents carry the same flag context as the rest of your request's events.Deprecates
isFeatureEnabled(),getFeatureFlag(),getFeatureFlagPayload(), andcapture({ sendFeatureFlags }). They continue to work but now log a deduped[PostHog] ... is deprecatedwarning the first time they're used. Removal is planned for the next major version. (2026-05-02)
5.32.1
Patch Changes
- Updated dependencies [
cf56753,04db756]:- @posthog/core@1.28.0
5.32.0
Minor Changes
- #3474
70ba8f8Thanks @patricio-posthog! - feat(flags): support mixed targeting in local evaluation (2026-04-30)
5.31.0
Minor Changes
- #3491
974e4b2Thanks @dustinbyrne! - Add Express and NestJS request context support for PostHog tracing headers. (2026-04-29)
5.30.8
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.9
5.30.7
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.8
5.30.6
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.7
5.30.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.6
5.30.4
Patch Changes
- Updated dependencies [
70508df]:- @posthog/core@1.27.5
5.30.3
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.4
5.30.2
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.3
5.30.1
Patch Changes
- Updated dependencies [
daf028d]:- @posthog/core@1.27.2
5.30.0
Minor Changes
- #3457
eadbcd7Thanks @hpouillot! - send relative file paths in frames (2026-04-23)
5.29.7
Patch Changes
- Updated dependencies [
96f19b7]:- @posthog/core@1.27.1
5.29.6
Patch Changes
- Updated dependencies [
1a8b727]:- @posthog/core@1.27.0
5.29.5
Patch Changes
- Updated dependencies [
922a1c1]:- @posthog/core@1.26.0
5.29.4
Patch Changes
- #3407
b26c57cThanks @patricio-posthog! - fix(flags): switch local evaluation polling from/api/feature_flag/local_evaluationto/flags/definitions(2026-04-21)
5.29.3
Patch Changes
- #3426
1a0b58dThanks @marandaneto! - Trim surrounding whitespace from user-provided API keys, personal API keys, and host config values before using them. (2026-04-21) - Updated dependencies [
1a0b58d]:- @posthog/core@1.25.3
5.29.2
Patch Changes
- #3351
c735b08Thanks @dmarticus! - Send $device_id as a top-level field in /flags requests so the feature flags service can use it for device-based bucketing during remote evaluation (2026-04-09) - Updated dependencies [
c735b08]:- @posthog/core@1.25.2
5.29.1
Patch Changes
- Updated dependencies [
57ee5b2]:- @posthog/core@1.25.1
5.29.0
Minor Changes
- #3302
fc5589fThanks @dmarticus! - preserve $set_once semantics in local flag evaluation cache (2026-04-07)
Patch Changes
- Updated dependencies [
fc5589f]:- @posthog/core@1.25.0
5.28.11
Patch Changes
- Updated dependencies [
a01a3d5]:- @posthog/core@1.24.6
5.28.10
Patch Changes
- #3309
197eedaThanks @marandaneto! - Extract CLI and sourcemap utilities from @posthog/core into @posthog/plugin-utils to remove cross-spawn from React Native dependencies (2026-04-01) - Updated dependencies [
197eeda]:- @posthog/core@1.24.5
5.28.9
Patch Changes
- Updated dependencies [
a863914]:- @posthog/core@1.24.4
5.28.8
Patch Changes
- Updated dependencies [
4bdfdbc]:- @posthog/core@1.24.3
5.28.7
Patch Changes
- Updated dependencies [
8d34289]:- @posthog/core@1.24.2
5.28.6
Patch Changes
- #3282
5784dcaThanks @marandaneto! - fix: captureException now uses distinctId from request context (2026-03-26)
5.28.5
Patch Changes
- Updated dependencies [
314120a]:- @posthog/core@1.24.1
5.28.4
Patch Changes
- Updated dependencies [
9cd2313]:- @posthog/core@1.24.0
5.28.3
Patch Changes
- #3243
697e423Thanks @hpouillot! - fix captureExceptionImmediate return value (2026-03-18)
5.28.2
Patch Changes
-
#3236
bc30c2dThanks @dustinbyrne! - Omit the config query parameter by default to request only the necessary data (2026-03-13) -
#3236
bc30c2dThanks @dustinbyrne! - fix: Client shutdown awaits the feature flags poller to stop (2026-03-13) -
Updated dependencies [
bc30c2d,bc30c2d]:- @posthog/core@1.23.4
5.28.1
Patch Changes
- Updated dependencies [
4009c15]:- @posthog/core@1.23.3
5.28.0
Minor Changes
- #3197
33e9fb4Thanks @hpouillot! - Add nestjs integration with interceptor for context propagation (2026-03-05)
5.27.1
Patch Changes
- #3186
4601bbcThanks @dmarticus! - Add semver comparison operators to local feature flag evaluation: semver_eq, semver_neq, semver_gt, semver_gte, semver_lt, semver_lte, semver_tilde, semver_caret, and semver_wildcard (2026-03-05)
5.27.0
Minor Changes
- #3187
2eff595Thanks @dustinbyrne! - feat: Accept awaitUntilmethod for serverless environments (2026-03-04)
5.26.2
Patch Changes
- Updated dependencies [
5e8d5fc]:- @posthog/core@1.23.2
5.26.1
Patch Changes
- #3163
0dc03b0Thanks @gustavohstrassburger! - Improve local feature flag evaluation debugging by adding timestamp tracking. Locally evaluated flags now include timing information in$feature_flag_calledevents to help debug cache TTL and timing issues, matching what's available for remote evaluation. (2026-03-02)
5.26.0
Minor Changes
-
#3144
d43e90dThanks @dustinbyrne! - feat: getFeatureFlagResult, getAllFlags, getAllFlagsAndPayloads now have context-sensitive overrides which do not requiredistinctIdas a parameter, instead reading it from the current context. (2026-02-25) -
#3144
d43e90dThanks @dustinbyrne! - feat: AddenterContext()to attach a context to the current async execution context (2026-02-25)
5.25.0
Minor Changes
- #3132
301e75aThanks @benjackwhite! - Officially adds support for super properties added with.register(it was available as a function but did not actually work previously) (2026-02-23)
5.24.17
Patch Changes
- #3107
9dbc05eThanks @ablaszkiewicz! - warning on manual capture('$exception') (2026-02-18) - Updated dependencies [
9dbc05e]:- @posthog/core@1.23.1
5.24.16
Patch Changes
- Updated dependencies [
e962f01]:- @posthog/core@1.23.0
5.24.15
Patch Changes
- Updated dependencies [
0acf16f]:- @posthog/core@1.22.0
5.24.14
Patch Changes
- Updated dependencies [
d578824]:- @posthog/core@1.21.0
5.24.13
Patch Changes
- #3056
846a7f2Thanks @richardsolomou! - feat: Add /edge subpath export for non-standard edge runtimes (2026-02-09)
5.24.12
Patch Changes
- Updated dependencies [
e055f9a]:- @posthog/core@1.20.2
5.24.11
Patch Changes
- Updated dependencies [
8f75dae]:- @posthog/core@1.20.1
5.24.10
Patch Changes
- Updated dependencies [
bb62809]:- @posthog/core@1.20.0
5.24.9
Patch Changes
- Updated dependencies [
c99e5fe]:- @posthog/core@1.19.0
5.24.8
Patch Changes
- Updated dependencies [
7768010]:- @posthog/core@1.18.0
5.24.7
Patch Changes
- Updated dependencies [
727536c]:- @posthog/core@1.17.0
5.24.6
Patch Changes
- Updated dependencies [
cbe84c1]:- @posthog/core@1.16.0
5.24.5
Patch Changes
- #2987
25f4173Thanks @marandaneto! - fix: before_send in node inferred the type as any instead of EventMessage or null (2026-01-29)
5.24.4
Patch Changes
- Updated dependencies [
8c0c495]:- @posthog/core@1.15.0
5.24.3
Patch Changes
- Updated dependencies [
f51560c]:- @posthog/core@1.14.1
5.24.2
Patch Changes
- Updated dependencies [
933c763]:- @posthog/core@1.14.0
5.24.1
Patch Changes
- Updated dependencies [
8a5a3d5]:- @posthog/core@1.13.0
5.24.0
Minor Changes
- #2897
b7fa003Thanks @matheus-vb! - Add $feature_flag_error to $feature_flag_called events to track flag evaluation failures (2026-01-20)
Patch Changes
- Updated dependencies [
b7fa003,f0cbc0d]:- @posthog/core@1.12.0
5.23.0
Minor Changes
-
#2900
23770e9Thanks @dmarticus! - RenamedevaluationEnvironmentstoevaluationContextsfor clearer semantics. The term "contexts" better reflects that this feature is for specifying evaluation contexts (e.g., "web", "mobile", "checkout") rather than deployment environments (e.g., "staging", "production").Deprecated
posthog.initoptionevaluationEnvironmentsis now deprecated in favor ofevaluationContexts. The old property will continue to work and will log a deprecation warning. It will be removed in a future major version.
Migration Guide
1// Before 2posthog.init('<ph_project_api_key>', { 3 evaluationEnvironments: ['production', 'web', 'checkout'], 4}) 5 6// After 7posthog.init('<ph_project_api_key>', { 8 evaluationContexts: ['production', 'web', 'checkout'], 9}) 10``` (2026-01-19)
Patch Changes
- Updated dependencies [
23770e9]:- @posthog/core@1.11.0
5.22.0
Minor Changes
- #2930
c9b773aThanks @marandaneto! - chore: Bump node min. ^20.20.0 || >=22.22.0 due to https://nodejs.org/en/blog/vulnerability/january-2026-dos-mitigation-async-hooks (2026-01-19)
5.21.2
Patch Changes
- #2920
099ee0cThanks @haacked! - Add getFeatureFlagResult method to retrieve flag value and payload in a single API call. (2026-01-19)
5.21.1
Patch Changes
- Updated dependencies [
d37e570]:- @posthog/core@1.10.0
5.21.0
Minor Changes
-
#2883
640fcddThanks @ordehi! - Add warning when experience continuity flags are detected during local evaluation, and newstrictLocalEvaluationoption.Warning: When using local evaluation with flags that have experience continuity enabled, a warning is now emitted explaining that these flags will cause server requests on every evaluation, negating local evaluation cost savings.
New option:
strictLocalEvaluation: truecan be set at client init to prevent all server fallback for flag evaluations. Flags that cannot be evaluated locally will returnundefinedinstead of making a server request. This is useful in high-volume environments where you want to guarantee no unexpected server costs. (2026-01-14)
5.20.0
Minor Changes
- #2593
fba9fb2Thanks @daibhin! - track LLMA trace_id on exceptions and exception_id on traces (2026-01-08)
Patch Changes
- Updated dependencies [
fba9fb2,c1ed63b]:- @posthog/core@1.9.1
5.19.0
Minor Changes
- #2840
84e4140Thanks @ordehi! - Add overrideFeatureFlags() method for local testing and development (2026-01-06)
5.18.1
Patch Changes
- #2825
5a4a8e2Thanks @haacked! - getFeatureFlag() respects exponential backoff for HTTP 401, 403, and 429 responses. (2025-12-30)
5.18.0
Minor Changes
- #2782
04065b9Thanks @haacked! - Add $feature_flag_error to $feature_flag_called events when an error occurred while trying evaluate a flag (2025-12-22)
Patch Changes
- Updated dependencies [
b676b4d]:- @posthog/core@1.9.0
5.17.4
Patch Changes
- Updated dependencies [
6b0aabf]:- @posthog/core@1.8.1
5.17.3
Patch Changes
- Updated dependencies [
2603a8d]:- @posthog/core@1.8.0
5.17.2
Patch Changes
- #2678
ca4436eThanks @haacked! - Local evaluation polling sends If-None-Match header with latest etag to reduce bandwidth when no flags have changed. (2025-12-04)
5.17.1
Patch Changes
-
#2690
e9c00fdThanks @robbie-c! - Related to https://www.wiz.io/blog/critical-vulnerability-in-react-cve-2025-55182We didn't include any of the vulnerable deps in any of our packages, however we did have them as dev / test / example project dependencies.
There was no way that any of these vulnerable packages were included in any of our published packages.
We've now patched out those dependencies.
Out of an abundance of caution, let's create a new release of all of our packages. (2025-12-04)
-
Updated dependencies [
e9c00fd]:- @posthog/core@1.7.1
5.17.0
Minor Changes
- #2671
a1dde5cThanks @ablaszkiewicz! - make contexts inherit by default (2025-12-03)
5.16.0
Minor Changes
- #2603
e1617d9Thanks @dmarticus! - add $feature_flag_evaluated_at properties to $feature_flag_called events (2025-12-03)
Patch Changes
- Updated dependencies [
e1617d9]:- @posthog/core@1.7.0
5.15.0
Minor Changes
-
#2614
2be0eb3Thanks @dustinbyrne! - fix: Improve cache initialization performance (2025-12-01) -
#2588
ef589b6Thanks @ablaszkiewicz! - add context support (2025-12-01)
5.14.1
Patch Changes
- #2636
922afafThanks @hpouillot! - forward session and distinct id in express error handler (2025-11-28)
5.14.0
Minor Changes
- #2619
86dab38Thanks @hpouillot! - package deprecation (2025-11-24)
Patch Changes
- Updated dependencies [
86dab38]:- @posthog/core@1.6.0
5.13.3
Patch Changes
- #2618
3eed1a4Thanks @marandaneto! - last version was compromised (2025-11-24) - Updated dependencies [
3eed1a4]:- @posthog/core@1.5.6
5.13.2
Patch Changes
- Updated dependencies [
83f5d07]:- @posthog/core@1.5.5
5.13.1
Patch Changes
- Updated dependencies [
c242702]:- @posthog/core@1.5.4
5.13.0
Minor Changes
-
#2600
8972000Thanks @dustinbyrne! - fix:fetchis called without a bound contextThis prevents issues in edge runtimes such as Cloudflare (2025-11-19)
Patch Changes
- #2575
8acd88fThanks @hpouillot! - fix frame platform property for $exception events (2025-11-19) - Updated dependencies [
8acd88f]:- @posthog/core@1.5.3
5.12.0
Minor Changes
- #2594
4ad3678Thanks @dustinbyrne! - feat: AddFlagDefinitionCacheProviderinterface and client configuration option
5.11.2
Patch Changes
- Updated dependencies [
87f9604]:- @posthog/core@1.5.2
5.11.1
Patch Changes
- Updated dependencies [
d8d98c9]:- @posthog/core@1.5.1
5.11.0
Minor Changes
- #2520
068d55eThanks @lricoy! - Add bot pageview collection behind preview flag. Enables tracking bot traffic as$bot_pageviewevents when the__preview_capture_bot_pageviewsflag is enabled.
Patch Changes
- Updated dependencies [
068d55e]:- @posthog/core@1.5.0
5.10.4
Patch Changes
- Updated dependencies [
751b440]:- @posthog/core@1.4.0
5.10.3
Patch Changes
- Updated dependencies [
e0a6fe0]:- @posthog/core@1.3.1
5.10.2
Patch Changes
- #2470
a581328Thanks @luke-belton! - Fix crash caused by callinggetFeatureFlagPayloadsfor a flag that depends on a static cohort
5.10.1
Patch Changes
- #2465
1721abaThanks @haacked! - Fix bug where flag doesn't fallback to the server correctly when one condition is a static cohort condition but a later condition matches.
5.10.0
Minor Changes
-
#2417
daf919bThanks @dmarticus! - feat: Add evaluation environments support for feature flagsThis PR implements support for evaluation environments in the posthog-node SDK, allowing users to specify which environment tags their SDK instance should use when evaluating feature flags.
Users can now configure the SDK with an
evaluationEnvironmentsoption:1const client = new PostHog("api-key", { 2 host: "https://app.posthog.com", 3 evaluationEnvironments: ["production", "backend", "api"], 4});When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.
Patch Changes
-
#2431
7d45a7aThanks @marandaneto! - fix: remove deprecated attribute $exception_personURL from exception events -
Updated dependencies [
daf919b,7d45a7a]:- @posthog/core@1.3.0
5.9.5
Patch Changes
- Updated dependencies [
10da2ee]:- @posthog/core@1.2.4
5.9.4
Patch Changes
-
#2414
e19a384Thanks @hpouillot! - create a common logger for node and react-native -
Updated dependencies [
e19a384]:- @posthog/core@1.2.3
5.9.3
Patch Changes
- #2406
ea58d34Thanks @dmarticus! - UseSubtleCryptodirectly to compute SHA-1 hashes, fix "module not found" warning in edge runtimes.
5.9.2
Patch Changes
-
#2370
5820942Thanks @hpouillot! - remove testing from posthog-core -
Updated dependencies [
5820942]:- @posthog/core@1.2.2
5.9.1
Patch Changes
-
#2356
caecb94Thanks @hpouillot! - use core error tracking processing -
Updated dependencies [
caecb94]:- @posthog/core@1.2.1
5.9.0
Minor Changes
- #2348
ac48d8fThanks @hpouillot! - chore: align js syntax with package support
Patch Changes
- Updated dependencies [
ac48d8f]:- @posthog/core@1.2.0
5.8.8
Patch Changes
- #2350
a1ae750Thanks @andyzzhao! - feature flag local evaluation will not sort condition sets with variant overrides to the top
5.8.7
Patch Changes
- fix: don't sort condition sets with variant overrides to the top - conditions are now evaluated in their original order to match server-side logic
5.8.6
Patch Changes
- #2346
117b150Thanks @marandaneto! - fix: node onException autocapture safely access the exception_List
5.8.5
Patch Changes
- Updated dependencies [
da07e41]:- @posthog/core@1.1.0
5.8.4
Patch Changes
- #2312
dff84c6Thanks @daibhin! - chore: allow PostHog exception capture to be skipped in Sentry integration
5.8.3
Patch Changes
- #2306
30873bcThanks @haacked! - Fix memory leak when calling getAllFlags and getAllFlagsAndPayloads
5.8.2
Patch Changes
-
#2285
20c1b38Thanks @dustinbyrne! -getFeatureFlagandisFeatureEnablednow respect thesendFeatureFlagEventclient option if not explicitly specified when called. -
#2285
20c1b38Thanks @dustinbyrne! - ThesendFeatureFlagEventsoption forgetFeatureFlagPayloadis now marked as deprecated as it is not used.
5.8.1
Patch Changes
- #2243
1981815Thanks @hpouillot! - - fix error handling on process crash- fix exception flushing
- Updated dependencies [
1981815]:- @posthog/core@1.0.2
5.8.0
Minor Changes
Patch Changes
- Updated dependencies [
44d10c4]:- @posthog/core@1.0.1
5.7.0
Minor Changes
- #2218
cfe1e94Thanks @oliverb123! - Added before_send function
5.6.0 – 2025-07-15
- Added support for filtering feature flags with flagKeys parameter in sendFeatureFlags options
5.5.1 – 2025-07-15
- wrap
InconclusiveMatchErrors inlogMsgIfDebugfor local flag evaluations onsendFeatureFlags
5.5.0 – 2025-07-10
- feat: make the
sendFeatureFlagsparameter more declarative and ergonomic. Implementation notes below:
Modified sendFeatureFlags to be type boolean | SendFeatureFlagsOptions, (which is defined thusly)
1export interface SendFeatureFlagsOptions {
2 onlyEvaluateLocally?: boolean;
3 personProperties?: Record<string, any>;
4 groupProperties?: Record<string, Record<string, any>>;
5}
This lets users declare (1) whether to use local evaluation, and (2) which properties to supply explicitly for that evaluation, every time they want to send feature flags. It also supports the old boolean behavior if folks don't care and would rather the SDK infer it.
Now, you can make calls like this
1posthog.captureImmediate({
2 distinctId: "user123",
3 event: "test event",
4 sendFeatureFlags: {
5 onlyEvaluateLocally: true,
6 personProperties: {
7 plan: "premium",
8 },
9 },
10 properties: {
11 foo: "bar",
12 },
13});
or simply
posthog.captureImmediate({
distinctId: "user123",
event: "test event",
sendFeatureFlags: true // this will still infer local evaluation if it appears to be configured, but it won't try to pull properties from the event message
properties: {
foo: "bar",
},
});
5.4.0 – 2025-07-09
feat: respect local evaluation preferences with sendFeatureFlags; add property overrides from the event to those local computations so that the locally evaluated flags can be more accuratee. NB: this change chagnes the default behavior of capture and captureImmediately – we will now only send feature flag data along with those events if sendFeatureFlags is explicitly specified, instead of optimistically sending along locally evaluated flags by default.
5.3.1 - 2025-07-07
- feat: decouple feature flag local evaluation from personal API keys; support decrypting remote config payloads without relying on the feature flags poller
5.2.1 - 2025-07-07
- feat: add captureExceptionImmediate method on posthog client
5.1.1 - 2025-06-16
- fix: Handle double-encoded JSON payloads from the remote config endpoint
5.1.0 - 2025-06-12
- chore: use
/flags?v=2&config=trueinstead of/decide?v=4for the flag evaluation backend
5.0.0 - 2025-06-10
Removed
- Remove
is_simple_flagfromPostHogFeatureFlagtype - Remove
captureModein favor ofjsoncapture mode only - Remove deprecated
personPropertiesandgroupPropertiesin favor ofsetPersonPropertiesForFlagsandsetGroupPropertiesForFlags
Breaking changes
- feat: migrate to native fetch, Node 20+ required
- PostHog Node now compresses messages with GZip before sending them to our servers when the runtime supports compression. This reduces network bandwidth and improves performance. Network traffic interceptors and test assertions on payloads must handle GZip decompression to inspect the data. Alternatively, you can disable compression by setting
disableCompression: truein the client configuration during tests.
5.0.0-alpha.1 - 2025-04-29
Breaking changes
- feat: migrate to native fetch, Node 18+ required
Added
- rotate session id if expired after 24 hours
4.17.2 - 2025-05-22
- chore: improve event prop types
- fix: no throw in sendImmediate
4.17.1 - 2025-05-02
- fix: fix imports for old node.js version
4.17.0 - 2025-05-02
- fix: specific exports for edge environments
4.16.0 - 2025-05-01
- chore: improve flush event
4.15.0 - 2025-04-30
- chore: add immediate-mode
- chore: better error logging when flushing events
4.14.0 - 2025-04-24
- feat: Add super properties as a concept to the Node SDK
4.13.0 - 2025-04-21
- feat: Add method to wait for local evaluation feature flag definitions to be loaded
4.12.0 – 2025-04-17
- chore: roll out new feature flag evaluation backend to majority of customers
4.11.7 - 2025-04-16
- fix: do not reference
node:prefix as it is not supported by Next.js edge runtime
4.11.6 - 2025-04-15
Fixed
- move survey export top-level declarations
4.11.5 - 2025-04-14
Fixed
- export and declare top-level declarations for surveys
4.11.4 - 2025-04-14
Fixed
- export top-level declarations for surveys
4.11.3 - 2025-04-08
Fixed
- do not access
fsorreadlinein when not available e.g. edge environments
4.11.2 - 2025-04-07
Fixed
- chore: bump axios to 1.8.2 (fixes CVE-2025-27152)
4.11.1 - 2025-03-28
Fixed
getFeatureFlag,isFeatureEnabled, andgetAllFlagsAndPayloadsnow returnundefinedif the flag is not found.
4.11.0 - 2025-03-28
Added
$feature_flag_calledevent now includes additional properties such asfeature_flag_id,feature_flag_version,feature_flag_reason, andfeature_flag_request_id.
Fixed
- apiKey cannot be empty.
4.10.2 - 2025-03-06
- Add: log error message when feature flags have computation errors.
4.10.1 – 2025-03-06
- Fix: only set
platformon PostHog exception frame properties - Fix: prevent fetch floods when rate-limited.
4.10.0 – 2025-03-06
- Attach requestId to $feature_flag_called if present in /decide response
4.9.0 – 2025-03-04
- Allow feature flags to be evaluated individually when local evaluation is not being used
4.8.1 – 2025-02-26
- Supports gracefully handling quotaLimited responses from the PostHog API for feature flag evaluation
4.8.0 - 2025-02-26
- Add guardrails and exponential error backoff in the feature flag local evaluation poller to prevent high rates of 401/403 traffic towards
/local_evaluation
4.7.0 - 2025-02-20
Added
- Adds the ability to capture user feedback in LLM Observability using the
captureTraceFeedbackandcaptureTraceMetricmethods.
4.6.0 - 2025-02-12
Added
- Adds ability to fetch decrypted remote config flag payloads via
getRemoteConfigPayload
4.5.2 - 2025-02-12
Fixed
- fix: Fixed edge case where
$feature_flag_calledevents were enriched with additional feature flag data when they shouldn't be.
4.5.1 - 2025-02-12
Fixed
- Do not require a
distinctIdas an argument tocaptureException
4.5.0 - 2025-02-06
Added
- Adds manual exception capture with full stack trace processing via
captureExceptionfunction - Adds ability to enable exception autocapture via the
enableExceptionAutocaptureinit option
4.4.1 - 2025-01-21
- Add option privacyMode to remove input and output from LLM Observability
4.4.0 - 2025-01-15
Switch from rusha to native (node:crypto) sha1 implementation
4.3.2 - 2024-12-11
- REVERT: Fix bug where this SDK incorrectly sent
$feature_flag_calledevents with null values when usinggetFeatureFlagPayload.
4.3.1 - 2024-11-26
- Fix bug where this SDK incorrectly sent
$feature_flag_calledevents with null values when usinggetFeatureFlagPayload.
4.3.0 - 2024-11-25
- Add Sentry v8 support to the Sentry integration
4.2.3 - 2024-11-21
- fix: identify method allows passing a $set_once object
4.2.2 - 2024-11-18
- fix: Shutdown will now respect the timeout and forcefully return rather than returning after the next fetch.
4.2.1 - 2024-10-14
- fix: only log messages if debug is enabled
4.2.0 - 2024-08-26
- Added
historicalMigrationoption for use in tools that are migrating large data to PostHog
4.1.1 - 2024-08-20
- Local evaluation returns correct results on
undefined/nullvalues
4.1.0 - 2024-08-14
- chore: change host to new address.
- chore: bump axios to 1.7.4 (fixes CVE-2024-39338)
4.0.1 - 2024-04-25
- Prevent double JSON parsing of feature flag payloads, which would convert the payload [1] into 1.
4.0.0 - 2024-03-18
Added
- Adds a
disabledoption and the ability to change it later viaposthog.disabled = true. Useful for disabling PostHog tracking for example in a testing environment without having complex conditional checking - Adds a new
featureFlagsRequestTimeoutMstimeout parameter for feature flags which defaults to 3 seconds, updated from the default 10s for all other API calls. shutdowntakes ashutdownTimeoutMsparam with a default of 30000 (30s). This is the time to wait for flushing events before shutting down the client. If the timeout is reached, the client will be shut down regardless of pending events.- Flushes will now try to flush up to
maxBatchSize(default 100) in one go - Queued events are limited up to
maxQueueSize(default 1000) and the oldest events are dropped when the limit is reached - Sets
User-Agentheaders with SDK name and version for RN
Removed
flushAsyncandshutdownAsyncare removed withflushandshutdownnow being the async methods.
Changed
flushandshutdownnow being async methods.
Fixed
- Fixed an issue where
shutdownwould potentially exit early if a flush was already in progress - Fixes some typos in types
4.0.0-beta.3 - 2024-03-13
- Sets
User-Agentheaders with SDK name and version for RN
4.0.0-beta.2 - 2024-03-12
flushAsyncandshutdownAsyncare removed withflushandshutdownnow being the async methods.- Fixed an issue where
shutdownwould potentially exit early if a flush was already in progress - Flushes will now try to flush up to
maxBatchSize(default 100) in one go
4.0.0-beta.1 - 2024-03-04
- Adds a
disabledoption and the ability to change it later viaposthog.disabled = true. Useful for disabling PostHog tracking for example in a testing environment without having complex conditional checking - Fixes some typos in types
shutdownandshutdownAsynctakes ashutdownTimeoutMsparam with a default of 30000 (30s). This is the time to wait for flushing events before shutting down the client. If the timeout is reached, the client will be shut down regardless of pending events.- Adds a new
featureFlagsRequestTimeoutMstimeout parameter for feature flags which defaults to 3 seconds, updated from the default 10s for all other API calls.
3.6.3 - 2024-02-15
- fix: using
captureMode=formwon't throw an error and retry unnecessarily
3.6.2 - 2024-02-06
- Swapped to
uuidv7for unique ID generation
3.6.1 - 2024-01-26
- Remove new relative date operators, combine into regular date operators
3.6.0 - 2024-01-18
- Adds support for overriding the event
uuid
3.5.0 - 2024-01-09
- When local evaluation is enabled, we automatically add flag information to all events sent to PostHog, whenever possible. This makes it easier to use these events in experiments.
- Fixes a bug where in some rare cases we may drop events when send_feature_flags is enabled on capture.
3.4.0 - 2024-01-09
- Numeric property handling for feature flags now does the expected: When passed in a number, we do a numeric comparison. When passed in a string, we do a string comparison. Previously, we always did a string comparison.
- Add support for relative date operators for local evaluation.
3.3.0 - 2024-01-02
- Adds PostHogSentryIntegration to allow automatic capturing of exceptions reported via the @sentry/node package
3.2.1 - 2023-12-15
- Fixes issue where a background refresh of feature flags could throw an unhandled error. It now emits to be detected by
.on('error', ...)
3.2.0 - 2023-12-05
- Fixes issues with Axios imports for non-node environments like Cloudflare workers
- Uses the globally defined
fetchif available, otherwise imports and uses axios as a polyfill
3.1.3 - 2023-10-27
- Updates axios dependency
3.1.2 - 2023-08-17
- Returns the current flag property with $feature_flag_called events, to make it easier to use in experiments
3.1.1 - 2023-04-26
- Replace crypto library with pure-js rusha library which makes posthog-node work with Cloudflare Workers in Next.js edge runtime.
3.1.0 - 2023-04-19
- Some small fixes to incorrect types
- Fixed fetch compatibility by aligning error handling
- Added two errors: PostHogFetchHttpError (non-2xx status) and PostHogFetchNetworkError (fetch network error)
- Added .on('error', (err) => void)
- shutdownAsync now ignores fetch errors. They should be handled with .on('error', ...) from now on.
3.0.0 - 2023-04-14
Breaking change:
All events by default now send the $geoip_disable property to disable geoip lookup in app. This is because usually we don't
want to update person properties to take the server's location.
The same now happens for feature flag requests, where we discard the IP address of the server for matching on geoip properties like city, country, continent.
To restore previous behaviour, you can set the default to False like so:
1const posthog = new PostHog(PH_API_KEY, {
2 host: PH_HOST,
3 disableGeoip: false,
4});
2.6.0 - 2023-03-14
- Add support for all cohorts local evaluation in feature flags.
2.5.4 - 2023-02-27
- Fix error log for local evaluation of feature flags (InconclusiveMatchError(s)) to only show during debug mode.
2.5.3 - 2023-02-21
- Allow passing in a distinctId to
groupIdentify(). - Fix a bug with active feature flags on capture events, where non-active flags would be added to the list as well.
2.5.2 - 2023-02-17
- Fix issue where properties passed to
.identifywere not set correctly
2.5.1 - 2023-02-16
- Make sure shutdown waits for pending promises to resolve. Fixes a problem with using PostHog Node in serverless environments.
2.5.0 - 2023-02-15
- Removes shared client from
posthog-node, getting rid of some race condition bugs when capturing events. - Sets minimum version of node.js to 15
2.4.0 - 2023-02-02
- Adds support for overriding timestamp of capture events
2.3.0 - 2023-1-26
- uses v3 decide endpoint
- JSON payloads will be returned with feature flags
- Feature flags will gracefully fail and optimistically save evaluated flags if server is down
2.2.3 - 2022-12-01
- Fix issues with timeouts for local evaluation requests
2.2.2 - 2022-11-28
- Fix issues with timeout
2.2.1 - 2022-11-24
- Add standard 10 second timeout
2.2.0 - 2022-11-18
- Add support for variant overrides for feature flag local evaluation.
- Add support for date operators in feature flag local evaluation.
2.1.0 - 2022-09-08
- Swaps
unidiciforaxiosin order to support older versions of Node - The
fetchimplementation can be overridden as an option for those who wish to use an alternative implementation - Fixes the minimum Node version to >=14.17.0
2.0.2 - 2022-08-23
- Removes references to
cli.js - Removes default
PostHogGlobalexport, and unifies import signature fortypescript,commonjsandesmbuilds.
2.0.1 - 2022-08-15
Breaking changes:
- Feature flag defaults are no more. When we fail to compute any flag, we return
undefined. All computed flags return eithertrue,falseorString. - Minimum PostHog version requirement is 1.38
- Default polling interval for feature flags is now set at 30 seconds. If you don't want local evaluation, don't set a personal API key in the library.
- The
callbackparameter passed as an optional last argument to most of the methods is no longer supported - The CLI is no longer supported
What's new:
- You can now evaluate feature flags locally (i.e. without sending a request to your PostHog servers) by setting a personal API key, and passing in groups and person properties to
isFeatureEnabledandgetFeatureFlagcalls. - Introduces a
getAllFlagsmethod that returns all feature flags. This is useful for when you want to seed your frontend with some initial flags, given a user ID.