Purpose
The only place that imports Sentry's SDKs (pnpm lint enforces it). It configures @sentry/cloudflare and @sentry/browser (v11, restricted dataCollection) and @sentry/react-native (v10 through its pinned core, sendDefaultPii: false), passes every event and breadcrumb through scrub.ts, and sends errors only. Each runtime is off until its DSN is set. How it is wired into the apps and the tracker: error reporting.
Public exports
| Subpath | Target |
|---|---|
./scrub | ./src/scrub.ts |
./early | ./src/early.ts |
./browser | ./src/browser.ts |
./browser-sdk | ./src/browser-sentry.ts |
./worker | ./src/worker.ts |
./tunnel | ./src/tunnel.ts |
./native | ./src/native.ts |
These paths come from packages/error-reporting/package.json. scrub and early are LEAF modules (no imports). browser-sdk is the lazily imported SDK chunk: import it only with import() after hydration. worker and tunnel are server-only (client boundary lint). native imports the app's own @sentry/react-native.
How to extend
Add a project's private keys (health data first) to PROJECT_SENSITIVE_KEYS in scrub.ts; they are removed at any depth of every event, breadcrumb, tag and context. Turn on another kind of data (tracing, sessions, replays) only in this package, with a test that the envelope still carries no personal data, and measure the bundle again.