Closed ndmason1 closed 1 week ago
Assigning to @getsentry/support for routing ⏲️
Hey, so the snippet is indeed incorrect, I will fix it - it should be proper JS!
This will still complain in TS, though. I will update the example to also include a TS-compatible way!
Core or SDK?
Platform/SDK
Which part? Which one?
React SDK
Description
Context: Using latest react SDK (8.26.0 at time of writing) in a React 18 with Typescript app.
I am trying to use
Sentry.addEventProcessor
to scrub PII from URLs (specifically query params) following the example from this page. The example provided has a line that looks like:This will not work as written, because the Sentry.Event type does not have a
urls
property. I don't see a more specific type for the replay events (there is just thetype
field, but I can't use that to narrow the type if there isn't a TS type with more properties).Additionally, the code snippet on that page is tagged as javascript, but it includes a TS type annotation here:
so it isn't valid JS.
So I am (a) reporting the incorrect doc here and (b) looking for support on the proper way to do this, if it exists (or confirmation that the SDK needs an update to support this)
Suggested Solution
Suggest adding the
urls
property to the Event type definition since that was probably the intention?