# Native crash reports from the Expo app reach a locked-down tracker

The Worker serves /api/<project id>/envelope/ as the app's DSN host, so crashes, app hangs and ANRs reach the tracker behind the ingest key again.

- **The Worker as the app's DSN host.** The native SDKs (sentry-cocoa, sentry-android) ignore `tunnel` and post to the DSN's host, so with the locked-down tracker the app lost its native crashes, app hangs and ANRs. `POST /api/<project id>/envelope/` on the Worker now relays them: it accepts only the project ids in the new `ERROR_REPORTING_RELAY_DSNS` (the app's real DSNs, one per id), requires that DSN's public key, caps bodies at 256 KB on the wire and at the locked tracker's 1,000,000 bytes unpacked, counts each envelope in the tunnel's database limit (one budget of 30 a minute per sender for both routes), scrubs every event and forwards it to the real DSN with the ingest header, never following a redirect. It works the same on Workers and on the Node build. See [error reporting](/docs/architecture/observability#error-reporting). ([2b9d5b2](https://github.com/CarlosZiegler/template-cloudflare/commit/2b9d5b29f94c117df2a5c423291e641d1dd9bb83), [e3d299c](https://github.com/CarlosZiegler/template-cloudflare/commit/e3d299c2c541015cb31ba3253d3b4a79fee5c38b), [9ed835f](https://github.com/CarlosZiegler/template-cloudflare/commit/9ed835f2652c795432d325a5445677877d362094), [4662115](https://github.com/CarlosZiegler/template-cloudflare/commit/4662115a6271b87e28f52f45ebad35ce393d712b))
- **Native events are scrubbed on the server.** Crash reports never run the app's `beforeSend`, so the relay passes every event through `scrubEvent` before forwarding: the user is reduced to its id, e-mail addresses and tokens are removed from texts and from the message objects the native SDKs send, and native HTTP breadcrumbs lose their query and fragment (`http.query`, `http.fragment`). The e-mail pattern now runs in linear time, since the relay scrubs text a sender chose. ([e3d299c](https://github.com/CarlosZiegler/template-cloudflare/commit/e3d299c2c541015cb31ba3253d3b4a79fee5c38b), [1c85653](https://github.com/CarlosZiegler/template-cloudflare/commit/1c85653f7b1a597b1ba1c7d3dbd0e708488a5256))
- **The app's public DSN names your server.** Set `EXPO_PUBLIC_ERROR_REPORTING_DSN` to the app project's DSN with the host of `EXPO_PUBLIC_SERVER_URL` (`https://<key>@app.example.com/3`) and put the real DSN in `ERROR_REPORTING_RELAY_DSNS`. The app then starts with the native SDKs on. A DSN on the tracker keeps the tunnel and JS-only reporting. A local run proved a JS error and a SIGSEGV crash from the iOS simulator through the relay into Rustrak behind the `locked` Caddy profile. ([3c2e541](https://github.com/CarlosZiegler/template-cloudflare/commit/3c2e541b516ff3e530fda25765565b54214928d8), [035142a](https://github.com/CarlosZiegler/template-cloudflare/commit/035142aa1bc4594cc1b82ca62564f00e43891870))
