SDK Overview
Both the React Native and Flutter SDKs work the same way under the hood. This page covers the shared concepts; see the React Native or Flutter page for install steps and API specifics.
Two kinds of capture
The SDK does two independent things, and it’s worth keeping them separate in your head:
Fatal crash capture is always on once you call init / initCrashReporting — native crashes (signals, uncaught exceptions) on iOS and Android, plus uncaught Dart/JS errors. This isn’t for routine logging; most apps already run something like Crashlytics for that.
On-demand debug recording only runs between an explicit start and stop, and it’s tied to one specific Logtryl ticket. This is the one testers trigger deliberately while reproducing a bug — see “Starting and stopping a recording” below.
Getting your project key
Every project in Logtryl has its own key, generated automatically when the project is created. It’s what you pass to initCrashReporting / LogtrylCrash.init to tie the SDK install to that project — fatal crash capture won’t work without it.
- In the Dashboard (or the Desktop app), open the project and go to its Edit page.
- Scroll down to the Project Key field and use the copy button next to it.
What a recording captures
- Console output — whatever the app logs while the recording is active.
- Network requests — method, URL, headers, and bodies for both request and response. Common sensitive headers (
Authorization,Cookie,X-Api-Key, ...) and body keys (password,token,secret, ...) are redacted automatically before anything is buffered. - Exceptions — anything the SDK catches automatically (a fatal error that happens mid-recording), plus anything you flag yourself with
recordHandledErrorfrom your own try/catch.
Nothing is captured before a recording starts or after it stops — this is deliberately not always-on monitoring.
Pairing a device
Before a device can capture anything, it needs to be paired to a Logtryl project once. In the Logtryl app, open Settings → Pair a Device to get a short code, then enter that code on the device running your app (via the SDK’s built-in pairing drawer, or your own UI calling pairDevice(code)). Pairing persists across app restarts — it’s a one-time step per device, not per recording.
Starting and stopping a recording
A recording is controlled from the Logtryl app, not from your code — the SDK just watches for one to start:
- In the Logtryl app, open Create Ticket, pick the project, and tap SDK Debug Recording. Logtryl tries to auto-launch the paired target app for you.
- The button turns into a Recording… stop control. On the device, the SDK notices (it polls every ~5 seconds while paired) and starts capturing.
- Reproduce the bug in your app.
- Switch back to the Logtryl app and tap Recording… again to stop — there’s no timer or auto-stop for debug recordings. Tapping Create Ticket while still recording prompts you to stop and include it, or keep recording.
- Once the ticket is saved, the finished recording is linked to it automatically — everything captured shows up under that ticket’s errors/logs.
If the app crashes during a recording
Next steps
See the React Native SDK or Flutter SDK page for install steps and API details.
