Press ⌘K anywhere to search

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

  1. Enable session heartbeat and auto breadcrumbs in init
  2. Set slowNetworkThresholdMs (e.g. 3000) for automatic slow-fetch warnings
  3. Log offline.queued when you intentionally defer work
  4. 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

  1. Warn-level slow-fetch events sit next to the user’s screen trail
  2. Offline events arrive after reconnect — compare timestamps to the session
  3. Alert when api.slow rises after a backend deploy

Related

Offline behavior · Init options · Alerts

Last updated · TraceRN docs