Skip to content

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

Merged
turnipdabeets merged 3 commits into
chore/rn-plugin-v3from
chore/rn-plugin-posthog-android-4-pin
Nov 4, 2026
Merged

turnipdabeets merged 3 commits into
chore/rn-plugin-v3from
chore/rn-plugin-posthog-android-4-pin

Conversation

@turnipdabeets

@turnipdabeets turnipdabeets commented Oct 28, 2026 •

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 entry in .changeset/rn-plugin-v3.md: Breaking, require posthog-android 4.0.
  • Apart from removing sessionReplayConfig.screenshot = true, which chore!: remove wireframe session replay capture posthog-android#908 removes, 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.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Coherence

📄 0 spec file errors · ⛔ 0 broken rules · 🚪 2 unchecked inputs · 🐛 0 bugs that came back

What is Coherence?

Coherence compares the code with its spec files (*.spec.md). A spec file lists the rules for one part of the code.

This check read 44 parts of the code and 7 rules.

Note

These findings do not make this check fail.

None of these findings are in files that this pull request changes. You do not need to fix them in this pull request.

🚪 Unchecked inputs (2)

  • public api in packages/web/Web.spec.md. The input comes from: host-app.
  • webpack plugin in packages/webpack-plugin/Webpack-plugin.spec.md. The input comes from: build.
What this means and how to fix it

Input from outside this code comes in at these places. The spec does not say what checks that input. 10 more places were already like this when Coherence was added. This list does not show them.

To close one of these, find the place by its name in the ## entrances section of its spec file. Add one line under it:

  • If all of the input goes through one function that a rule in the spec protects, add guard: <function>.
  • If a rule in the spec already checks input from the same source, add the place's name to the entrances: line of that rule.
  • If the input needs no check, add control: none - <reason>.

To get the line to add, run npx --no -- coherence scaffold control "<name>".

@dustinbyrne dustinbyrne 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.

The native dependency pin and major changeset fit the plugin 3.0 upgrade. No additional issue found in the inspected wrapper/API paths. Merge remains gated on the published Android 4.0 artifact, final compatibility recheck and green Android native CI.

AI-assisted review.

@github-actions

Copy link
Copy Markdown
Contributor
⚠️ Changeset declares `posthog-react-native` but no source files in that package changed

This is informational — the PR is not blocked. Click the triangle above to collapse, or push a fix and this comment will auto-delete.

Declared in a changeset but no source files modified:

  • posthog-react-native

Double-check this is intentional — for example, releasing a previously-merged change.

Changesets in this PR:

  • @posthog/react-native-plugin — major
  • posthog-react-native — patch

@github-actions

Copy link
Copy Markdown
Contributor

📝 No Changeset Found

This PR doesn't include a changeset. A changeset is required to release a new version.

How to add a changeset

Run this command and follow the prompts:

pnpm changeset

Remember: Never use major version bumps for posthog-js as it's autoloaded by clients.

@turnipdabeets
turnipdabeets marked this pull request as ready for review November 4, 2026 21:27
@turnipdabeets
turnipdabeets merged commit eb944c3 into chore/rn-plugin-v3 Nov 4, 2026
71 of 74 checks passed
@turnipdabeets
turnipdabeets deleted the chore/rn-plugin-posthog-android-4-pin branch November 4, 2026 21:27
turnipdabeets added a commit that referenced this pull request Nov 4, 2026
* chore(react-native-plugin)!: require posthog-android 4.0

* docs(react-native-plugin): fold posthog-android 4.0 notes into the 3.0 changeset and guide

* chore(react-native-plugin): drop posthog-android's screenshot option
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.

2 participants