Slow or offline
Handle slow APIs and offline React Native apps with session heartbeats, slow-fetch warnings, and offline queue
On the subway the app “works” — then syncs a burst of events later. On Wi‑Fi, checkout feels stuck because /pay takes 4s. Neither is a crash; both hurt conversion.
What to instrument
- Enable session heartbeat and auto breadcrumbs in init
- Set
slowNetworkThresholdMs(e.g.3000) for automatic slow-fetch warnings - Log
offline.queuedwhen you intentionally defer work - Rely on SDK offline behavior so events are not lost
javascript
TraceRN.init({
apiKey: "trn_live_xxxxxxxx",
release: "1.4.2",
environment: "production",
enableAutoBreadcrumbs: true,
enableNetworkBreadcrumbs: true,
enableSessionHeartbeat: true,
slowNetworkThresholdMs: 3000,
});
// When your app detects offline and queues a mutation:
TraceRN.warn("offline.queued", { action: "profile.update", screen: "Profile" });What you see in TraceRN
- Warn-level slow-fetch events sit next to the user’s screen trail
- Offline events arrive after reconnect — compare timestamps to the session
- Alert when
api.slowrises after a backend deploy
Related
Last updated · TraceRN docs