Repository navigation
refactor(react-native-plugin): drop unused setupNativeSdk method param, accept projectToken on Android - #5214
Merged
turnipdabeets merged 2 commits intoOct 6, 2026
Conversation
…m and projectToken key Both were left over from removing start(); the JS layer only calls setup and only sends apiKey.
Contributor
|
turnipdabeets
force-pushed
the
refactor/rn-plugin-setup-cleanup
branch
from
October 6, 2026 14:15
a5abccc to
32e0db6
Compare
Keeps the iOS fallback and adds it on Android, so a future RN SDK can send projectToken.
turnipdabeets
force-pushed
the
refactor/rn-plugin-setup-cleanup
branch
from
October 6, 2026 14:16
32e0db6 to
9689368
Compare
Contributor
📝 No Changeset FoundThis PR doesn't include a changeset. A changeset is required to release a new version. How to add a changesetRun this command and follow the prompts: pnpm changesetRemember: Never use |
turnipdabeets
marked this pull request as ready for review
October 6, 2026 14:18
dustinbyrne
approved these changes
Oct 6, 2026
turnipdabeets
added a commit
that referenced
this pull request
Oct 20, 2026
…m, accept projectToken on Android (#5214) * refactor(react-native-plugin): drop unused setupNativeSdk method param and projectToken key Both were left over from removing start(); the JS layer only calls setup and only sends apiKey. * refactor(react-native-plugin): accept projectToken on both platforms Keeps the iOS fallback and adds it on Android, so a future RN SDK can send projectToken.
turnipdabeets
added a commit
that referenced
this pull request
Oct 26, 2026
…m, accept projectToken on Android (#5214) * refactor(react-native-plugin): drop unused setupNativeSdk method param and projectToken key Both were left over from removing start(); the JS layer only calls setup and only sends apiKey. * refactor(react-native-plugin): accept projectToken on both platforms Keeps the iOS fallback and adds it on Android, so a future RN SDK can send projectToken.
turnipdabeets
added a commit
that referenced
this pull request
Oct 31, 2026
…m, accept projectToken on Android (#5214) * refactor(react-native-plugin): drop unused setupNativeSdk method param and projectToken key Both were left over from removing start(); the JS layer only calls setup and only sends apiKey. * refactor(react-native-plugin): accept projectToken on both platforms Keeps the iOS fallback and adds it on Android, so a future RN SDK can send projectToken.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Stacked on #5194. Two leftovers from removing
start(), flagged in review:setupNativeSdkstill takes amethodparameter, butsetupis now its only caller.sdkOptions["projectToken"], which the RN SDK never sends. The RN SDK is meant to move fromapiKeytoprojectToken, though, so the right fix is to accept both keys on both platforms rather than drop it. Android reads onlyapiKey.Changes
methodparameter fromsetupNativeSdkon iOS and Android. The Android error log now names"setup"directly.projectTokenfirst and falls back toapiKey, matching iOS. iOS is unchanged.The RN SDK still sends
apiKey, so nothing changes for apps and no changeset is needed. #5194 carries the major-bump changesets.Follow-up: when the RN SDK switches to sending only
projectToken, it also needs to raise its@posthog/react-native-pluginfloor from>= 2.9.3to>= 3.0.0, because plugin v2 on Android reads onlyapiKey.Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code applied the two review leftovers from #5194. It kept
setupNativeSdkas a separate function and did not inline it intosetup, which keeps the diff small. It first dropped the iOSprojectTokenfallback as dead, then restored it and added it on Android after the reviewer pointed out the RN SDK will move toprojectToken. It did not compile or test anything locally, so CI is the check.🤖 Generated with Claude Code