Problem
The mechanism is decided in principle — inject the RN SDK's trace context into an embedded WebView so the in-page @sentry/browser continues the same trace — but the injection timing against react-native-webview is the core risk, and the public API shape needs a decision.
In RN the trace lives in the JS layer (native scope-syncs from JS), so the integration injects the RN JS SDK's propagation context (getTraceData()) directly into the WebView. Both required primitives already ship in the bundled @sentry/core v10.74.0: getTraceData() / getTraceMetaTags() (produce) and browserTracingIntegration's meta-tag continuation (consume). This is glue, not new tracing machinery.
Confirm / decide
- Vehicle (decided): meta tags. Write
<meta name="sentry-trace"> + <meta name="baggage"> from getTraceData() via injectedJavaScriptBeforeContentLoaded, before the page's @sentry/browser pageload init reads them. Confirm empirically that document-start injection wins the race, including that the hook re-fires per full-document navigation.
- Span links — decide whether to also link the WebView pageload span to the RN span that opened it.
- API shape (needs sign-off): lightweight helper returning props to spread onto the user's own
<WebView> (recommended — no component ownership) vs. a drop-in <SentryWebView> wrapper.
- Barrel exposure: whether to also re-export
getTraceData/getTraceMetaTags from packages/core/src/js/index.ts (public-API change, ask-first).
Acceptance criteria
- A written recommendation covering vehicle, injection timing, span-link decision, and API shape.
- A working proof-of-concept in the sample app showing a shared
trace_id between RN and the in-WebView page.
Hands off to design-first.
References
Problem
The mechanism is decided in principle — inject the RN SDK's trace context into an embedded WebView so the in-page
@sentry/browsercontinues the same trace — but the injection timing againstreact-native-webviewis the core risk, and the public API shape needs a decision.In RN the trace lives in the JS layer (native scope-syncs from JS), so the integration injects the RN JS SDK's propagation context (
getTraceData()) directly into the WebView. Both required primitives already ship in the bundled@sentry/corev10.74.0:getTraceData()/getTraceMetaTags()(produce) andbrowserTracingIntegration's meta-tag continuation (consume). This is glue, not new tracing machinery.Confirm / decide
<meta name="sentry-trace">+<meta name="baggage">fromgetTraceData()viainjectedJavaScriptBeforeContentLoaded, before the page's@sentry/browserpageload init reads them. Confirm empirically that document-start injection wins the race, including that the hook re-fires per full-document navigation.<WebView>(recommended — no component ownership) vs. a drop-in<SentryWebView>wrapper.getTraceData/getTraceMetaTagsfrompackages/core/src/js/index.ts(public-API change, ask-first).Acceptance criteria
trace_idbetween RN and the in-WebView page.Hands off to
design-first.References
@sentry/coregetTraceData/getTraceMetaTags