---
name: PostHog JS
slug: posthog-js
type: github
source_url: https://github.com/PostHog/posthog-js
changelog_url: https://github.com/PostHog/posthog-js/blob/HEAD/CHANGELOG.md
organization: PostHog
organization_slug: posthog
total_releases: 314
latest_version: @posthog/nuxt@1.6.16
latest_date: 2026-04-18
last_updated: 2026-04-19
tracking_since: 2026-02-25
canonical: https://releases.sh/posthog/posthog-js
organization_url: https://releases.sh/posthog
---

<Summary type="rolling" window-days="90" release-count="200">
PostHog JS continued optimizing for bundle size and tree-shaking while strengthening reliability across recording and error handling. The browser SDK shipped improvements to memory management in session replay, particularly fixing canvas recording leaks on Safari and updating rrweb dependencies. Core SDK work focused on feature flag caching, session recording sampling, and better error detection—including a new `rrweb_error` status when session recording initialization fails silently. On the backend, the team added NestJS integration with context propagation, introduced `feature_flag_cache_ttl_ms` to prevent stale flag values, and expanded feature flag evaluation with semver comparison operators. Tree-shaking support expanded across surveys, toolbar, exceptions, conversations, logs, and experiments, with new configuration options like `advanced_feature_flags_dedup_per_session` and serviceName for logs. Infrastructure work included fixes for sourcemap upload via stdin and better handling of OpenTelemetry exports that don't require optional dependencies to be installed.
</Summary>

<Summary type="monthly" period="February 2026" release-count="25">
February pushed recorder stability and feature flag control. The SDK waited for fresh config before recording starts and added a new recorder status for better visibility, while two new configuration options—`feature_flag_cache_ttl_ms` and `remote_config_refresh_interval_ms`—let developers prevent stale flag values in long-running sessions. Device detection improved to correctly identify Android tablets sending desktop user agents via Client Hints, product tours gained device-type targeting, and the Node SDK introduced context-sensitive flag methods that read `distinctId` from async context instead of requiring it as a parameter.
</Summary>

<Release version="@posthog/nuxt@1.6.16" date="April 18, 2026" published="2026-04-18T01:13:52.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/%40posthog/nuxt%401.6.16">
## 1.6.16

### Patch Changes

- Updated dependencies [[`ea08727`](https://github.com/PostHog/posthog-js/commit/ea087272bbe210e5610c9271aa1194776e927353), [`3d8b2e2`](https://github.com/PostHog/posthog-js/commit/3d8b2e282927d0c09670b3f112c7dc159cebf059)]:
  - posthog-js@1.369.3
</Release>

<Release version="posthog-js@1.369.3" date="April 18, 2026" published="2026-04-18T01:13:41.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-js%401.369.3">
## 1.369.3

### Patch Changes

- [#3419](https://github.com/PostHog/posthog-js/pull/3419) [`ea08727`](https://github.com/PostHog/posthog-js/commit/ea087272bbe210e5610c9271aa1194776e927353) Thanks [@haacked](https://github.com/haacked)! - Reinstate `$feature_flag_payloads` and `$surveys_activated` in captured event properties.
  (2026-04-18)

- [#3416](https://github.com/PostHog/posthog-js/pull/3416) [`3d8b2e2`](https://github.com/PostHog/posthog-js/commit/3d8b2e282927d0c09670b3f112c7dc159cebf059) Thanks [@feliperalmeida](https://github.com/feliperalmeida)! - Updated dependencies: - protobufjs@7.5.5
  (2026-04-18)
- Updated dependencies []:
    - @posthog/types@1.369.3
</Release>

<Release version="@posthog/types@1.369.3" date="April 18, 2026" published="2026-04-18T01:13:36.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/%40posthog/types%401.369.3">
## 1.369.3
</Release>

<Release version="posthog-react-native@4.42.1" date="April 17, 2026" published="2026-04-17T09:06:25.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-react-native%404.42.1">
## 4.42.1

### Patch Changes

- [#3402](https://github.com/PostHog/posthog-js/pull/3402) [`f2758ef`](https://github.com/PostHog/posthog-js/commit/f2758ef4dae345d131c25281a75c3da764c1a109) Thanks [@ioannisj](https://github.com/ioannisj)! - chore: bump plugin dependency to 1.5.4
  (2026-04-17)
</Release>

<Release version="@posthog/types@1.369.2" date="April 16, 2026" published="2026-04-16T22:45:52.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/%40posthog/types%401.369.2">
## 1.369.2

### Patch Changes

- [#3386](https://github.com/PostHog/posthog-js/pull/3386) [`4a65604`](https://github.com/PostHog/posthog-js/commit/4a65604775fe87c47e5fbdb5f03673f2481c26ea) Thanks [@dustinbyrne](https://github.com/dustinbyrne)! - Add a preview flag for versioned browser lazy bundle asset paths.
  (2026-04-16)
</Release>

<Release version="@posthog/nuxt@1.6.15" date="April 16, 2026" published="2026-04-16T22:45:49.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/%40posthog/nuxt%401.6.15">
## 1.6.15

### Patch Changes

- Updated dependencies [[`4a65604`](https://github.com/PostHog/posthog-js/commit/4a65604775fe87c47e5fbdb5f03673f2481c26ea)]:
  - posthog-js@1.369.2
</Release>

<Release version="posthog-js@1.369.2" date="April 16, 2026" published="2026-04-16T22:45:43.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-js%401.369.2">
## 1.369.2

### Patch Changes

- [#3386](https://github.com/PostHog/posthog-js/pull/3386) [`4a65604`](https://github.com/PostHog/posthog-js/commit/4a65604775fe87c47e5fbdb5f03673f2481c26ea) Thanks [@dustinbyrne](https://github.com/dustinbyrne)! - Add a preview flag for versioned browser lazy bundle asset paths.
  (2026-04-16)
- Updated dependencies [[`4a65604`](https://github.com/PostHog/posthog-js/commit/4a65604775fe87c47e5fbdb5f03673f2481c26ea)]:
    - @posthog/types@1.369.2
</Release>

<Release version="posthog-react-native@4.42.0" date="April 16, 2026" published="2026-04-16T14:56:33.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-react-native%404.42.0">
## 4.42.0

### Minor Changes

- [#3399](https://github.com/PostHog/posthog-js/pull/3399) [`1d7e298`](https://github.com/PostHog/posthog-js/commit/1d7e298648a6c47880e2130f6d68d755342cbdd1) Thanks [@turnipdabeets](https://github.com/turnipdabeets)! - Add version and project to expo react native symbols
  (2026-04-16)
</Release>

<Release version="posthog-js@1.369.1" date="April 16, 2026" published="2026-04-16T08:02:58.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-js%401.369.1">
## 1.369.1

### Patch Changes

- [#3393](https://github.com/PostHog/posthog-js/pull/3393) [`85ae4d9`](https://github.com/PostHog/posthog-js/commit/85ae4d9e2bb4e3f487c9b27fc581ed38c1a82c99) Thanks [@haacked](https://github.com/haacked)! - Exclude active feature flag payloads from event properties
  (2026-04-16)

- [#3392](https://github.com/PostHog/posthog-js/pull/3392) [`00cd1ce`](https://github.com/PostHog/posthog-js/commit/00cd1cef1d2d8a02339997bd3156aa1e395bea40) Thanks [@haacked](https://github.com/haacked)! - Fix unnecessary persisted config and activation properties (including product tours, surveys, and session recording config) added to captured events
  (2026-04-16)
- Updated dependencies []:
    - @posthog/types@1.369.1
</Release>

<Release version="@posthog/ai@7.16.0" date="April 15, 2026" published="2026-04-15T09:32:43.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/%40posthog/ai%407.16.0">
## 7.16.0

### Minor Changes

- [#3387](https://github.com/PostHog/posthog-js/pull/3387) [`7ea6e26`](https://github.com/PostHog/posthog-js/commit/7ea6e26e7f89ea0a0eaf061a279541449219ca61) Thanks [@carlos-marchal-ph](https://github.com/carlos-marchal-ph)! - `Prompts.get()` now accepts `{ withMetadata: true }` and returns a `PromptResult` object containing `source` (`api`, `cache`, `stale_cache`, or `code_fallback`), `name`, and `version` alongside the prompt text. The previous plain-string return is deprecated and will be removed in a future major version.
  (2026-04-15)
</Release>

<Release version="posthog-js@1.369.0" date="April 14, 2026" published="2026-04-14T17:41:06.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-js%401.369.0">
## 1.369.0

### Minor Changes

- [#3342](https://github.com/PostHog/posthog-js/pull/3342) [`eea5260`](https://github.com/PostHog/posthog-js/commit/eea5260bbd58fb8b2d7f0550bb03d741aaab376a) Thanks [@ksvat](https://github.com/ksvat)! - Account for property filters on events in recording triggers for v2 triggers
  (2026-04-14)

- [#3281](https://github.com/PostHog/posthog-js/pull/3281) [`b1fd228`](https://github.com/PostHog/posthog-js/commit/b1fd228eab45dc688b769378afa96a0f74167fab) Thanks [@ksvat](https://github.com/ksvat)! - Add session replay trigger groups handling (V2)
  (2026-04-14)

### Patch Changes

- Updated dependencies []:
    - @posthog/types@1.369.0
</Release>

<Release version="posthog-react-native@4.41.2" date="April 14, 2026" published="2026-04-14T17:40:57.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-react-native%404.41.2">
## 4.41.2

### Patch Changes

- [#3388](https://github.com/PostHog/posthog-js/pull/3388) [`6d0aae3`](https://github.com/PostHog/posthog-js/commit/6d0aae3795da50ba803ab99c65cc8e843254ed64) Thanks [@turnipdabeets](https://github.com/turnipdabeets)! - "exp" flag is no longer needed in tooling to upload or clone with hermes when using posthog-cli >= 0.7.4
  (2026-04-14)
</Release>

<Release version="@posthog/ai@7.15.0" date="April 14, 2026" published="2026-04-14T11:34:39.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/%40posthog/ai%407.15.0">
## 7.15.0

### Minor Changes

- [#3358](https://github.com/PostHog/posthog-js/pull/3358) [`85d3bd1`](https://github.com/PostHog/posthog-js/commit/85d3bd134dce1ae7b9287b73f2311c938bb42761) Thanks [@richardsolomou](https://github.com/richardsolomou)! - Add `PostHogSpanProcessor` as a self-contained OpenTelemetry `SpanProcessor` that handles batching and export internally. Both `PostHogSpanProcessor` and `PostHogTraceExporter` now automatically filter to AI-related spans only (`gen_ai.*`, `llm.*`, `ai.*`, `traceloop.*`).
  (2026-04-14)

- [#3377](https://github.com/PostHog/posthog-js/pull/3377) [`b90b54e`](https://github.com/PostHog/posthog-js/commit/b90b54e222ea27e7ba8113e617c5f1a924a2fc7a) Thanks [@andrewm4894](https://github.com/andrewm4894)! - Add OpenAI Agents SDK tracing support via `@posthog/ai/openai-agents`. Implements `PostHogTracingProcessor` that captures agent traces, spans, and LLM generations as PostHog LLM analytics events. Supports all span types including generation, response, function/tool, agent, handoff, guardrail, custom, audio, and MCP.
  (2026-04-14)
</Release>

<Release version="posthog-js@1.368.2" date="April 14, 2026" published="2026-04-14T08:59:07.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-js%401.368.2">
## 1.368.2

### Patch Changes

- [#3378](https://github.com/PostHog/posthog-js/pull/3378) [`f1bea33`](https://github.com/PostHog/posthog-js/commit/f1bea33f64800c187f09a0989426ea0e73f43128) Thanks [@marandaneto](https://github.com/marandaneto)! - Disable native gzip compression after a NotReadableError in the browser SDK
  (2026-04-14)
- Updated dependencies []:
    - @posthog/types@1.368.2
</Release>

<Release version="posthog-js@1.368.1" date="April 14, 2026" published="2026-04-14T06:26:59.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-js%401.368.1">
## 1.368.1

### Patch Changes

- [#3379](https://github.com/PostHog/posthog-js/pull/3379) [`d7c71b1`](https://github.com/PostHog/posthog-js/commit/d7c71b1316720d972e41b63987ef57512d615ea7) Thanks [@dmarticus](https://github.com/dmarticus)! - Fix bootstrapped feature flags being overwritten by partial /flags response when `advanced_only_evaluate_survey_feature_flags` is enabled
  (2026-04-14)
- Updated dependencies []:
    - @posthog/types@1.368.1
</Release>

<Release version="posthog-js@1.368.0" date="April 13, 2026" published="2026-04-13T17:16:30.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-js%401.368.0">
## 1.368.0

### Minor Changes

- [#3345](https://github.com/PostHog/posthog-js/pull/3345) [`3fcf5c4`](https://github.com/PostHog/posthog-js/commit/3fcf5c449b3fe10ce187d40ea03425de9f94e85f) Thanks [@jonmcwest](https://github.com/jonmcwest)! - Add posthog.captureLog() API for sending structured log entries to PostHog logs
  (2026-04-13)

### Patch Changes

- [#3373](https://github.com/PostHog/posthog-js/pull/3373) [`f5fe0a8`](https://github.com/PostHog/posthog-js/commit/f5fe0a8b11457a33c02029162a43e4eb2d3cb2d9) Thanks [@ksvat](https://github.com/ksvat)! - bump rrweb version
  (2026-04-13)
- Updated dependencies [[`3fcf5c4`](https://github.com/PostHog/posthog-js/commit/3fcf5c449b3fe10ce187d40ea03425de9f94e85f)]:
    - @posthog/types@1.368.0
</Release>

<Release version="@posthog/ai@7.14.0" date="April 10, 2026" published="2026-04-10T16:07:45.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/%40posthog/ai%407.14.0">
## 7.14.0

### Minor Changes

- [#3368](https://github.com/PostHog/posthog-js/pull/3368) [`c1f2c32`](https://github.com/PostHog/posthog-js/commit/c1f2c32218dabefde1b3c9ea2e272dbe9b117e28) Thanks [@carlos-marchal-ph](https://github.com/carlos-marchal-ph)! - Add `$ai_stop_reason` property capturing the LLM's reason for stopping generation across all providers
  (2026-04-10)

- [#3369](https://github.com/PostHog/posthog-js/pull/3369) [`cf69f96`](https://github.com/PostHog/posthog-js/commit/cf69f96a75ce3831a948cd5cc7173830085c5e45) Thanks [@carlos-marchal-ph](https://github.com/carlos-marchal-ph)! - Add Gemini `embedContent` tracking support
  (2026-04-10)
</Release>

<Release version="posthog-js@1.367.0" date="April 9, 2026" published="2026-04-09T19:39:34.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/posthog-js%401.367.0">
## 1.367.0

### Minor Changes

- [#3242](https://github.com/PostHog/posthog-js/pull/3242) [`353be9a`](https://github.com/PostHog/posthog-js/commit/353be9a878fe209a032f2d70376ece78ee67303c) Thanks [@dustinbyrne](https://github.com/dustinbyrne)! - feat: Add support for pre-loaded remote-config
  (2026-04-09)

### Patch Changes

- Updated dependencies []:
    - @posthog/types@1.367.0
</Release>

<Release version="@posthog/nuxt@1.6.9" date="April 9, 2026" published="2026-04-09T19:39:07.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/%40posthog/nuxt%401.6.9">
## 1.6.9

### Patch Changes

- Updated dependencies [[`353be9a`](https://github.com/PostHog/posthog-js/commit/353be9a878fe209a032f2d70376ece78ee67303c)]:
  - posthog-js@1.367.0
</Release>

<Release version="@posthog/types@1.367.0" date="April 9, 2026" published="2026-04-09T19:38:54.000Z" url="https://github.com/PostHog/posthog-js/releases/tag/%40posthog/types%401.367.0">
## 1.367.0
</Release>

<Pagination page="1" total-pages="16" total-items="314" next="https://releases.sh/posthog/posthog-js.md?page=2" />
