feat(node-client-sdk): adding support for mobile usage#1768
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
|
@cursor review |
There was a problem hiding this comment.
✅ 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 4d9fca3. Configure here.
fix(node-client-sdk): harden typing in sdk client impl
4d9fca3 to
5c003e7
Compare
SDK-2486
This PR will add support for mobile key as a valid credential.
This PR will also harden some typing in the sdk client code.
Note
Medium Risk
Changes which LaunchDarkly hosts and paths the SDK hits when
useMobileKeyis set; default client-side ID behavior is unchanged, with validation blocking hash + mobile key at startup.Overview
Adds
useMobileKeyso the Node client can authenticate with a mobile key instead of a client-side ID. When enabled,NodeClientswitches to mobile FDv1 endpoints (mobileFdv1Endpoints), setscredentialTypetomobileKey, and uses mobile analytics/diagnostic paths (/mobile,/mobile/events/diagnostic) rather than the credential-in-path client-side URLs.NodeDataManagerdrops secure-modehashin mobile key mode (warns and omits theh=query param) so runtimeidentify()does not throw if a hash is passed.validateOptionsrejects configuringhashanduseMobileKeytogether at construction.Typing is tightened: custom storage is
LDStorage, andNodePlatformtakesValidatedOptionsfor platform-related fields. Tests mockNodePlatformand assert mobile vs default URL andAuthorizationheader behavior for polling, streaming, diagnostics, and events.Reviewed by Cursor Bugbot for commit 5c003e7. Bugbot is set up for automated code reviews on this repo. Configure here.