Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
bb0b13c
chore!: adopt posthog-ios 4.0
turnipdabeets Oct 7, 2026
dd988fe
docs(changeset): note posthog-ios 4.0 drops lifecycle version and build
turnipdabeets Oct 7, 2026
852c2c9
chore(ios): drive onFeatureFlags from the posthog-ios onFeatureFlags …
turnipdabeets Oct 23, 2026
da3dedd
chore!: adopt posthog-android 4.0
turnipdabeets Oct 23, 2026
82c0958
feat: add per-event capture options and captureAi
turnipdabeets Oct 26, 2026
270c83e
feat: add captureAi queue and request settings to PostHogConfig
turnipdabeets Oct 27, 2026
011a3df
docs: spell out when captureAi returns null
turnipdabeets Oct 27, 2026
7605a8d
docs: captureAi returns null for an oversized event on Android too
turnipdabeets Oct 27, 2026
78793d0
fix: retry desktop capture v1 requests that get 404 or 429
turnipdabeets Oct 27, 2026
fef8375
fix: back off across failed desktop flushes and warn once on a captur…
turnipdabeets Oct 27, 2026
7a5320b
fix: leave the host out of the capture 404 warning
turnipdabeets Oct 27, 2026
b1ddba9
Merge remote-tracking branch 'origin/feat/v6-desktop-capture-v1' into…
turnipdabeets Oct 27, 2026
2939aa9
chore!: pass the loaded flags to onFeatureFlags and reloadFeatureFlag…
turnipdabeets Oct 28, 2026
5057746
Merge remote-tracking branch 'origin/feat/v6-desktop-capture-v1' into…
turnipdabeets Oct 28, 2026
f4e94c4
Merge remote-tracking branch 'origin/fix/v6-desktop-retry-404-429' in…
turnipdabeets Oct 28, 2026
8e5b267
feat(desktop): send event options unchanged in the capture v1 event
turnipdabeets Oct 28, 2026
1a4b73b
feat(desktop): build event properties in the native 4.0 order
turnipdabeets Oct 28, 2026
ed36592
fix(desktop): back off capture v1 retries like posthog-ios and postho…
turnipdabeets Oct 28, 2026
1ae278f
fix(desktop): time out capture requests on inactivity, not on total d…
turnipdabeets Oct 28, 2026
7c25cac
fix(desktop): halve flushAt with the batch size on 413 and end the flush
turnipdabeets Oct 28, 2026
d3b3dea
feat(desktop): send captureAi events to the capture v1 AI endpoint
turnipdabeets Oct 28, 2026
280ae5e
docs: describe desktop captureAi, options and property order in chang…
turnipdabeets Oct 28, 2026
b7cd99c
fix(desktop): flush once 5 MiB of events are queued
turnipdabeets Oct 28, 2026
9c37f27
Merge fix/v6-desktop-retry-404-429 into feat/v6-desktop-capture-ai
turnipdabeets Oct 28, 2026
a8cc69e
fix(desktop): feed flags the person properties beforeSend keeps
turnipdabeets Oct 28, 2026
c26030b
fix(desktop): keep properties beforeSend removes off the queued event
turnipdabeets Oct 28, 2026
aba2752
perf(desktop): size the capture batch before reading queued events
turnipdabeets Oct 28, 2026
c3a3c04
fix(desktop): release delivered payloads after each capture v1 batch
turnipdabeets Oct 28, 2026
83ff3bb
fix(desktop): turn on person processing only for events beforeSend keeps
turnipdabeets Oct 28, 2026
f1ed59f
fix(desktop): give beforeSend a deep copy of the event properties
turnipdabeets Oct 28, 2026
68c8d9f
docs: limit the capture v1 migration note to native and desktop platf…
turnipdabeets Oct 28, 2026
fea4954
docs(desktop): note beforeSend cannot change $lib or $lib_version
turnipdabeets Oct 28, 2026
0421258
fix(desktop): cap the response body read at 30 seconds
turnipdabeets Oct 28, 2026
612aa8e
fix(desktop): warn when captureAiMaxEventBytes is over the ceiling
turnipdabeets Oct 28, 2026
a9facd9
Merge remote-tracking branch 'origin/fix/v6-desktop-retry-404-429' in…
turnipdabeets Oct 28, 2026
21211b2
Merge feat/v6-desktop-capture-v1 into feat/v6-desktop-capture-ai
turnipdabeets Oct 28, 2026
462f1ee
style: format the merged fetch attempt
turnipdabeets Oct 28, 2026
893daf8
feat!: run beforeSend on the native-built event on iOS, macOS and And…
turnipdabeets Oct 29, 2026
871d87f
fix: import only the PostHogInternal SPI from posthog-ios
turnipdabeets Oct 29, 2026
749478a
fix: drop built events whose beforeSend callbacks never finish
turnipdabeets Oct 29, 2026
5c5415d
fix: clear pending built events on setup and close
turnipdabeets Oct 29, 2026
dff7175
fix: keep primitive arrays when sending built events over the channel
turnipdabeets Oct 29, 2026
9016430
ci: update SDK compliance harness to 1.26.0 (#680)
turnipdabeets Oct 29, 2026
a2a4776
fix(desktop): check registered person processing before caching identify
turnipdabeets Oct 29, 2026
268e509
fix(desktop): keep a legacy $set in properties for beforeSend to remove
turnipdabeets Oct 29, 2026
13cd119
fix(desktop): recompute person processing from the properties beforeS…
turnipdabeets Oct 29, 2026
870e6aa
Merge chore/v6-adopt-posthog-android-4 into feat/v6-capture-options-ai
turnipdabeets Oct 29, 2026
7ce6312
Merge feat/v6-capture-options-ai into feat/v6-desktop-capture-ai
turnipdabeets Oct 29, 2026
1f47726
Merge feat/v6-desktop-capture-ai into feat/v6-before-send-parity
turnipdabeets Oct 29, 2026
980eee4
feat(desktop): give beforeSend the full event and add nothing after it
turnipdabeets Oct 29, 2026
24b53ec
style: merge the repeated guards in buildEvent for swiftformat 0.64
turnipdabeets Oct 29, 2026
f1af9d7
fix(desktop): keep another distinct id's person properties out of the…
turnipdabeets Oct 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/v6-before-send-native-event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"posthog_flutter": major
---

- **Breaking:** On iOS, macOS and Android, `beforeSend` callbacks now get the event the native SDK built, with its system and registered properties, and their changes are final, matching Windows and Linux
- Add `PostHogEvent.uuid`, `distinctId` and `timestamp`, set on every platform but web; a callback can change the distinct ID and timestamp, and the event keeps its uuid
- On Windows and Linux, attach `$exception_steps` before the `beforeSend` callbacks run, as on iOS and Android, so they can read or remove them; steps recorded while a callback runs, or an event a callback renames to `$exception`, no longer get them
- Add `PosthogFlutterPlugin.addBeforeSend` in Swift and Kotlin to filter or edit events the native SDK captures itself, such as crashes, app lifecycle and `$feature_flag_called` events
8 changes: 8 additions & 0 deletions .changeset/v6-capture-options-ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"posthog_flutter": minor
---

- Add an `options` parameter to `capture`, `screen`, `identify`, `setPersonProperties`, `alias`, `group` and `captureException`, and `PostHogEvent.options` for `beforeSend` callbacks. The known keys `process_person_profile`, `cookieless_mode`, `disable_skew_correction` and `product_tour_id` win over their legacy `$` properties. On iOS, macOS, Android, Windows and Linux other keys are sent as-is; on web the known keys are sent as their legacy `$` properties and other keys are dropped
- Add `captureAi` for AI observability events such as `$ai_generation`, sent to PostHog's AI endpoint on iOS, macOS, Android, Windows and Linux, returning the event's UUID, or `null` when the event isn't admitted (dropped by `beforeSend`, oversized, SDK disabled or opted out). On web `captureAi` is a no-op: it sends nothing and returns `null`
- Add `PostHogConfig.captureAiCompression`, `captureAiMaxQueueSize`, `captureAiTimeout` and `captureAiMaxEventBytes` for the `captureAi` queue and requests. Unset, they keep the SDK defaults. They have no effect on web
- On Windows and Linux, a `$process_person_profile` property or `process_person_profile` option passed with an event now applies to that event instead of being replaced by the SDK's value
8 changes: 8 additions & 0 deletions .changeset/v6-desktop-capture-ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"posthog_flutter": major
---

- **Breaking:** on Windows and Linux, an event's properties are now the ones the SDK sets (device and app context, `$lib`, feature flags, `$session_id`, `$is_identified`, the `$sdk_debug_*` keys), then registered properties, then the event's own, as in `posthog-ios` and `posthog-android` 4.0. A registered or event property with the same name as an SDK property now wins, for that event only. The Dart `beforeSend` callbacks run after that merge, so they see and can change every property and option the SDK adds, and the event is sent as they leave it, except `$lib` and `$lib_version`: PostHog always sets them from the SDK's `PostHog-Sdk-Info` header
- **Breaking:** on Windows and Linux, person processing is sent as the `process_person_profile: false` option only while it is off, instead of a `$process_person_profile` property on every event
- On Windows and Linux, `captureAi` queues AI events on disk apart from other events. The queue keeps up to `captureAiMaxQueueSize` events (100 by default) and 50 MiB, drops a serialized event over `captureAiMaxEventBytes` (8 MiB plus 64 KiB by default, measured before compression) and is sent like other events: same batching, retries and backoff, compressed with `captureAiCompression`, a request failing after `captureAiTimeout` (60 seconds by default) without progress
- On Windows and Linux, an event's timestamp is taken before the `beforeSend` callbacks run
2 changes: 1 addition & 1 deletion .changeset/v6-desktop-capture-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"posthog_flutter": major
---

- **Breaking:** on every platform, events now go to capture v1 (`/i/v1/analytics/events`) instead of `/batch/`: iOS and macOS through `posthog-ios` 4.x, Android through `posthog-android` 4.x, and Windows and Linux in the Dart client. If you send events through your own reverse proxy, update it before you upgrade: forward `/i/v1/analytics/events` and `/i/v1/ai/events`, pass `Authorization` (the project token, sent as `Bearer <token>`), every `PostHog-*` header, `Content-Type`, `Content-Encoding` and `User-Agent` through unchanged, and accept request bodies up to 20 MB. PostHog's managed reverse proxy already does this. See the [iOS](https://github.com/PostHog/posthog-ios/blob/main/docs/migration-3.x-to-4.0.md#hosts-without-capture-v1) and [Android](https://github.com/PostHog/posthog-android/blob/main/docs/migration-3.x-to-4.0.md#hosts-without-capture-v1) migration guides
- **Breaking:** on iOS, macOS, Android, Windows and Linux, events now go to capture v1 (`/i/v1/analytics/events`) instead of `/batch/`: iOS and macOS through `posthog-ios` 4.x, Android through `posthog-android` 4.x, and Windows and Linux in the Dart client. If you send events through your own reverse proxy, update it before you upgrade: forward `/i/v1/analytics/events` and `/i/v1/ai/events`, pass `Authorization` (the project token, sent as `Bearer <token>`), every `PostHog-*` header, `Content-Type`, `Content-Encoding` and `User-Agent` through unchanged, and accept request bodies up to 20 MB. PostHog's managed reverse proxy already does this. See the [iOS](https://github.com/PostHog/posthog-ios/blob/main/docs/migration-3.x-to-4.0.md#hosts-without-capture-v1) and [Android](https://github.com/PostHog/posthog-android/blob/main/docs/migration-3.x-to-4.0.md#hosts-without-capture-v1) migration guides
- **Breaking:** on Windows and Linux, a reverse proxy or self-hosted instance must serve the new path: a 404 is retried, the events stay queued, and the SDK prints a warning once, also without `debug`. Events queued before the upgrade are sent through the new endpoint
- **Breaking:** on Windows and Linux, a redirect drops the batch instead of retrying it (only same-origin 307/308 redirects are followed, while a 404 or 429 is retried), and a `Retry-After` wait is capped at 30 seconds
- On Windows and Linux, a failed batch, or one whose events the server asks to retry, is no longer resent within the same flush: the queue backs off like the iOS and Android SDKs, waiting 1 second and doubling up to 30 seconds with Β±25% jitter, until a batch is delivered. A `Retry-After` is a floor under that wait rather than a replacement
6 changes: 6 additions & 0 deletions .changeset/v6-flags-loaded-result.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"posthog_flutter": major
---

- **Breaking:** `PostHogConfig.onFeatureFlags` now receives a `PostHogFeatureFlagsLoaded` with the enabled flags, their values and whether loading failed. Update callbacks from `() { ... }` to `(loaded) { ... }` (or `(_) { ... }`)
- **Breaking:** `reloadFeatureFlags()` now returns a `Future<PostHogFeatureFlagsLoaded>` with the reloaded flags
5 changes: 5 additions & 0 deletions .changeset/v6-posthog-android-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"posthog_flutter": major
---

- **Breaking:** adopt `posthog-android` 4.x
8 changes: 8 additions & 0 deletions .changeset/v6-posthog-ios-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"posthog_flutter": major
---

- **Breaking:** adopt `posthog-ios` 4.x, which requires Xcode 26
- **Breaking:** return `null` instead of the raw string for a malformed, empty, or whitespace-only `getFeatureFlagResult()` payload on iOS and macOS
- **Breaking:** keep string payloads passed to `PostHogBootstrapConfig.featureFlagPayloads`, such as `"123"`, as strings on iOS and macOS instead of decoding them to numbers or booleans
- **Breaking:** stop sending the legacy `version` and `build` properties on `Application Installed`, `Application Updated` and `Application Opened` on iOS and macOS β€” use `$app_version` and `$app_build`. Android still sends them until `posthog-android` drops them
4 changes: 2 additions & 2 deletions .github/workflows/sdk-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:
jobs:
compliance:
name: PostHog SDK compliance tests
uses: PostHog/posthog-sdk-test-harness/.github/workflows/test-sdk-action.yml@27806196fa5c5ac74e9e7500bc46b74db1869f3a # main @ 2026-07-27
uses: PostHog/posthog-sdk-test-harness/.github/workflows/test-sdk-action.yml@c90b42dbe2235c89aad3b4dddf74f520a8c6c747 # 1.26.0
with:
adapter-dockerfile: "sdk_compliance_adapter/Dockerfile"
adapter-context: "."
test-harness-version: "0.9.0"
test-harness-version: "1.26.0"
Loading
Loading