Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
caf64bd
chore!: remove deprecated APIs for posthog-android 4.0
turnipdabeets Oct 22, 2026
4d7c1fd
chore!: return null for malformed feature flag payloads (#889)
turnipdabeets Oct 26, 2026
ec06e86
chore!: make SDK-internal helpers non-public (#872)
turnipdabeets Oct 27, 2026
ead5a23
chore!: remove the deprecated remoteConfig option (#874)
turnipdabeets Oct 27, 2026
b2361cd
chore!: pass the load result to the feature flags callback (#877)
turnipdabeets Oct 28, 2026
e6894bf
feat: add an onFeatureFlags listener you can unsubscribe (#878)
turnipdabeets Oct 29, 2026
1a28cc4
Merge remote-tracking branch 'origin/main' into chore/v4-remove-depre…
turnipdabeets Oct 30, 2026
0adff2a
chore: remove changeset for already released beforeSend fix
turnipdabeets Oct 30, 2026
fb3f75b
Merge remote-tracking branch 'origin/chore/v4-remove-deprecated' into…
turnipdabeets Oct 30, 2026
0e7e28a
docs: consolidate 4.0 changeset and migration guide
turnipdabeets Oct 30, 2026
9d87b0b
Merge remote-tracking branch 'origin/main' into audit/v4-remove-depre…
turnipdabeets Oct 31, 2026
4940963
docs: merge the server changeset and correct the Android min API
turnipdabeets Oct 31, 2026
81340f3
docs: keep the server changeset separate from Android
turnipdabeets Oct 31, 2026
7e23b1e
docs: leave surveys-compose out of the 4.0 changeset
turnipdabeets Oct 31, 2026
9cf154d
feat!: remove defaultValue from getFeatureFlag (#917)
turnipdabeets Nov 2, 2026
f106ead
feat!: remove PostHogConfig.onFeatureFlags in favor of the listener (…
turnipdabeets Nov 2, 2026
265ec84
chore!: remove wireframe session replay capture (#908)
turnipdabeets Nov 3, 2026
f827a88
Merge remote-tracking branch 'origin/main' into chore/v4-remove-depre…
turnipdabeets Nov 3, 2026
427b3f9
Merge remote-tracking branch 'origin/main' into chore/v4-remove-depre…
turnipdabeets Nov 4, 2026
8507dd2
fix(replay): hit-test masked touches against the unmerged semantics tree
turnipdabeets Nov 4, 2026
7f131ce
Merge remote-tracking branch 'origin/main' into chore/v4-remove-depre…
turnipdabeets Nov 4, 2026
a1aa0d3
fix(flags): decode payloads cached by 3.x from the cached flag detail…
turnipdabeets Nov 5, 2026
df58692
feat!: send events through capture v1 and add captureAi (#881)
turnipdabeets Nov 5, 2026
9bbfa91
Merge remote-tracking branch 'origin/main' into chore/v4-remove-depre…
turnipdabeets Nov 5, 2026
3419871
docs: tighten the 4.0 changesets and migration guide for release
turnipdabeets Nov 5, 2026
be3ed4b
docs: scope the debug log changeset entry to analytics and AI events
turnipdabeets Nov 5, 2026
cf0caa5
docs: note that capture redirect rules also apply to a custom httpClient
turnipdabeets Nov 5, 2026
a2b3c67
fix: keep $lib and $lib_version on capture v1 events (#942)
turnipdabeets Nov 5, 2026
fadfbfb
docs: warn that older self-hosted proxy recipes strip Authorization
turnipdabeets Nov 6, 2026
a222f70
docs: link the changelog absolutely in the 4.0 migration guide
turnipdabeets Nov 6, 2026
96722f0
docs: add dialog dim and deep link $ parameters to the 4.0 migration …
turnipdabeets Nov 6, 2026
2832e84
docs: say the first event after a language change carries the previou…
turnipdabeets Nov 6, 2026
56e9998
docs: correct 4.0 server, replay and isFeatureEnabled notes
turnipdabeets Nov 8, 2026
70a39bf
Merge main into chore/v4-remove-deprecated
turnipdabeets Nov 8, 2026
24d26d8
test(replay): fill the stacked-dialog dim as a rect in the golden render
turnipdabeets Nov 8, 2026
d6ce5b3
fix: replay onFeatureFlags to a late listener without waiting for the…
turnipdabeets Nov 9, 2026
f8ac747
fix(flags): read an empty variant as disabled in getFeatureFlagResult…
turnipdabeets Nov 9, 2026
1e8fdea
chore(api): hide @PostHogInternal declarations from the API dump (#950)
turnipdabeets Nov 9, 2026
693e2d2
fix!: omit $feature_flag_response for a missing flag (#951)
turnipdabeets Nov 9, 2026
729d5a6
Merge remote-tracking branch 'origin/main' into tmp-merge-chore-v4-re…
turnipdabeets Nov 9, 2026
8b63a13
docs(migration): cover missing-flag response, posthog-server 2.25 and…
turnipdabeets Nov 9, 2026
6b54616
fix: keep null array elements in event properties (#955)
turnipdabeets Nov 9, 2026
7bb2757
docs(migration): tell users to rename empty flag variants before upgr…
turnipdabeets Nov 9, 2026
61ba47c
feat: let wrapper SDKs register capture options for every event (#954)
turnipdabeets Nov 9, 2026
bc7fdf6
docs: move the 4.0 guide to MIGRATION.md and fill its gaps
turnipdabeets Nov 9, 2026
67ad27b
fix: fill $lib and $lib_version as a pair after every other layer (#956)
turnipdabeets Nov 10, 2026
31a0fb4
Merge remote-tracking branch 'origin/main' into chore/v4-remove-depre…
turnipdabeets Nov 10, 2026
aaa23d3
docs: say core 7.0 isn't supported on its own throughout the migratio…
turnipdabeets Nov 10, 2026
5f161b8
docs: show how to keep identity calls under a registered personless s…
eli-r-ph Nov 11, 2026
358f9fe
fix: skip the person-properties hash for maybe-personless updates (#965)
turnipdabeets Nov 12, 2026
7e1c115
Merge remote-tracking branch 'origin/main' into v4-merge-main
turnipdabeets Nov 12, 2026
3ed80db
docs: fix capture v1 link and cover PostHogStateless subclasses in th…
turnipdabeets Nov 12, 2026
e5fe7a4
fix: align posthog-android to core's major with a Gradle constraint (…
turnipdabeets Nov 12, 2026
6c88c13
fix: release review follow-ups for posthog-android 4.0 (#976)
turnipdabeets Nov 12, 2026
830f789
Merge main into chore/v4-remove-deprecated
turnipdabeets Nov 13, 2026
3cf406d
fix: read cached failed flags without metadata from an in-memory cache
turnipdabeets Nov 13, 2026
b8e5ca7
docs: sort the Android 4.0.0 migration guide by when you make each ch…
gewenyu99 Nov 13, 2026
9217eec
fix: keep a registered personless setting off identity events (#979)
turnipdabeets Nov 13, 2026
7bd8b19
docs: regenerate the migration page from MIGRATION.md after #979
turnipdabeets Nov 13, 2026
3433e90
fix: close replay masking and legacy retry gaps from 4.0 review (#980)
turnipdabeets Nov 16, 2026
0f9faf6
chore: merge main into the 4.0 branch
turnipdabeets Nov 16, 2026
3625302
feat!: enable surveys by default (#984)
turnipdabeets Nov 16, 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
52 changes: 52 additions & 0 deletions .changeset/android-v4-major.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
'posthog': major
'posthog-android': major
---

- See the [posthog-android 3.x.x to 4.0.0 migration guide](https://github.com/PostHog/posthog-android/blob/main/MIGRATION.md) for upgrade steps
- **Breaking:** stop supporting core `posthog` on its own through `PostHogStateless.with`. Use it through `posthog-android` or `posthog-server`
- **Breaking:** send analytics events to capture v1 (`/i/v1/analytics/events`) with the project token in an `Authorization: Bearer` header, replacing any `Authorization` header in `requestHeaders`. Reverse proxies must serve the path. A 404 keeps events queued, retries them and prints one warning even when `debug` is off
- **Breaking:** drop events when a capture request gets a non-retryable status (including 3xx), a 2xx without per-event results, or a redirect other than a 307 or 308 to the same origin as `host` (followed at most 5 times). Retry 404, 408, 429, 500, 502, 503 and 504
- **Breaking:** cap a `Retry-After` wait at 30 seconds, read it as a minimum wait and accept an HTTP date, and add up to 25% random jitter to the backoff, which still doubles from 1 to 30 seconds, for events, session replay and logs
- **Breaking:** drop events with an empty name before sending them, including one `beforeSend` renames to `""`. PostHog also drops events with an empty distinct ID or a name or distinct ID over 200 bytes
- **Breaking:** send `$session_id` and `$window_id` as top-level `session_id` and `window_id` fields, dropping non-string values
- **Breaking:** send `$process_person_profile`, `$cookieless_mode`, `$ignore_sent_at` and `$product_tour_id` as capture options instead of properties. PostHog drops an event whose option value it can't read
- **Breaking:** set the `process_person_profile` option to `false` only when person processing is off, instead of adding a `$process_person_profile` property to every event
- **Breaking:** let a `process_person_profile` option or `$process_person_profile` property set to `true` turn person processing on for an event even with `PersonProfiles.NEVER`
- **Breaking:** let registered super properties override properties the SDK sets, such as `$os_name`, and let super and event properties override `$is_identified`, `$process_person_profile` and the session replay debug properties
- Ignore a registered `$process_person_profile` or `process_person_profile` option on `$identify`, `$create_alias`, `$merge_dangerously`, `$groupidentify`, `$set` and `$set_once`, so a registered `false` doesn't stop identifying users
- **Breaking:** fill `$lib` and `$lib_version` last and as a pair, only when the event doesn't name its library. A `$lib` you register or pass is sent as it is, without the SDK's version
- **Breaking:** let `userProperties`, `userPropertiesSetOnce` and `groups` win key by key over `$set`, `$set_once` and `$groups` maps in the same call's properties, and merge a `$groups` map in properties into the groups set with `group()`
- **Breaking:** keep the event's own uuid when `beforeSend` returns an event with another uuid
- **Breaking:** disable the SDK at setup when `projectToken` is a personal API key (`phx_...`), as for an empty token, and print a warning for both even when `debug` is off
- **Breaking:** add an `options` parameter to `capture`, `screen`, `identify`, `setPersonProperties`, `alias`, `group` and `captureException`. Java callers pass `null` for it
- **Breaking:** add `onFeatureFlags()`, `setAppLanguage()`, `captureAi()` and the `options` parameters to `PostHogInterface`, and move `identify(distinctId, userProperties, userPropertiesSetOnce)` from `PostHogCoreInterface` to `PostHogStatelessInterface`. Classes that implement these interfaces must add them
- **Breaking:** rename `PostHogConfig.maxRetries` to `pushNotificationSubscriptionMaxRetries`
- **Breaking:** remove the deprecated `apiKey` property and the `PostHogConfig(apiKey = …)` and `PostHogAndroidConfig(apiKey = …)` factories. Use `projectToken`
- **Breaking:** remove the deprecated `propertiesSanitizer` option and `PostHogPropertiesSanitizer`. Use `addBeforeSend`
- **Breaking:** remove the deprecated `evaluationEnvironments` option. Use `evaluationContexts`
- **Breaking:** remove the deprecated `remoteConfig` option. The SDK always loads remote config at setup
- **Breaking:** enable `surveys` by default. Surveys display when the app depends on `posthog-android-surveys-compose` or sets `surveysConfig.surveysDelegate`; set `surveys = false` to keep them off
- **Breaking:** remove the deprecated `getFeatureFlagPayload()`. Use `getFeatureFlagResult(key, sendFeatureFlagEvent = false)?.payload`
- **Breaking:** remove the `defaultValue` parameter from `getFeatureFlag()`, which returns `null` for a missing flag or a disabled SDK. A positional `Boolean` second argument now sets `sendFeatureFlagEvent`, and `$feature_flag_called` no longer reports a fallback as the flag's value
- **Breaking:** leave `$feature_flag_response` out of `$feature_flag_called` for a missing flag instead of sending an empty string
- **Breaking:** remove `PostHogConfig.onFeatureFlags`. Call `PostHog.onFeatureFlags(callback)` before `setup()` instead
- **Breaking:** replace `PostHogOnFeatureFlags` with `PostHogFeatureFlagsCallback` in `reloadFeatureFlags()`, which receives a `PostHogFeatureFlagsLoaded` with the enabled flags, their values and `errorsLoading`
- **Breaking:** return `null` from `getFeatureFlagResult(key)?.payload` for a payload that isn't valid JSON, such as plain text, a malformed or empty string, or a JSON `null`
- **Breaking:** return `enabled = false` from `getFeatureFlagResult()` and leave the flag out of `PostHogFeatureFlagsLoaded` and `$active_feature_flags` for a feature flag whose variant is an empty string, as `isFeatureEnabled()` already does
- **Breaking:** make SDK-internal helpers in `com.posthog.internal` non-public
- Add `captureAi()` to send AI events such as `$ai_generation` to `/i/v1/ai/events` on their own disk queue, returning the event uuid or `null` when the event isn't queued, with the `captureAiCompression`, `captureAiMaxQueueSize`, `captureAiTimeout` and `captureAiMaxEventBytes` options
- Add `onFeatureFlags()` to listen for every feature flags load (on the main thread on Android), returning a `PostHogFeatureFlagsSubscription` you can `unsubscribe()`
- Add the `$app_language` property with the language the app displays on Android 13+, and `setAppLanguage()` to set it on every version
- Add internal APIs so wrapper SDKs can run their own `beforeSend` on the fully built event
- Add internal APIs so wrapper SDKs can register capture options sent with every event
- Send events queued on disk by 3.x.x through capture v1 after the update
- Upgrade `posthog-android` to 4.0.0 when an app pins core `posthog` 7.x.x next to `posthog-android` 3.x.x, which would otherwise crash with `NoSuchMethodError` (Gradle builds only)
- Send a `PostHog-Request-Id` header with each capture request, which reverse proxies must pass through
- Cap a capture request at about 5 MiB of events and send as soon as that much is queued
- Use the current distinct ID when the `distinctId` argument to `capture` is empty or whitespace-only, instead of dropping the event
- Stop storing or matching the person-properties deduplication hash for a `$set` sent with `process_person_profile: false`
- Stop printing analytics and AI event request and response bodies, property values and `beforeSend` exception messages in debug logs, and log per-batch drop and retry counts instead
- Fix losing an event whose properties hold a nested map with non-string keys. Number, boolean and `null` keys are converted to strings
- Fix removing `null` elements from lists and arrays in event properties, which moved later elements to lower indexes. They're sent as JSON `null` at their position, as is an element that can't be serialized
- Fix `beforeSend` edits reaching the caller's nested maps and lists, by giving each hook its own copy
11 changes: 11 additions & 0 deletions .changeset/android-v4-replay-and-device.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'posthog-android': major
---

- **Breaking:** remove wireframe session replay and the `screenshot`, `drawableConverter` and `debouncerDelayMs` options of `PostHogSessionReplayConfig`. Use `throttleDelayMs` instead of `debouncerDelayMs`. Replay always records masked screenshots, so apps that relied on the default now upload screenshots and should mask custom-drawn views, maps and video, or turn replay off
- **Breaking:** apply `Modifier.postHogMask()` and `Modifier.postHogUnmask()` only to the element and its children, mask Compose text that draws past its layout box in full, and mask nodes using `Modifier.clearAndSetSemantics` while text or image masking is on
- **Breaking:** send a dialog's dim and a dialog masked whole as screenshot images instead of styled wireframe shapes
- **Breaking:** change `$locale` to the first language in the device settings as a full language tag, such as `zh-Hant-TW`, instead of `Locale.getDefault()`
- **Breaking:** skip deep link query parameters whose name starts with `$` in the `Deep Link Opened` event
- **Breaking:** make SDK-internal helpers in `com.posthog.android.internal` and `com.posthog.android.replay.internal` non-public
- Always set `$sdk_debug_replay_capture_mode` to `screenshot`
15 changes: 15 additions & 0 deletions .changeset/server-keep-on-feature-flags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'posthog-server': minor
---

- Require `posthog-android` 4.0.0 or later in the same project, since core `posthog` 7.0.0 makes Gradle upgrade `posthog-android` 3.x.x to 4.0.0. Stay on `posthog-server` 2.24.x until you upgrade (see the [migration guide](https://github.com/PostHog/posthog-android/blob/main/MIGRATION.md#upgrade-posthog-server))
- Bump the `posthog` core dependency to 7.0.0. `posthog-server` keeps its API, `/batch` endpoint and retry behavior
- Move `PostHogOnFeatureFlags` into `posthog-server` with the same name and API
- Add an `options` property to `PostHogEvent`, which `beforeSend` can read. `posthog-server` still sends to `/batch`, which doesn't use it, so setting it in `beforeSend` has no effect
- Disable the client at setup when `projectToken` is a personal API key (`phx_...`), as for an empty token, and print why for both even when `debug` is off
- Drop events with an empty name before sending them
- Merge `userProperties`, `userPropertiesSetOnce` and `groups` key by key over a `$set`, `$set_once` or `$groups` map in `properties`
- Stop printing unserializable property values and `beforeSend` exception messages in debug logs
- Fix losing an event whose properties hold a nested map with non-string keys. Number, boolean and `null` keys are converted to strings
- Fix removing `null` elements from lists and arrays in event properties, which moved later elements to lower indexes. They're sent as JSON `null` at their position, as is an element that can't be serialized
- Fix `beforeSend` edits reaching the caller's nested maps and lists, by giving each hook its own copy
4 changes: 2 additions & 2 deletions .github/workflows/sdk-compliance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- 'sdk_compliance_adapter/**'
- '.github/workflows/sdk-compliance-tests.yml'
pull_request:
branches: [ main ]
branches: [ main, 'chore/v4-*', 'feat/v4-*' ]
paths:
- 'posthog/**'
- 'sdk_compliance_adapter/**'
Expand All @@ -26,5 +26,5 @@ jobs:
with:
adapter-dockerfile: sdk_compliance_adapter/Dockerfile
adapter-context: .
test-harness-version: "0.10.0"
test-harness-version: "1.26.0"
report-name: android-sdk-compliance-report
Loading
Loading