Skip to content

feat(plugin-experiment-react-native): add React Native Experiment plugin - #1944

Open
Mercy811 wants to merge 5 commits into
mainfrom
codex/sdkrn-60-experiment-plugin
Open

feat(plugin-experiment-react-native): add React Native Experiment plugin#1944
Mercy811 wants to merge 5 commits into
mainfrom
codex/sdkrn-60-experiment-plugin

Conversation

@Mercy811

@Mercy811 Mercy811 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the new @amplitude/plugin-experiment-react-native package at version 1.0.0-beta.0.
  • Integrate the Experiment React Native client with Analytics identity and exposure event forwarding.
  • Scope Analytics Connector access by instance name for multi-instance support.
  • Add unit and integration coverage plus package documentation and build configuration.

Ticket: https://linear.app/amplitude/issue/SDKRN-60/create-react-native-experiment-analytics-plugin-package

Manual test on expo-app example app and see requests to https://flag.lab.amplitude.com/sdk/v2/flags and https://api.lab.amplitude.com/sdk/v2/vardata?v=0 after pressing "START EXPERIMENT" button.
image

Validation

  • Plugin typecheck and lint pass.
  • Plugin tests pass: 7 tests.
  • Affected Analytics React Native mobile suite passes: 65 tests.

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

Note

Medium Risk
Touches Analytics identity and event-bridge wiring used by Experiment, including multi-instance connector scoping. The new plugin is additive and covered by unit/integration tests.

Overview
Adds @amplitude/plugin-experiment-react-native so React Native Analytics can initialize Experiment, share identity, and forward exposure events.

The plugin wraps Experiment.initializeWithAmplitudeAnalytics, inherits serverZone/instanceName from Analytics unless overridden, and stops the Experiment client on teardown. The Expo example wires it in with a Start Experiment button.

React Native Analytics now passes instanceName into getAnalyticsConnector, setConnectorUserId, and setConnectorDeviceId so multi-instance apps do not mix Experiment identity or events.

Reviewed by Cursor Bugbot for commit d9c5dd8. Configure here.

@linear-code

linear-code Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

SDKRN-60

SDKW-59

@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 61.54 KB (0%)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 134.97 KB (0%)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 215.58 KB (0%)
@amplitude/element-selector (gzipped esm) 2.67 KB (0%)

@Mercy811

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d9c5dd8. Configure here.

@Mercy811
Mercy811 marked this pull request as ready for review August 20, 2026 18:30
@Mercy811
Mercy811 requested a review from a team as a code owner August 20, 2026 18:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9c5dd82bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/analytics-react-native/src/react-native-client.ts Outdated
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