posthog-node breaking changes
Updated December 4, 2026
On this page
Latest version 6.6.0, released December 4, 2026. Source repository
Packages on npm run on Node.js. Node.js end of life dates.
- From 5.74.0 to 6.0.4: 46 breaking changes in 4 versions.
- From 5.0.0 to 6.0.4: 157 breaking changes in 52 versions.
posthog-node 6.0.4 breaking changes
- Behavior changed
Transactional email calls are sent to a new endpoint, and PostHog is removing the old /api/projects/@current/ alias. Older self-hosted PostHog versions answer these calls with a 404, so self-hosted users need PostHog from 2026-11-18 or... github.com
posthog-node 6.0.3 breaking changes
- Behavior changed
Custom exception properties with null values are removed after beforeSend runs. Code that reads those null properties from exception payloads may now find them missing. github.com
posthog-node 6.0.2 breaking changes
- Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'disable_capture_url_hashes' | 'disableGeoip' | 'flushInterval' | 'maxQueueSize' | 'fetchRetryCount' | 'fetchRetryDelay' | 'disableCompression' | 'requestTimeout'> &... npmjs.com
posthog-node 6.0.0 breaking changes
- Removed
IPostHog.enterContext
Replace enterContext() with withContext() to scope async context to a callback. npmjs.com - Renamed
Configuration option names are now camelCase; update existing configuration keys to the new names. github.com - Renamed
CaptureV1Error
Code that catches CaptureV1Error must catch CaptureError instead. github.com - Behavior changed
A personal API key passed as the project API key now disables the client, like a missing key. github.com - Behavior changed
A $lib set on the event, in context or with register() now wins over the SDK's own value. github.com - Behavior changed
A non-string $session_id or $window_id is dropped with a warning, and events with unreadable option values are dropped and reported through error. github.com - Behavior changed
Values set on the event, in context or with register() now win over SDK-added values, and some identify events no longer set process_person_profile by default. github.com - Behavior changed
Capture no longer follows cross-origin redirects or redirects other than 307 and 308. github.com - Behavior changed
Capture retries only 404, 408, 429, 500, 502, 503, 504 and network errors, with new backoff timing. github.com - Behavior changed
A 2xx capture response without a results field now fails the whole batch and is reported through error; the batch is not resent. github.com
And 33 more in this version. Sign up to see every change
posthog-node 5.74.0 breaking changes
- Behavior changed
getAllFlags
getAllFlags() now omits keys whose flag evaluation failed, and no failed values or payloads are exposed. Code that expects every flag key to be present must handle missing keys. github.com - Behavior changed
getFeatureFlag
Node getFeatureFlag() now returns undefined when a flag evaluation fails, and no failed values or payloads are exposed. Code that relied on a failed evaluation's value must handle undefined. github.com - Behavior changed
isFeatureEnabled
Node isFeatureEnabled() now returns undefined when a flag evaluation fails, and no failed values or payloads are exposed. Code that checks its result must handle undefined. github.com
posthog-node 5.73.0 breaking changes
- Behavior changed
The client now requests /flags/?v=4 and reads typed flag records. Well-formed responses give the same flag values as before. Tests that mock the /flags endpoint must match the new URL and send correctly typed fields. github.com - Behavior changed
A flag record with a field of the wrong JSON type, such as a string metadata.version, now reads as disabled. Flag getters return false and it has no payload. Other flags in the same response are not affected. github.com - Behavior changed
$feature_flag_reason
For config version 2 flags, $feature_flag_called now sends the reason code and rule attribution in place of $feature_flag_reason. Code that reads $feature_flag_reason from these events must read the new fields instead. Config version 2... github.com
Older versions
47 older versions, each with its first changes. Sign up to see every change
Show 47 older versions
posthog-node 5.69.0 breaking changes
- Signature changed
CodeEmailForm
Was type CodeEmailForm = CodeEmailFields & ({html: string; text?: string;} | {html?: string; text: string;}); now type CodeEmailForm = CodeEmailFields & ({html: string; text?: string; react?: never;} | {html?: string; text: string; react?... npmjs.com - Signature changed
SendTemplateEmailOptions
Was type SendTemplateEmailOptions = SendEmailBase & TemplateEmailForm & Without<CodeEmailFields & {html: string; text: string;}>; now type SendTemplateEmailOptions = SendEmailBase & TemplateEmailForm & Without<CodeEmailFields & {html... npmjs.com
posthog-node 5.68.2 breaking changes
- Behavior changed
With POSTHOG_CAPTURE_MODE=v1, capture now retries 404 and 429 responses like 408 and 5xx instead of failing the batch immediately. Code that relied on those responses failing at once may see retries and longer waits. github.com
posthog-node 5.65.0 breaking changes
- Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInterval' | 'maxQueueSize'> & {persistence?: 'memory'; flushInterval?: number; maxQueueSize?: number; readPostHogCookie?: boolean | {sessionIdleTimeoutSeconds?... npmjs.com
posthog-node 5.63.0 breaking changes
- Behavior changed
posthog.flags.request.duration
The experimental posthog.flags.request.duration histogram now uses fixed bucket bounds from 50ms to 10000ms, so its bucket data changes. Update any dashboards or alerts that depend on the old buckets. github.com
posthog-node 5.62.0 breaking changes
- Removed
SendEmailOptions.distinctId
SendEmailOptions.distinctId was removed in posthog-node 5.62.0 npmjs.com - Removed
SendEmailOptions.idempotencyKey
SendEmailOptions.idempotencyKey was removed in posthog-node 5.62.0 npmjs.com
And 6 more in this version.
posthog-node 5.61.2 breaking changes
- Behavior changed
posthog.emails.send
The request body for posthog.emails.send() is now flat, with template_id and distinct_id at the top level. Code that depends on the previous request body shape may need to be updated. github.com
posthog-node 5.61.1 breaking changes
- Behavior changed
captureException
Autocapture now captures unhandled promise rejections even when a framework has its own listener, and each error is captured once per turn of the event loop. A captureException call for an error that autocapture already captured in the... github.com
posthog-node 5.61.0 breaking changes
- Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInterval' | 'maxQueueSize'> & {persistence?: 'memory'; flushInterval?: number; maxQueueSize?: number; readPostHogCookie?: boolean | {sessionIdleTimeoutSeconds?... npmjs.com
posthog-node 5.60.0 breaking changes
- Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInterval' | 'maxQueueSize'> & {persistence?: 'memory'; flushInterval?: number; maxQueueSize?: number; metrics?: MetricsConfig; traces?: TracesConfig; secretKey?... npmjs.com
posthog-node 5.59.0 breaking changes
- Behavior changed
evaluateFlags
Reads from an evaluateFlags() snapshot no longer send exposure events when sendFeatureFlagEvent is false. If you rely on snapshot reads for experiment exposures, pass sendFeatureFlagEvents: true on those reads. github.com - Signature changed
FeatureFlagEvaluations.getFlag
Was getFlag(key: string): FeatureFlagValue | undefined; now getFlag(key: string, options?: {sendFeatureFlagEvents?: boolean;}): FeatureFlagValue | undefined. npmjs.com
And 1 more in this version.
posthog-node 5.57.1 breaking changes
- Behavior changed
privacyMode
The client privacyMode option now also covers AI integrations, keeping prompts out of errors, provider metadata and OTel spans, and redacting MCP tool credentials. Code that relies on prompts or these fields being present while privacyMode... github.com
posthog-node 5.57.0 breaking changes
- Behavior changed
$feature_flag_called events from snapshot reads now report local_evaluation_inconclusive instead of flag_missing for these flags. Update any analytics that filter on flag_missing. github.com - Behavior changed
evaluateFlags
A condition with a filter local evaluation cannot check, and a filter that does not match, now resolve locally as no match instead of falling back to a server request or staying unresolved. Check code that relied on the server fallback. github.com
And 2 more in this version.
posthog-node 5.56.3 breaking changes
- Behavior changed
Negated string operators such as not_icontains now match when a property is null instead of failing, so flags that relied on the old non-match may evaluate differently. github.com
posthog-node 5.55.3 breaking changes
- Signature changed
BeforeSendFn
Was type BeforeSendFn = (event: EventMessage | null) => EventMessage | null; now type BeforeSendFn = (event: EventMessage) => EventMessage | null. npmjs.com
posthog-node 5.55.1 breaking changes
- Behavior changed
distinctIdHasSentFlagCalls
distinctIdHasSentFlagCalls now returns a snapshot, so writing or deleting individual keys on it no longer changes $feature_flag_called deduplication. Code that relied on editing that object to alter deduplication must change. github.com
posthog-node 5.55.0 breaking changes
- Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInterval' | 'maxQueueSize'> & {persistence?: 'memory'; flushInterval?: number; maxQueueSize?: number; metrics?: MetricsConfig; traces?: TracesConfig; secretKey?... npmjs.com
posthog-node 5.54.1 breaking changes
- Signature changed
FlagDefinitionCacheProvider
Was interface FlagDefinitionCacheProvider; now interface FlagDefinitionCacheProvider<CacheData extends FlagDefinitionCacheInput = FlagDefinitionCacheData>. npmjs.com - Signature changed
FlagDefinitionCacheProvider.getFlagDefinitions
Was getFlagDefinitions(): Promise<FlagDefinitionCacheData | undefined> | FlagDefinitionCacheData | undefined; now getFlagDefinitions(): Promise<CacheData | undefined> | CacheData | undefined. npmjs.com
And 1 more in this version.
posthog-node 5.54.0 breaking changes
- Signature changed
FeatureFlagResult
Was type FeatureFlagResult = {key: string; enabled: boolean; variant: string | undefined; payload: JsonType | undefined;}; now type FeatureFlagResult = {key: string; enabled: boolean; variant: string | undefined; payload: JsonType |... npmjs.com
posthog-node 5.53.0 breaking changes
- Signature changed
PostHogFeatureFlag
Was type PostHogFeatureFlag = {id: number; name: string; key: string; bucketing_identifier?: FeatureFlagBucketingIdentifier; filters?: {aggregation_group_type_index?: number; groups?: FeatureFlagCondition[]; multivariate?: {variants: {key... npmjs.com
posthog-node 5.52.6 breaking changes
- Behavior changed
isFeatureEnabled
Users in an experiment holdout now receive the holdout variant instead of a regular variant, and isFeatureEnabled can return true where it previously returned false. Experiments with an active holdout will see assignments change for the... github.com - Signature changed
PostHogFeatureFlag
Was type PostHogFeatureFlag = {id: number; name: string; key: string; bucketing_identifier?: FeatureFlagBucketingIdentifier; filters?: {aggregation_group_type_index?: number; groups?: FeatureFlagCondition[]; multivariate?: {variants: {key... npmjs.com
And 1 more in this version.
posthog-node 5.52.5 breaking changes
- Behavior changed
When the definitions response sets property_matching_version to 2, local feature flag evaluation uses explicit boolean and string equality and per-member array matching. Missing or other versions keep the legacy matching, including... github.com - Behavior changed
maxSpanAgeMs
maxSpanAgeMs now evicts spans only once maxLiveSpans is reached. Spans that run past the age limit and then end are exported, and their children are no longer orphaned. Code that relied on those spans being dropped will now see them... github.com
posthog-node 5.52.4 breaking changes
- Behavior changed
Server-side feature flags now resolve in posthog-node and posthog-edge even when a proxy rewrites the User-Agent. Flags restricted to the client runtime now resolve to undefined in these SDKs, so code relying on them being returned must... github.com
posthog-node 5.52.0 breaking changes
- Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInterval' | 'maxQueueSize'> & {persistence?: 'memory'; flushInterval?: number; maxQueueSize?: number; metrics?: MetricsConfig; secretKey?: string; personalApiKey?... npmjs.com
posthog-node 5.51.5 breaking changes
- Behavior changed
Local feature flag evaluation now matches the flags service for string operators, exact-value coercion and JSON stringification. Check flag rules that depend on the previous local results. github.com - Behavior changed
bigint attributes on logs, metrics and spans are now sent as an int64 instead of a string. Code or dashboards that expect the string form must be updated. github.com
posthog-node 5.51.4 breaking changes
- Behavior changed
Flags whose evaluation contexts don't overlap the configured list are no longer evaluated locally and now resolve to undefined. github.com - Behavior changed
The pinterest entry in the bot-detection blocklist now matches only pinterestbot, so real users on Pinterest's in-app browser are no longer classified as bots and excluded from analytics. github.com
And 1 more in this version.
posthog-node 5.51.3 breaking changes
- Behavior changed
Local evaluation treats omitted properties as inconclusive when checking the is_not_set operator, instead of matching as before. Check flags that use is_not_set if your code relies on the previous result. github.com
posthog-node 5.51.1 breaking changes
- Signature changed
PostHog.compressPayload
Was protected compressPayload(payload: string): Promise<Blob | null>; now protected compressPayload(payload: string): Promise<PostHogFetchBodyBytes | null>. npmjs.com
posthog-node 5.51.0 breaking changes
- Behavior changed
When a requested flag is missing from loaded local definitions, the SDK now makes a remote evaluation request instead of omitting the flag silently. Code that relied on no request being made for scoped calls may need to account for the... github.com
posthog-node 5.50.0 breaking changes
- Signature changed
FeatureFlagEvaluations.isEnabled
Was isEnabled(key: string): boolean; now isEnabled(key: string, options?: {defaultValue?: boolean;}): boolean. npmjs.com
posthog-node 5.49.4 breaking changes
- Behavior changed
getFeatureFlagResult
When a flag is remotely evaluated, getFeatureFlagResult now returns undefined for the variant where it previously returned null. Code that checks for null on the variant should check for undefined. github.com
posthog-node 5.49.3 breaking changes
- Behavior changed
Log and metric attributes are now capped at 20 levels of nesting, 1,000 entries per object and 10,000 values in total. Anything beyond these limits is marked as [Truncated], so code that relies on the full attribute contents must account... github.com - Signature changed
OtlpAnyValue.intValue
The intValue field is now typed as string | number instead of a single type. Code reading this field must handle both possible types. github.com
posthog-node 5.49.2 breaking changes
- Behavior changed
If a before-send hook throws, the event is now dropped instead of being sent unmodified. Make sure hooks handle errors if you still need those events. github.com
posthog-node 5.49.1 breaking changes
- Behavior changed
Timestamp overrides passed to capture are sent as equivalent UTC ISO strings instead of their original form. Code that depends on the exact timestamp string sent should be checked. github.com
posthog-node 5.49.0 breaking changes
- Signature changed
PostHog.enqueue
Was protected enqueue(type: string, message: any, options?: PostHogCaptureOptions): void; now protected enqueue(type: string, message: any, options?: PostHogCaptureOptions, explicitRoute?: string): void. npmjs.com - Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInterval' | 'maxQueueSize'> & {persistence?: 'memory'; flushInterval?: number; maxQueueSize?: number; metrics?: MetricsConfig; secretKey?: string; personalApiKey?... npmjs.com
posthog-node 5.48.2 breaking changes
- Signature changed
IPostHog.shutdown
The Node.js shutdown() return type is now Promise<void>. Typed code that relied on the previous return type may need to be updated. npmjs.com
posthog-node 5.48.1 breaking changes
- Behavior changed
Requests that run past the configured timeout while the Capture V1 response body is read will now fail instead of waiting indefinitely. Check that your timeout settings allow for slow responses. github.com
posthog-node 5.47.11 breaking changes
- Behavior changed
Request timeouts now remain active while the response body is read, and event UUID deduplication semantics were clarified. Code relying on the previous timing may see requests time out differently. github.com
posthog-node 5.47.9 breaking changes
- Behavior changed
enableExceptionAutocapture
Fatal unhandled promise rejections in strict or warn-with-error-code mode, and rejections handled by another unhandledRejection listener, are no longer captured. Node's default crash behavior now applies to them, so code relying on the SDK... github.com
posthog-node 5.47.5 breaking changes
- Signature changed
AllFlagsOptions.groupProperties
Was groupProperties?: Record<string, Record<string, string>>; now groupProperties?: Record<string, Properties>. npmjs.com - Signature changed
AllFlagsOptions.personProperties
Was personProperties?: Record<string, string>; now personProperties?: Properties. npmjs.com
And 13 more in this version.
posthog-node 5.46.0 breaking changes
- Behavior changed
When the server sets the minimal flag-called gate and the flag is not linked to an experiment, $feature_flag_called events carry only a strict allowlist of properties. Code that reads super properties, $set data, or active flags from those... github.com
posthog-node 5.45.1 breaking changes
- Default changed
The default Node.js event flush interval is now 5 seconds. Code that relies on the previous default timing should set the interval explicitly. github.com - Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'maxQueueSize'> & {persistence?: 'memory'; maxQueueSize?: number; metrics?: MetricsConfig; secretKey?: string; personalApiKey?: string; privacyMode?: boolean... npmjs.com
posthog-node 5.45.0 breaking changes
- Signature changed
PostHogFeatureFlag
Was type PostHogFeatureFlag = {id: number; name: string; key: string; bucketing_identifier?: FeatureFlagBucketingIdentifier; filters?: {aggregation_group_type_index?: number; groups?: FeatureFlagCondition[]; multivariate?: {variants: {key... npmjs.com
posthog-node 5.44.0 breaking changes
- Default changed
maxQueueSize
The default maxQueueSize increased from 1000 to 10000 so bursty backend workloads are less likely to drop events. Pass an explicit maxQueueSize to keep a specific limit. github.com - Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send'> & {persistence?: 'memory'; metrics?: MetricsConfig; secretKey?: string; personalApiKey?: string; privacyMode?: boolean; enableExceptionAutocapture?: boolean... npmjs.com
posthog-node 5.43.0 breaking changes
- Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send'> & {persistence?: 'memory'; secretKey?: string; personalApiKey?: string; privacyMode?: boolean; enableExceptionAutocapture?: boolean; featureFlagsPollingInterval?: number... npmjs.com
posthog-node 5.42.0 breaking changes
- Removed
PostHogOptions.before_send
PostHogOptions.before_send was removed in posthog-node 5.42.0 npmjs.com - Removed
PostHogOptions.custom_blocked_useragents
PostHogOptions.custom_blocked_useragents was removed in posthog-node 5.42.0 npmjs.com
And 19 more in this version.
posthog-node 5.40.0 breaking changes
- Signature changed
PostHogOptions
Was type PostHogOptions = Omit<PostHogCoreOptions, 'before_send'> & {persistence?: 'memory'; personalApiKey?: string; privacyMode?: boolean; enableExceptionAutocapture?: boolean; featureFlagsPollingInterval?: number; maxCacheSize?: number... npmjs.com
posthog-node 5.0.0 breaking changes
- Removed
PostHogFeatureFlag.is_simple_flag
PostHogFeatureFlag.is_simple_flag was removed in posthog-node 5.0.0 npmjs.com - Removed
PostHogOptions.captureMode
PostHogOptions.captureMode was removed in posthog-node 5.0.0 npmjs.com
And 1 more in this version.
Related packages
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.