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
- PostHog/posthog-js appears actively maintained, with multiple
posthog-jsand related packageupdatesas recently as today (2026-07-30) and within the past day. - The apparent update cadence is frequent (at least several commits or version bumps over 1-2 days), and the latest
updatesinclude both feature additions and targeted patches rather than a long quiet period.
AI summary generated
Recent updates
@posthog/ai@8.6.4
Version 8.6.4 improves AI provider instrumentation by capturing provider error status codes into $ai_http_status, and by preserving provider SDK promise helpers while instrumenting OpenAI, Anthropic, and Azure OpenAI requests. The diff also introduces shared promise-wrapping utilities and expands provider client option typing to accept the full SDK client options.
Features@posthog/mcp@0.10.6
Release 0.10.6 is a patch that, according to the release notes, improves MCP tool handling when tool names collide, and restores $mcp_tool_call analytics for certain low-level MCP servers. The provided code diff, however, contains substantial changes in AI provider promise instrumentation and Conversations error handling/logging that are not mentioned in the release notes.
posthog-js@1.410.7
This patch changes how PostHog-JS classifies and reports “handled transport failures” across multiple product surfaces. It stops these expected failures from being promoted to error logs, while keeping the original error severity for real HTTP errors and unexpected failures.
@posthog/ai@8.6.3
Release @posthog/ai@8.6.3 improves how the SDK monitors streaming AI responses, aiming to preserve cancellation and backpressure while duplicating the stream. It also hardens telemetry capture so failures in capturing analytics should not interfere with the provider response lifecycle. The diff, however, includes additional MCP-side changes (logger isolation and reserved argument ownership logic) that are not mentioned in the release notes.
@posthog/mcp@0.10.5
Release @posthog/mcp@0.10.5 is described as a patch that isolates logger configuration per instrumented MCP server. The code changes show this is implemented by switching from a shared/global logger setup to per-instrument logger creation and propagation through instrumentation and event capture.
posthog-node@5.47.8
posthog-node@5.47.8 updates how local feature flag polling is scheduled, triggering polls after each request settles. It also bumps the dependency @posthog/core to 1.46.6, which may include related fixes or behavior updates.
@posthog/mcp@0.10.4
Version 0.10.4 changes MCP analytics instrumentation to preserve tool-owned reserved analytics arguments, so user-provided `context` and `conversation_id` do not get consumed as SDK metadata. The code introduces schema-derived “analytics parameter ownership” and uses it to strip SDK-owned reserved arguments across event capture, low-level server tracing, and strict schema validation.
@posthog/ai@8.6.2
Release @posthog/ai@8.6.2 ships telemetry-focused fixes around OpenAI Agents span capture, LangChain metadata handling, JSON-safe serialization, and Vercel AI streaming error/cancellation handling. It also includes dependency hygiene changes related to OpenTelemetry and OpenAI Agents resolution. Release notes do not mention several behavioral changes that appear in the wider diff, including conversations and exception autocapture error-handling logic.
Features@posthog/core@1.46.6
Version 1.46.6 adds safer handling for telemetry values by using a shared JSON-safe value converter. This prevents failures when telemetry contains circular references or otherwise unknown/unserializable values.
posthog-js@1.410.6
posthog-js@1.410.6 changes the Lazy SessionRecording behavior for session-replay in idle/background tabs. If a session is created due to an external rotation while the tab remains non-interacted (idle state), the recorder holds the snapshot buffer and avoids shipping a billable recording until the first user interaction, with event triggers also releasing the hold.
posthog-js@1.410.5
posthog-js@1.410.5 includes a fix to keep selector-widget surveys from being torn down while they are open, even if their trigger element is removed from the DOM. It also addresses a related listener leak so old trigger elements do not keep dispatching the show-widget event after the selector target changes. In the same release diff, the @posthog/ai package changes LangChain callback handling to treat LangGraph control-flow exceptions differently.
posthog-js@1.410.4
posthog-js@1.410.4 updates exception autocapture to preserve error information (message, source location, and existing stack) when browser error handlers do not receive a same-realm Error object. It also bumps @posthog/core to 1.46.5, which includes related changes to how error-like inputs are coerced into exception payloads.
posthog-js@1.410.3
posthog-js@1.410.3 documents a browser-only fix for the Conversations widget, ensuring bullet and numbered list markers remain visible when the host page applies aggressive CSS resets. The code diff also includes a posthog-node change to how stack trace source context is read and cached, which is not mentioned in the release notes.
posthog-node@5.47.7
posthog-node@5.47.7 is a patch release that, per the release notes, bounds stack source context reads and skips non-regular or oversized files when augmenting stack frames. However, the actual diff includes several additional behavioral changes in the browser SDK (Conversations send error handling) and in the snippet loader (preventing duplicate/replacing initialized instances), none of which are described in the posthog-node release notes.
Featuresposthog-js@1.410.2
posthog-js@1.410.2 is a patch release focused on Conversations widget reliability during message sends, and on improving snippet-loader behavior to avoid duplicate initialization side effects. The documented changes mainly reduce noisy error tracking for transient send failures and prevent replays from duplicate snippet execution.
posthog-react-native@4.61.4
This release primarily updates shutdown and flush timeout handling to ensure successful shutdown paths do not leave pending timers running. The code also introduces a shared `raceWithTimeout` helper used across logs, core shutdown, metrics flush, and the React Native shutdown drain. Additionally, the monorepo diff includes type and session recording sampling changes that are not described in the provided posthog-react-native release notes.
posthog-node@5.47.6
posthog-node@5.47.6 is a patch release focused on preventing leftover timers after successful shutdown, especially in code paths that race a flush/shutdown against a deadline. The documented change is implemented by introducing a shared timeout-racing helper and wiring it into multiple shutdown and flush flows, plus bumping @posthog/core to 1.46.4.
posthog-node@5.47.5
posthog-node@5.47.5 is primarily a TypeScript typing fix for feature flag evaluation options, changing `personProperties` and `groupProperties` to use the shared `Properties` types instead of string-only records. The release notes also indicate the only dependency change is `@posthog/core@1.46.3`.
posthog-js@1.410.1
posthog-js@1.410.1 is a patch release focused on fixing source map handling for the inline canvas recording (rrweb) worker when it runs from blob URLs. It also bumps @posthog/core to 1.46.3.
posthog-js@1.410.0
posthog-js 1.410.0 adds a new session recording sampling option (`session_recording.sampling`) to control rrweb mousemove capture and optionally mouse interaction, and updates canvas sampling handling to merge with user sampling. It also changes how TypeScript declaration files are shared between the slim and slim no-external entrypoints.
Features