feat(unified-react-native): add unified-react-native support - #1945
Open
Mercy811 wants to merge 11 commits into
Open
feat(unified-react-native): add unified-react-native support#1945Mercy811 wants to merge 11 commits into
Mercy811 wants to merge 11 commits into
Conversation
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.
Summary
@amplitude/unified-react-nativebeta package.initAll.serverZone,instanceName, and translatedlogLeveldefaults while allowing blade-specific overrides.Stacked on #1944, which provides
@amplitude/plugin-experiment-react-native.Local test with the example app

examples/unified/react-native-app. Able to see requests from all blades.Testing
pnpm install --frozen-lockfile:app:generateAutolinkingPackageListpod install(five native modules plus Engagement and AsyncStorage codegen)pnpm docs:checkpnpm lintpnpm lint:depspnpm test(30 projects)pnpm build— the new package and its dependencies build successfully, but the repository-wide command stalls in the unrelated@amplitude/segment-session-replay-pluginRollup taskpnpm test:examples— the base branch references a missing rootjest.setup.examples.jsChecklist
Note
Medium Risk
New beta SDK orchestrates multi-blade init and native autolinking for customer apps; behavior is well-tested but affects integration surfaces (RN ≥0.76, New Architecture for Engagement).
Overview
Introduces
@amplitude/unified-react-native(1.0.0-beta.0) as a single install that bundles Analytics, Experiment, Session Replay, and Guides and Surveys. A newinit()path initializes Analytics, registers blade plugins, starts Experiment, and boots Engagement, with sharedserverZone,instanceName, andlogLeveldefaults and per-blade overrides. Initialization is idempotent; failed init can retry after removing partially added blades.The package ships
react-native.config.js, an autolinking preset that exposes five transitive native modules (analytics, experiment, engagement, session replay, AsyncStorage) so apps only depend on the unified package. Public API re-exports Analytics helpers plusexperiment()/sessionReplay()accessors,AmpMaskView, and a library enrichment plugin for event metadata.Adds a bare React Native 0.76 example under
examples/unified/react-native-appthat loads the preset, enables Android New Architecture, dedupes Metro resolution for pnpm workspaces, and demonstrates manualinit()via a button (API key from root.env). Includes unit tests for the client factory, autolinking preset, and library plugin.Reviewed by Cursor Bugbot for commit 8358dca. Configure here.