react-native-logtryl-crash
v0.1.0
Published
Logtryl crash-reporting SDK for React Native and Expo (native crash/signal capture, no caught-exception logging).
Maintainers
Readme
react-native-logtryl-crash
Crash reporting and on-demand bug-recording SDK for React Native and Expo apps, made by Logtryl.
This package is free and open source (MIT) — it's a thin client for the Logtryl platform. It needs a Logtryl project and API key to actually do anything useful; sign up at logtryl.com to get one.
Full setup guide, API reference, and platform-specific notes live in the SDK docs on logtryl.com — this README only covers the basics.
What it does
- Fatal crash capture — native crashes (signals, uncaught exceptions) on iOS and Android, plus uncaught JS errors, captured automatically once initialized. Not for routine logging; most apps already run something like Crashlytics for that.
- On-demand debug recording — a tester or developer starts a recording from the Logtryl app, reproduces a bug in yours, and everything captured (console output, network requests, exceptions) attaches to that ticket automatically.
- Manual error reporting —
recordHandledError()lets you flag a caught exception as worth including in the active recording, even though it didn't crash the app.
Install
yarn add react-native-logtryl-crash react-native-nitro-modules @react-native-async-storage/async-storage
cd ios && pod installExpo (managed): the package ships a config plugin — add it to app.json/app.config.js:
{ "expo": { "plugins": ["react-native-logtryl-crash"] } }Quick start
import { initCrashReporting } from 'react-native-logtryl-crash';
initCrashReporting('YOUR_APP_KEY');Call this once, as early as possible — e.g. the top of your root component.
Pairing a device for debug recording
Testers pair their device to a Logtryl project once (via a short code shown in the Logtryl app), then recordings started from Logtryl automatically capture on their device. The easiest way in is the built-in PairingDrawer component — a swipe-out drawer with a code-entry UI:
import { PairingDrawer } from 'react-native-logtryl-crash';
<PairingDrawer edge="right" />;Or drive it yourself with pairDevice(code) / isPaired() / unpairDevice().
Recording a handled exception manually
import { recordHandledError } from 'react-native-logtryl-crash';
try {
// ...
} catch (err) {
recordHandledError(err);
}This only does anything while a debug recording is active — it's not general-purpose logging.
If the app crashes during a recording
If a crash happens while a recording is active, the target app needs to be restarted before the crash shows up in Logtryl — it's captured on-device at the moment of the crash, but only synced up on the next app launch, not live. If a tester's app just crashed, ask them to reopen it once before checking the ticket.
License
MIT — see LICENSE.
