Skip to content

feat(unified-react-native): add unified-react-native support - #1945

Open
Mercy811 wants to merge 11 commits into
mainfrom
codex/sdkrn-61-unified-rn
Open

feat(unified-react-native): add unified-react-native support#1945
Mercy811 wants to merge 11 commits into
mainfrom
codex/sdkrn-61-unified-rn

Conversation

@Mercy811

@Mercy811 Mercy811 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the new @amplitude/unified-react-native beta package.
  • Initialize Analytics, Experiment, Session Replay, and Guides and Surveys through initAll.
  • Share serverZone, instanceName, and translated logLevel defaults while allowing blade-specific overrides.
  • Expose Experiment, Session Replay, and Guides and Surveys accessors alongside the React Native Analytics API.
  • Ship a React Native CLI autolinking preset so applications directly install only the unified package.
  • Add a bare React Native example that consumes the one-package preset and exercises every blade.
  • Add package documentation, build configuration, and full unit coverage.

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.
image

Testing

  • pnpm install --frozen-lockfile
  • Unified React Native build, typecheck, lint, and tests (18 tests, 100% coverage)
  • Unified example lint and typecheck
  • React Native CLI config resolves all five transitive native dependencies for iOS and Android
  • Android :app:generateAutolinkingPackageList
  • iOS pod install (five native modules plus Engagement and AsyncStorage codegen)
  • Production iOS Metro bundle
  • pnpm docs:check
  • pnpm lint
  • pnpm lint:deps
  • pnpm 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-plugin Rollup task
  • pnpm test:examples — the base branch references a missing root jest.setup.examples.js

Checklist

  • PR title follows the conventional commit format
  • Breaking change: No

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 new init() path initializes Analytics, registers blade plugins, starts Experiment, and boots Engagement, with shared serverZone, instanceName, and logLevel defaults 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 plus experiment() / sessionReplay() accessors, AmpMaskView, and a library enrichment plugin for event metadata.

Adds a bare React Native 0.76 example under examples/unified/react-native-app that loads the preset, enables Android New Architecture, dedupes Metro resolution for pnpm workspaces, and demonstrates manual init() 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.

Loading
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