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
- Active maintenance: Yes, the source shows ongoing work, with an upstream push dated 2026-09-17 and multiple posthog-js updates within the last 1-2 days, indicating active development rather than maintenance mode.
- Update cadence: The updates are frequent recently (at least daily in the
posthog-jsline, with coordinated dependency updates across the monorepo).
AI summary generated
Recent updates
@posthog/react@1.11.1
The @posthog/react 1.11.1 patch updates how the React Error Boundary constructs and labels component-stack errors to remain correct when a hostile page or extension makes Error.prototype.name non-writable. The main documented change is implemented via Object.defineProperty-style behavior. The diff also includes additional, related error-name hardening in browser-next and several build/tooling adjustments across the monorepo.
@posthog/core@1.54.5
The documented change in @posthog/core@1.54.5 is a robustness fix in survey and product tour property matching, where filter values are now coerced to strings before matching to prevent runtime errors for numeric values. The actual code diff for this release tag shows several additional cross-package behavioral changes (not mentioned in the provided release notes), including MCP default behavior changes and browser network metrics attribute renames to OTel conventions.
posthog-js@1.434.0
This release primarily documents a change to `metrics.network` default attribute names to match OpenTelemetry HTTP semantic conventions, and it bumps `@posthog/types` to 1.412.2. The code diff shows additional behavioral and API changes across MCP analytics, AI prompt fetching, and survey shuffling that are not covered by the release notes.
BreakingFeatures@posthog/types@1.412.2
This release updates the default attribute names emitted by the `metrics.network` network metrics instrumentation to match OpenTelemetry (OTel) HTTP semantic conventions. The change is documented as a rename from legacy keys (`method`, `host`, `path`, `status_class`) to new OTel keys (`http.request.method`, `server.address`, `url.template`, `http.response.status_code`, `error.type`).
Breaking@posthog/mcp@0.17.0
Release 0.17.0 for @posthog/mcp changes the default MCP analytics behavior to enable both model capture and conversation correlation. It advertises an additional llm_model argument in tool schemas, and it adds a conversation handle to eligible tool results, with the intent that passing captureModel: false and enableConversationId: false restores the prior shape.
BreakingFeaturesposthog-react-native@4.74.2
posthog-react-native@4.74.2 is a patch release focused on improving published JavaScript source maps so they correctly map back to the original TypeScript. The diff shows changes primarily in the build and packaging configuration for sourcemaps, plus added tooling to validate sourcemap correctness.
posthog-react-native@4.74.1
posthog-react-native@4.74.1 aligns React Native survey shuffling and choice display ordering with surveys core, using Fisher-Yates on the web side while preserving “Other” last and avoiding mutation of configured choices. It also bumps @posthog/core to 1.54.4 to share this logic across platforms.
@posthog/core@1.54.4
Release @posthog/core@1.54.4 updates survey shuffling so web and React Native share the same implementation in surveys core. The changes switch to a Fisher-Yates shuffle for choice ordering, preserve the “Other” (open choice) as the last item, and avoid mutating the configured choices.
posthog-js@1.433.10
posthog-js@1.433.10 is a patch release focused on session replay canvas capture diagnostics and aligning survey shuffling behavior across web and React Native via surveys core. It also bumps @posthog/core to 1.54.4, which contains the shared survey shuffling logic improvements.
@posthog/ai@8.13.0
This release (reported as @posthog/ai@8.13.0) updates the AI prompts API so `prompts.getAll()` can fetch unlabeled prompts in a single request, and it seeds the cache to make subsequent `prompts.get(name)` calls faster. The documented change focuses on lifting the previous requirement that a label be provided.
Features@posthog/mcp@0.16.4
This patch updates @posthog/mcp to support conversation IDs for the SDK-owned virtual tools `get_more_tools` and `send_feedback` even when the call is handled by a fresh server instance. The release notes describe the behavioral goal, and the code changes focus on how analytics parameter ownership (especially conversation_id) is computed for those virtual tools.
Breaking@posthog/core@1.54.3
Release notes for @posthog/core@1.54.3 only document a patch fix to DOMExceptionCoercer declaration source mappings. However, the accompanying code changes also include multiple significant posthog-js (browser) behavior changes related to request compression timing (via send_instantly) and additional replay stale configuration diagnostics.
Featuresposthog-js@1.433.9
posthog-js@1.433.9 is a patch release focused on adding a diagnostic signal when replay session recording fails to refresh stale remote configuration. The change is implemented as a new session tag, plus corresponding test coverage to verify it only triggers in the expected failure path.
posthog-js@1.433.8
posthog-js@1.433.8 is a patch release focused on how events marked with `send_instantly` are compressed before dispatch. The documented intent is to prefer synchronous compression (including the initial `$pageview`) to avoid delaying request dispatch when async compression would postpone sending.
posthog-js@1.433.7
posthog-js@1.433.7 includes a patch fix for surveys URL prefill when localStorage is unavailable, and updates @posthog/browser-common to 0.9.0. Despite the release notes being limited to that fix, the code diff shows a significant refactor of the browser analytics capture pipeline, including a change in the public capture method return type/semantics.
Features@posthog/browser-common@0.9.0
This release is primarily about changing the return semantics of event capture to be synchronous, so the return value no longer implies delivery completion. In the monorepo diff, the published browser-common client interface is updated accordingly, but the release notes only mention the browser extension behavior at a high level.
Breaking@posthog/react-native-plugin@2.9.4
Version 2.9.4 changes how consent and opt-out state is handled between the JavaScript client and the native SDKs. The native Android and iOS SDKs will no longer keep their own independent opt-out state, so the consent resolved by the JS client at setup is what the native SDKs use.
Breakingposthog-js@1.433.6
This patch fixes a recording issue where `<link rel=preload as=style>` resource hints were incorrectly treated as stylesheets. The recorder then matched the preload hint to the loaded stylesheet and inlined the entire CSS into every full snapshot twice, also causing a failed stylesheet deferral to be reported on each snapshot.
@posthog/nuxt@1.7.91
This patch release is documented as a TypeScript typing fix for a Nuxt runtime plugin, along with an update to the underlying posthog-js dependency. However, the actual diff for the repository includes additional Nuxt composable typing changes and multiple repository-wide CI and test-harness additions.
@posthog/mcp@0.16.3
This release changes how the MCP SDK injects the missing-capability virtual tool (get_more_tools) into paginated tools/list responses. The SDK now injects get_more_tools only on the first tools/list page so concatenated listings include it once, and it adjusts name-collision behavior with new warnings when a real tool exists on later pages.
Breaking