Repository navigation
fix: highlights and token exchange report ReactNativeSDK header (YPE-6433) - #257
Conversation
createHighlightsApi and createDataExchangeApi send ReactSDK=2.16.0. YPE-6433 Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
createHighlightsApi and createDataExchangeApi pass mergeSdkHeaders to ApiClient. ApiClient's default header is ReactSDK. mergeSdkHeaders writes ReactNativeSDK on that key. YPE-6433 Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
BrowserStack App Live
Review-fix commits are not uploaded automatically. To upload the current PR head again, comment one of:
Replace Only approved collaborators on |
camrun91
left a comment
There was a problem hiding this comment.
wiring looks right and matches #256. a few test and doc things before merge:
- header asserts should use
getSdkHeaders()['X-YVP-Sdk'], not a hand-builtReactNativeSDK=${pkg.version}-dev. that's the pattern in the bible-content and votd tests and ADR 0012. please drop thepackage.jsonimports. - the createHighlight and deleteHighlight tests already check the other headers. please add the
X-YVP-Sdkassert there too, since YPE-6433 asks for header tests. - the
CONTEXT.md"SDK Attribution Header" entry still says DOM-only. can you widen it to cover native clients too?
not blocking: /auth/token and the fonts fetch still send no stamp. worth a follow-up ticket.
Check X-YVP-Sdk on the create and delete highlight requests too, and widen the CONTEXT.md entry to cover native clients. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
camrun91
left a comment
There was a problem hiding this comment.
thanks, all three asks from the last review look good. header asserts use getSdkHeaders(), create/delete now pin X-YVP-Sdk, and the glossary covers native + lists the unstamped calls.
one small thing: the changeset (.changeset/ype-6433-react-native-sdk-header.md:5) says "token exchange", which reads as the oauth /auth/token path. that one isn't stamped yet, per CONTEXT.md. could you reword it to something like Send ReactNativeSDK on highlight and data-exchange token requests. so the release notes match what shipped?
"Token exchange" reads as the OAuth /auth/token path, which is not stamped yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
camrun91
left a comment
There was a problem hiding this comment.
thanks for the quick turnaround, changeset reads right now. lgtm 👍
Why
Highlight and data-exchange token requests should count as this React Native SDK. They still succeed, and usage tracking counts them as the web SDK (
ReactSDK).createHighlightsApiandcreateDataExchangeApinow passmergeSdkHeaders, which setsX-YVP-SdktoReactNativeSDK. This follows YPE-6433 and the image and search change in #256.What changed
createHighlightsApiandcreateDataExchangeApipassmergeSdkHeadersinto the shared client.Scope
ReactNativeSDKon main. Bible content, the version picker, and verse of the day already send it too. This change leaves them alone.Tradeoffs
The data-exchange token mint has no extra-header option, so the call is
mergeSdkHeaders()with no extra headers. Highlights already accepted extra headers. Those still pass through. A secondx-yvp-sdkis dropped, same as images and search.Blast Radius
Apps that load highlights or mint a data-exchange token. The requests still succeed. Tracking will see
ReactNativeSDKwhere it sawReactSDK.Verification
ReactNativeSDK=2.2.0-devand receivedReactSDK=2.16.0.pnpm typecheckpassed.pnpm lint --max-warnings=0passed. Core had 716 passing tests. UI had 906 passing tests and 1 skipped.

Confidence Score: 5/5
This PR appears safe to merge; no blocking issues were found.Summary
Highlight requests and data-exchange token mints now send
ReactNativeSDKthroughmergeSdkHeaders.Reviews (3) · Last reviewed commit: "docs(changeset): say data-exchange token..." · Reviewed by Greptile