Skip to content

docs(react-native): Document sentryWebViewProps for connecting WebView traces - #19659

Open
antonis wants to merge 8 commits into
masterfrom
docs/rn-webview-trace-connection
Open

antonis wants to merge 8 commits into
masterfrom
docs/rn-webview-trace-connection

Conversation

@antonis

@antonis antonis commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

⚠️ Should be merged after getsentry/sentry-react-native#6794 is released

Documents the new sentryWebViewProps helper (React Native SDK 8.32.0) for connecting React Native traces with embedded WebViews.

Updates docs/platforms/react-native/common/configuration/webview.mdx:

  • Adds a Connect Traces section: spread-onto-<WebView> usage, allowedHosts gating (host + subdomain, case-insensitive), the requirement that the web page run a Browser SDK with browserTracingIntegration, the Android onMessage requirement + spread order, entry-pageload scope, and cross-project (same-org) trace stitching.
  • Removes the outdated "the SDK doesn't interact with the mobile application's web views" statement and clarifies error ownership between the native and web SDKs.

Corresponding SDK PR: getsentry/sentry-react-native#6794

Note: please hold merge until @sentry/react-native 8.232.0 is released (the page states that as the minimum version).

IS YOUR CHANGE URGENT?

  • No deadline: Not urgent, can wait up to 1 week+ (but hold until SDK 8.29.0 ships)

PRE-MERGE CHECKLIST

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

EXTRA RESOURCES

🤖 Generated with Claude Code

…w traces

Add a "Connect Traces" section to the React Native WebView page covering the new
`sentryWebViewProps` helper (available in SDK 8.29.0): usage, `allowedHosts`
gating, the Android `onMessage` requirement, entry-pageload scope, and
cross-project trace stitching. Remove the outdated statement that the SDK doesn't
interact with web views.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-docs Ready Ready Preview Oct 16, 2026 2:41pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Preview Oct 16, 2026 2:41pm UTC

Request Review

@antonis
antonis marked this pull request as ready for review September 28, 2026 14:08
@codeowner-assignment
codeowner-assignment Bot requested a review from a team September 28, 2026 14:09
@antonis
antonis marked this pull request as draft September 29, 2026 11:50
Comment thread docs/platforms/react-native/common/configuration/webview.mdx Outdated
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ Internal Links Missing Trailing Slashes

next.config.ts sets trailingSlash: true, so these links are served a 308 redirect before the page loads.

Found 1 link(s) in files changed by this PR

Run pnpm lint:trailing-slash:fix to fix these automatically.

File Line Current Link Should Be
docs/platforms/react-native/common/configuration/webview.mdx 44 /platforms/javascript /platforms/javascript/

Each redirect hop loses ~15% of SEO link equity and adds latency for users.

Comment thread docs/platforms/react-native/common/configuration/webview.mdx Outdated
antonis and others added 2 commits October 16, 2026 16:15
- Bump the `sentryWebViewProps` availability note to 8.32.0.
- Note that the root span name (`sentry-transaction`) is stripped from
  `baggage` before injection.
- Document composing your own `injectedJavaScriptBeforeContentLoaded` by
  concatenation instead of overriding it.
- Add security guidance: an allow-listed page running untrusted JS can feed
  misleading/polluted data into the connected trace; don't allow-list pages
  that render untrusted content.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The change adds a Connect Traces section to an existing WebView guide. The plan checks page loads on that guide, inherited Expo copies of it, client errors, and MDX not-found logs. An issue escalates when those pages stop loading or when client errors or MDX not-found logs appear.

Services: sentry-docs.

Mention @change-monitor in a comment to update the plan.

Plan

What changed

Readers of the React Native WebView page now see a Connect Traces section. That section documents spreading sentryWebViewProps onto WebView to continue a native trace.

The Expo WebView page inherits this MDX and serves the same section. A production deploy of sentry-docs must finish before the copy is live. Vercel project sentry-docs ships this file. The applicationKey tag sentry-docs matches that catalog id. develop-docs does not ship docs/platforms content.

Risk

Broken MDX can 404 both WebView pages or fail the static build. New code samples can throw in the code-tab client on those pages. Sibling React Native configuration pages share the same renderer and platform tree.

Intended effect

This is a documentation edit. Connected telemetry cannot show that the new section is in the served HTML. Do not treat page load volume as proof the new copy is live. Absent has no queryable form for this change.

Regression watch

A render or compile fault on this MDX can 404 the React Native WebView page and the inherited Expo page. Watch client errors first. Then watch MDX not-found logs. Then watch page loads on those two URLs against sibling configuration volume.

Traces are sampled at 30 percent. These URLs had no pageload spans in the baseline window. Use the page load counter, not span duration.

Signal Baseline Window Rule Source
Client errors on React Native docs URLs 0 events 2026-10-14T14:49:49Z to 2026-10-16T14:49:49Z Hold at 0. Any new event is a regression. Sentry org sentry project docs. Query: transaction:*platforms/react-native/*. The WebView URL query transaction:"/platforms/react-native/configuration/webview" OR url:"*/platforms/react-native/configuration/webview*" also returned 0.
MDX not-found logs 0 logs 2026-10-14T14:49:49Z to 2026-10-16T14:49:49Z Hold at 0. This log is a runtime 404 on a static docs page. Sentry org sentry project docs logs. Query: message:"*MDX file not found at runtime*".
Page loads on /platforms/react-native/configuration/webview/ 6 loads in the last 24h. 0 loads in the prior 24h. 6 loads in the pooled 48h. Sibling React Native configuration paths excluding this URL: 62 loads in the pooled 48h. Last 24h 2026-10-15T14:49:49Z to 2026-10-16T14:49:49Z. Prior 24h 2026-10-14T14:49:49Z to 2026-10-15T14:49:49Z. Pooled 2026-10-14T14:49:49Z to 2026-10-16T14:49:49Z. A 24h count of 0 is in the 0-6 band and is not a regression alone. Treat a 48h count of 0 as a regression only when sibling configuration loads stay above 31 in the same 48h window. Sentry org sentry project docs metric docs.page.load. Query: path:"/platforms/react-native/configuration/webview/". Sibling query: path:/platforms/react-native/configuration*.
Page loads on /platforms/react-native/guides/expo/configuration/webview/ 0 loads in the last 24h. 1 load in the pooled 48h. Last 24h 2026-10-15T14:49:49Z to 2026-10-16T14:49:49Z. Pooled 2026-10-14T14:49:49Z to 2026-10-16T14:49:49Z. A 24h count of 0 is normal. Treat a 48h count of 0 as a regression only when the React Native WebView URL still records loads. That split would mean Expo inheritance broke. Sentry org sentry project docs metric docs.page.load. Query: path:"/platforms/react-native/guides/expo/configuration/webview/".

Not observable

The served HTML does not expose whether Connect Traces or sentryWebViewProps is present. Pageload p95 is not usable. The 30 percent trace sample returned 0 spans for these URLs in 2026-10-14T14:49:49Z to 2026-10-16T14:49:49Z. docs.page.not_found keeps only two path segments, so a WebView 404 cannot be split from other React Native 404s. That metric recorded 0 for platforms/react-native in the same window.

@sentry-junior

sentry-junior Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Screenshots

Rendered from the Vercel preview for this branch (docs/rn-webview-trace-connection, commit 379d1c7). The "before" shot is the same page on production (docs.sentry.io). Highlights were added for review only.

Before: old description/intro, and the "doesn't interact with web views" statement
Before

After: updated description, intro, and Application Monitoring wording
After: intro

After: new "Connect Traces" section with sentryWebViewProps usage and requirements
After: Connect Traces

After: allowedHosts warning, onMessage / injectedJavaScriptBeforeContentLoaded note, and trace scope notes
After: alerts

@getsentry getsentry deleted a comment from sentry-junior Bot Oct 16, 2026

This branch was successfully deployed

2 active (1 outdated) deployments
Preview – sentry-docs — 379d1c7d Deployed Oct 16, 2026 by vercel[bot]
Preview – develop-docs — d3912420 Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Update React Native WebView guidance for connected traces

1 participant