feat(react-native): Propagate LDContext to Android session replay via afterIdentify hook#495
Merged
feat(react-native): Propagate LDContext to Android session replay via afterIdentify hook#495
Conversation
abelonogov-ld
approved these changes
Apr 23, 2026
Contributor
abelonogov-ld
left a comment
There was a problem hiding this comment.
Cool! Merge after fixing Cursor comments
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8e58d17. Configure here.
Merged
beekld
pushed a commit
that referenced
this pull request
Apr 24, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-observability-android: 0.41.0</summary> ## [0.41.0](launchdarkly-observability-android-0.40.0...launchdarkly-observability-android-0.41.0) (2026-04-23) ### Features * **react-native:** Propagate LDContext to Android session replay via afterIdentify hook ([#495](#495)) ([8179a8e](8179a8e)) </details> <details><summary>session-replay-react-native: 0.5.0</summary> ## [0.5.0](session-replay-react-native-0.4.3...session-replay-react-native-0.5.0) (2026-04-23) ### Features * **react-native:** Propagate LDContext to Android session replay via afterIdentify hook ([#495](#495)) ([8179a8e](8179a8e)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this PR is release metadata only (version bumps and changelog entries) with no functional code changes in the diff. > > **Overview** > Updates release artifacts to publish new versions of `@launchdarkly/observability-android` (**0.40.0 → 0.41.0**) and `@launchdarkly/session-replay-react-native` (**0.4.3 → 0.5.0**). > > Refreshes `.release-please-manifest.json`, the Android `gradle.properties` version, and both packages’ `CHANGELOG.md` entries noting LDContext propagation to Android session replay via the `afterIdentify` hook. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a5f425a. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.

Summary
Wires
LDContextchanges from the React Native LaunchDarkly SDK through to the Android Session Replay instance so that session replay sessions are correctly attributed to the identified user/context. Re-uses the existing hook for MAUI.Also changes the default context to be an anonymous context, rather than "placeholder", per advice from the JS SDK team.
Test plan
Note
Medium Risk
Adds a new cross-platform
afterIdentifybridge and changes Android initialization context handling, which can affect session attribution and replay data if the context/canonical key logic is wrong. Scope is limited to session replay integrations and includes new unit tests to reduce regression risk.Overview
Propagates React Native
identify()context changes into native Session Replay so replay sessions are attributed to the correct user/context.On React Native, adds an
afterIdentifyTurboModule API plus a pluginHook.afterIdentifythat convertsLDContext(single/multi/legacy) into{kind: key}maps and a canonical key (with escaping and deterministic ordering) before calling native.On Android, the RN adapter now accepts
afterIdentify, caches the latest completedLDContext, forwards it toLDReplay.hookProxy?.afterIdentify(...), and uses the cached (anonymous-by-default) context duringLDClient.initinstead of a placeholder; includes Android + JS unit tests. iOS stubs the new method for parity.Reviewed by Cursor Bugbot for commit 8e58d17. Bugbot is set up for automated code reviews on this repo. Configure here.