feat(browser): Add View Hierarchy integration (#14981)
By default it captures the entire DOM, but it is configurable:
Capture only React components (uses attributes added by Sentry bundler
plugins):
```ts
import * as Sentry from '@sentry/browser';
Sentry.init({
dsn: '__DSN__',
integrations: [Sentry.viewHierarchyIntegration({
onElement: ({componentName}) => componentName ? {} : 'children'
})],
});
```
Capture only Web Components:
```ts
import * as Sentry from '@sentry/browser';
Sentry.init({
dsn: '__DSN__',
integrations: [Sentry.viewHierarchyIntegration({
onElement: ({tagName}) => tagName.includes('-') ? {} : 'children'
})],
});
``` T
Tim Fish committed
efaf6cf3b5acbe2443ba7b97a72ef3373eaed390
Parent: 34869c7
Committed by GitHub <noreply@github.com>
on 4/13/2026, 7:52:24 PM