Skip to content

chore(react-native-plugin)!: require posthog-android 4.0 - #5476

Open
turnipdabeets wants to merge 1 commit into
chore/rn-plugin-v3from
chore/rn-plugin-posthog-android-4-pin
Open

turnipdabeets wants to merge 1 commit into
chore/rn-plugin-v3from
chore/rn-plugin-posthog-android-4-pin

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

Warning

Prep PR: CI is expected to fail until posthog-android 4.0 is released. com.posthog:posthog-android:4.0.0 isn't on Maven Central yet. Merge into #5194 once 4.0 is published and CI is green. This is the Android side of #5237 (posthog-ios 4.0).

Problem

#5194 (plugin 3.0) keeps posthog-android at 3.71.6. posthog-android 4.0 (PostHog/posthog-android#871) is coming. If plugin 3.0 is going to pick it up, it has to happen in this major.

Changes

  • packages/react-native-plugin/android/build.gradle now depends on com.posthog:posthog-android:4.0.0.
  • Changeset: Breaking, require posthog-android 4.0.
  • I don't expect the plugin's Kotlin to need any changes. I checked its calls against the 4.0 branch (chore/v4-remove-deprecated) API dump:
    • PostHogAndroidConfig(apiKey, host) passes the token by position. The 4.0 constructor's first parameter is projectToken, so the call still works.
    • The internal classes the plugin uses (PostHogPreferences, including ANONYMOUS_ID/DISTINCT_ID, and PostHogSessionManager) stay public. chore!: make SDK-internal helpers non-public posthog-android#872 keeps them public for the wrappers.
    • The plugin doesn't call any removed API (remoteConfig, debouncerDelayMs, propertiesSanitizer, getFeatureFlagPayload, PostHogOnFeatureFlags).
  • Floors don't change: posthog-android 4.0 keeps minSdk 23 and the same Kotlin settings.
  • chore(react-native-plugin)!: require posthog-ios 4.0 #5237 also trims the native SDK with SwiftPM traits; this PR doesn't. Native Compose surveys ship in a separate artifact (posthog-android-surveys-compose) that the plugin doesn't depend on.

Before merging

Release info Sub-libraries affected

Libraries affected

  • All of them
  • posthog-js (web)
  • posthog-js-lite (web lite)
  • posthog-node
  • posthog-react-native
  • @posthog/react-native-plugin
  • @posthog/react
  • @posthog/ai
  • @posthog/convex
  • @posthog/next
  • @posthog/nextjs-config
  • @posthog/nuxt
  • @posthog/openfeature-node-provider
  • @posthog/openfeature-web-provider
  • @posthog/rollup-plugin
  • @posthog/webpack-plugin
  • @posthog/types
  • @posthog/browser-common

Checklist

  • All commits are signed (see Commit signing)
  • Tests for new code (no new behavior)
  • Accounted for the impact of any changes across different platforms
  • Accounted for backwards compatibility of any changes (no breaking changes!) (intentional: rides the plugin's 3.0 major)
  • Took care not to unnecessarily increase the bundle size

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Made with Claude Code. I checked compatibility statically against the posthog-android 4.0 branch's API dump and source. Not tested: building the plugin against a local 4.0 build, or running the app.

🤖 Generated with Claude Code

@turnipdabeets turnipdabeets self-assigned this Oct 28, 2026

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed bfa07d1: 1 Must fix.

This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.

See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.

Comment thread packages/react-native-plugin/android/build.gradle
@github-actions

Copy link
Copy Markdown
Contributor

Coherence

0 spec problems · 0 failing chokepoints · 2 spec gaps · 0 guard failures

44 components, 7 bullets (5 invariants, 2 requirements), 0 problems

Chokepoints: none declared.

Spec gaps: 2 entrances with outside or unknown trust and no traced control, and 10 more held by the adoption baseline

  • packages/web/Web.spec.md entrance public api (trust host-app): packages/web
  • packages/webpack-plugin/Webpack-plugin.spec.md entrance webpack plugin (trust build): packages/webpack-plugin

Close one with guard: <chokepoint>, an invariant that names it on its entrances: line, or control: none — <reason>; scaffold control proposes it.

@turnipdabeets
turnipdabeets marked this pull request as ready for review October 28, 2026 23:21
@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 28, 2026 23:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant