feat: add support for secure mode to react native sdk#1228
feat: add support for secure mode to react native sdk#1228appsandwich wants to merge 2 commits intolaunchdarkly:mainfrom
Conversation
| this.context = context; | ||
|
|
||
| // Capture the secure mode hash (if set), so that it can be forwarded to makeRequestor on each re(connection). | ||
| this.secureModeHash = identifyOptions?.hash; |
There was a problem hiding this comment.
Secure mode hash missing from streaming connection URL
High Severity
The secureModeHash is only passed to makeRequestor (used for polling), but not propagated to the streaming connection. The browser SDK's BrowserDataManager additionally calls this.setConnectionParams({ queryParameters: [{ key: 'h', value: hash }] }) which feeds into createStreamingProcessor via _connectionParams.queryParameters. Without this call, the StreamingProcessor constructs its URI without the h= query parameter, so secure mode verification fails for streaming connections.
Additional Locations (1)
|
Hey @appsandwich - thanks for the contribution; however, per our secure mode docs, this feature is not supported in the React Native SDK. The main gap here is actually on the LaunchDarkly server as it will not do anything with the hash url param when that request is received. Internally, we do have a few work items discussing how we can enable the benefits of secure mode to all of our SDKs, but I don't think we have any concrete plans to share today. If no questions or concerns - we will close this PR as it is not a feature we can support at the moment. Thanks! |


Requirements
Related issues
N/A
Describe the solution you've provided
This PR adds support for the secure mode hash in the React Native SDK. It passes the new
hashproperty on theLDIdentifyOptionsobject intoMobileDataManager, which is then propagated into the call tomakeRequestor(where the existingsecureModeHashparameter is available).Describe alternatives you've considered
N/A
Additional context
N/A
Note
Low Risk
Low risk: limited to threading an optional
hashfromidentifyinto request construction, plus tests and a type-doc update; primary risk is incorrect query param propagation affecting flag fetch URLs.Overview
Adds secure mode support to the React Native SDK by capturing
LDIdentifyOptions.hashduringMobileDataManager.identify()and passing it intomakeRequestor, which appends it as thehquery parameter on polling/streaming requests.Updates
LDIdentifyOptionsto document the new optionalhashfield, and adds React NativeMobileDataManagertests verifyingh=is included when provided, omitted when absent, persisted across connection mode changes, and cleared by a subsequent identify without a hash.Written by Cursor Bugbot for commit 5be28bd. This will update automatically on new commits. Configure here.