PostHog JS is a set of JavaScript and TypeScript packages for integrating PostHog into web and other applications. It is useful for sending usage data from your web app or site to PostHog, including autocapture, with supporting packages for frameworks like React and Next.js.
Project status
- Actively maintained: PostHog/posthog-js shows very recent upstream activity (last push on 2026-07-23) plus multiple SDK package updates across posthog-js, @posthog/core, @posthog/types, posthog-js-lite, and posthog-react-native within the last day.
- Update cadence: Based on the latest history, updates are arriving on a daily, sometimes same-day cadence (for example, 2026-07-21 to 2026-07-22, and a new upstream push on 2026-07-23).
AI summary generated
Recent updates
@posthog/nuxt@1.7.81
Version 1.7.81 updates the Nuxt module logic for uploading and deleting PostHog sourcemaps so Nitro asset manifest generation will not reference sourcemaps that were removed too late. The release notes only describe the main fix, but the code also adds fallback behavior when the early public sourcemaps upload fails.
posthog-react-native@4.61.0
This release adds a new configuration prop to control when popover surveys are automatically presented in React Native. By setting the new prop to false, you can defer automatic presentation during times like when a native stack formSheet or modal is on top.
Features@posthog/convex@2.0.33
This patch release updates feature flag event handling to ensure feature flag access events are flushed before remote evaluation actions complete. The goal is to improve the reliability of event delivery when remote evaluation returns.
@posthog/mcp@0.10.1
This patch updates the MCP client to read client name, client version, and protocol version from each incoming request's `_meta` fields. This ensures `$mcp_client_name`, `$mcp_client_version`, and `$mcp_protocol_version` continue to populate under the MCP 2026-07-28 stateless revision where the `initialize` handshake is removed. Existing clients are unaffected, since the code falls back to the previous `session token` and `initialize`-provided values when `_meta` is absent.
@posthog/browser-common@0.2.2
Release @posthog/browser-common@0.2.2 introduces a shared ExtensionRuntime and a new CoreExtension capability contract. It also tightens type surfaces by adding DeepReadonly views for core observers and remote config payloads, and updates key-value store behavior to allow synchronous or asynchronous persistence results.
BreakingFeaturesposthog-js@1.407.3
posthog-js@1.407.3 is a patch release focused on correcting survey renderability eligibility timing, improving replay capture stability, and adjusting how identity and analytics timestamps are sent. It also updates a dependency (@posthog/browser-common to 0.2.2).
@posthog/browser-common@0.2.1
Release @posthog/browser-common@0.2.1 documents a change to represent extension capability tokens as branded runtime strings so independently compiled bundles resolve the same providers. The actual diff includes broader SDK behavior changes (request timestamp parameterization, and session replay recorder restart/flush logic) that are not mentioned anywhere in the @posthog/browser-common release notes.
BreakingFeaturesposthog-js@1.407.2
posthog-js@1.407.2 includes a patch for session replay where lazy recording could become unplayable after a session rotation in a tab with no user interaction. The actual code changes implement a restart and session-id resynchronization on rotation, plus ensure buffered snapshots are flushed on the normal cadence even when the recorder never leaves the 'unknown' idle state.
posthog-react-native@4.60.0
This release adds an Expo config plugin option to point PostHog uploads at a dotenv file containing POSTHOG_CLI_* credentials, and wires that value into native upload hooks. It also fixes an Android Gradle plugin injection ordering issue that previously prevented native symbol (mapping) uploads from running.
BreakingFeaturesposthog-node@5.46.1
posthog-node 5.46.1 is a patch release focused on developer experience during debugging. It normalizes V8 Promise combinator stack frames so stack traces do not incorrectly treat input indexes as source filenames, and it updates the underlying @posthog/core dependency to 1.45.1.
@posthog/core@1.45.1
Release @posthog/core@1.45.1 is a patch release. Documented change: it normalizes V8 Promise combinator stack frames so that input indexes are not misinterpreted as source filenames in Node stack traces.
posthog-js@1.407.1
posthog-js 1.407.1 makes small but developer-relevant fixes to how the SDK formats timestamps in its outbound tracking requests. It updates feature flag timestamp formatting to use ISO strings in request bodies, adjusts capture POST timing to use numeric sent_at query timestamps, and preserves cache-busting for dynamic GET requests.
posthog-react-native@4.59.0
posthog-react-native 4.59.0 adds a default-value option to `isFeatureEnabled`, letting you get a deterministic boolean when a flag is missing or not yet loaded. It also updates `@posthog/core` and `@posthog/types` to newer versions.
Features@posthog/core@1.45.0
The release notes for @posthog/core@1.45.0 document a new `defaultValue` option for `isFeatureEnabled`, allowing callers to receive a boolean default instead of `undefined` when a flag has no value (for example, flags not loaded yet). The code diff, however, includes several other behavior changes across the browser SDK (conversations, surveys/product tours persistence, exception autocapture hardening, session replay masking warnings) plus MCP analytics changes that are not mentioned in the release notes.
Features@posthog/types@1.398.0
This release documents a new `defaultValue` option for `isFeatureEnabled`, so callers can get a deterministic boolean when a flag has no value (for example, before flags load). In the code diff, however, there are also several other user-visible behavior changes and robustness updates that are not mentioned in the release notes.
Featuresposthog-js@1.407.0
This release adds a new `defaultValue` option to `isFeatureEnabled` that lets developers control what value is returned when a feature flag is missing or not yet loaded, including TypeScript narrowing to `boolean`. It also ships several reliability fixes around the PostHog support widget, exception autocapture safety, session recording edge cases, and event-triggered survey re-display behavior, plus a console warning for masking option precedence.
Featuresposthog-js-lite@4.10.0
posthog-js-lite@4.10.0 primarily documents a new `defaultValue` option for `isFeatureEnabled`, so missing or not-yet-loaded flags can return a caller-provided boolean. Beyond that, the code diff includes several user-visible behavior changes and new persistence semantics around surveys/product tours and conversations that are not mentioned in the release notes.
Features@posthog/mcp@0.10.0
Release @posthog/mcp@0.10.0 adds MCP protocol version tracking by emitting a new analytics property, $mcp_protocol_version, for the negotiated MCP spec revision. The value is attached to $mcp_initialize and subsequent session events, including tool calls, listings, and the $exception sibling, and is carried across pods using the session token. The release notes also mention new optional protocolVersion fields on SessionTokenPayload and PostHogMCP.captureInitialize.
Featuresposthog-js@1.406.2
posthog-js@1.406.2 is a patch release focused on survey eligibility and internal targeting behavior. It prevents surveys from reappearing due to a stale cached internal targeting flag by coordinating eligibility checks with feature flag loading and reloading flags after survey completion.
posthog-js@1.406.1
posthog-js@1.406.1 is a patch release that adjusts how $referrer and $referring_domain are persisted across captures in SPA and iframe contexts when values are set via posthog.register(). The change ensures explicitly registered attribution values are not overwritten by referrer values saved from document.referrer in session persistence.