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, with an upstream push and multiple updates on 2026-11-05.
- The apparent cadence is very high, with several updates in a single day.
AI summary generated
Recent updates
@posthog/mcp@1.0.0
@posthog/mcp 1.0.0 establishes a stability guarantee for the SDK API and its `$mcp_*` events: minor and patch releases will not remove or rename existing events or properties, change their types, or change which requests emit them. The diff contains documentation and package-version changes only, with no runtime code changes.
Features@posthog/mcp@0.26.0
Version 0.26.0 updates MCP analytics behavior: calls to tools the server does not recognize can emit a dedicated `$mcp_unknown_tool` event, `llm_model` becomes optional, virtual-tool annotations are revised, and missing session IDs are generated per capture. The supplied diff also changes Rollup chunk fingerprinting and browser replay types, plus several smaller behavior and API details that the release notes do not call out.
BreakingFeaturesposthog-js@1.447.3
posthog-js 1.447.3 preserves non-empty CDATA content in snapshots, applies text masking to it, and rebuilds it as text. The diff also includes a separate @posthog/rollup-plugin 1.6.3 change that stabilizes event-mode chunk IDs when unrelated lazy chunks are added.
Features@posthog/rollup-plugin@1.6.3
Version 1.6.3 changes event-mode chunk fingerprinting so unrelated lazy chunks do not alter existing chunk IDs in Rollup and Vite builds. The code diff also includes a separate session replay behavior change: hidden input values are now masked by default when `maskAllInputs` is enabled.
Featuresposthog-js@1.447.2
This patch improves session replay input masking for hidden fields. When `maskAllInputs` is enabled, hidden input values are now masked, and `hidden` is accepted in `maskInputOptions`.
Features@posthog/types@1.421.1
This patch improves session replay input masking to protect hidden input values. It also adds support for `hidden` in `maskInputOptions`.
Features@posthog/mcp@0.25.2
Version 0.25.2 fixes Node stack-frame parsing for functions named `async` when the filename has no leading parenthesis. It also updates `@posthog/core` and `posthog-node`.
@posthog/core@1.64.1
The @posthog/core 1.64.1 release fixes Node stack parsing for async frames where the function name is `async`. The supplied release notes describe that fix, but the wider code diff also includes changes to Genkit credential redaction, MCP and WebMCP tool descriptions, and browser compatibility tests.
Securityposthog-node@5.63.1
posthog-node 5.63.1 fixes parsing of certain Node.js stack frames. It also updates the @posthog/core dependency to 1.64.1.
@posthog/mcp@0.25.1
The @posthog/mcp 0.25.1 release rewords descriptions for injected arguments and virtual tools without changing their schemas or call behavior. The broader diff also includes credential redaction in Genkit telemetry and a WebMCP argument-description change, neither of which is covered by the supplied MCP release notes.
Securityposthog-js@1.447.1
The supplied release notes describe a wording-only change to the `llm_model` argument added by `capture_webmcp`, removing its reference to the model's system prompt. The code diff also contains Genkit credential redaction and multiple MCP tool-description changes; these are not in the supplied release notes, although separate AI and MCP changelog entries in the diff describe them.
Securityposthog-js@1.447.0
Version 1.447.0 adds configurable bucket boundaries to histogram metrics, including support for changing bounds in `beforeSend`. It also updates the experimental browser flags request duration histogram to use finer bounds and bumps the core and types packages.
Features@posthog/types@1.421.0
This release adds configurable bucket boundaries to `metrics.histogram()`, which `beforeSend` can inspect and modify. The experimental `posthog.flags.request.duration` histogram now uses updated millisecond buckets, improving percentile resolution from 50 ms to 5 seconds.
Features@posthog/core@1.64.0
The documented @posthog/core 1.64.0 change adds configurable histogram bucket boundaries, exposes them to beforeSend, and applies finer bounds to the experimental flags request duration metric. The diff also contains substantial changes in the Node email API, AI integrations, and rrweb that are not described in the supplied core release notes.
BreakingFeaturesposthog-node@5.63.0
PostHog Node 5.63.0 adds configurable histogram bucket boundaries through `metrics.histogram()` and updates the experimental flags request duration metric to use finer bounds. The release also updates `@posthog/core` to 1.64.0; no documented breaking changes are reported.
Featuresposthog-node@5.62.0
posthog-node 5.62.0 adds the ability to send transactional emails using HTML or text rendered by the application, alongside PostHog-managed templates. The repository diff also includes changes to other packages in the monorepo, including browser session-replay and tree-shaking fixes and AI usage/refusal capture updates; these are not covered by the supplied posthog-node release notes.
Featuresposthog-js@1.446.3
The 1.446.3 release notes describe an rrweb fix that uses native sibling accessors to preserve recorded insertion positions when DOM getters are patched. The diff also includes substantial Node email API changes for Node 5.62.0, which are not covered by the supplied posthog-js 1.446.3 release notes, though a separate Node changelog entry in the diff describes the main feature.
Features@posthog/ai@8.18.4
@posthog/ai 8.18.4 preserves refusal text from OpenAI Responses API outputs and counts Gemini Interactions tool-use tokens as input tokens. The supplied release notes describe only those AI-related fixes, while the diff also contains significant browser SDK and shared-package changes.
posthog-js@1.446.2
posthog-js 1.446.2 fixes duplicate same-origin iframe observers during session recording, particularly after full snapshots. The diff also contains separate @posthog/ai 8.18.4 behavior changes that are not mentioned in the supplied posthog-js release notes.
@posthog/core@1.63.2
This patch fixes tree shaking in the slim SDK. Unselected extensions and shared utilities can now be excluded from bundles as intended, reducing unnecessary bundled code.