React Native replay is screenshot based. It does not use rrweb DOM or
wireframe recording because React Native has no browser DOM.
Setup difficulty
| App type | Difficulty | What to expect |
|---|---|---|
| Bare React Native | Easy | Install the package, run pods for iOS, and rebuild the app. |
| Expo with dev-client or EAS | Easy | Install the package, generate or rebuild the native app, and run a development or production build. |
| Expo Go-only | Medium | Expo Go cannot load Lucent’s custom native modules. Move to a development build, EAS build, or prebuilt native project for full replay. |
Install
- Expo
- Bare React Native
Requirements
- React 18 or newer.
- React Native 0.71 or newer.
- A Lucent public key from Settings -> SDK keys in the dashboard.
- A native build environment for the platforms you ship.
- Expo development builds, EAS builds, or prebuilt native projects for Expo apps.
Quickstart
Wrap your app withLucentProvider near the root of the React tree.
options={{ autoStart: false }} if you need to wait for consent, then call
lucent.start() when recording can begin.
Replay model
Every React Native replay batch is sent as mobile screenshot replay:snapshotMode is not configurable in the React Native package. Browser sessions
use rrweb DOM events; React Native sessions use native iOS and Android modules
to capture screenshots, touch events, screen names, logs, network telemetry,
and crashes when enabled.
API
The main API mirrors the browser SDK where the platform allows it.Provider and identity
Creates one Lucent client for your app. Pass
publicKey, optional options,
optional autocapture, and your app tree as children.Syncs identity with Lucent. React Native uses
id, email, name, and
properties.Returns the Lucent client from the nearest provider. It must run inside
LucentProvider.Shared tracking methods
React Native methods
Sets the native replay screen name and emits a
$screen event.Resumes screenshot replay capture.
resumeCurrent defaults to true.Pauses screenshot replay capture without clearing identity.
Returns the current
sessionId, windowId, and recordingEnabled state.
In Expo Go fallback mode this returns null.Screen tracking
Track screen changes directly from a screen component:useLucentNavigationTracking. Lucent does
not add a navigation peer dependency.
Processing controls
Processing controls decide which mobile sessions are recorded, processed, and analyzed. Filters and sampling usually control whether a session is analyzed, not whether the app can send events at all. React Native replay batches can still be accepted by Lucent even when a session later does not match your processing rules.Required URL and screen filters
Lucent Required URL filters are fail-closed. If your source has Required URL patterns, Lucent evaluates them before full AI analysis:- Sessions with matching URL or screen evidence are processed.
- Sessions without matching evidence are skipped from analysis as
required_url_missing. - Skipped sessions may still exist as ingested SDK replay data, depending on the product surface and session status.
lucent-react-native scheme so URL filters can match mobile screens the same
way they match web paths.
Use path-style screen names when you want mobile sessions to match path-style
filters. For example, a Required URL filter of /onboarding works reliably
when the app records /onboarding as screen evidence.
| Lucent filter | Recommended SDK call | Notes |
|---|---|---|
Required URL /onboarding | useLucentScreen("/onboarding") | Best for a screen component. |
Required URL /checkout/review | lucent.screen("/checkout/review", { step: "payment" }) | Best from a router listener or custom navigation handler. |
Required URL /onboarding | Avoid relying on lucent.screen("Onboarding") | Onboarding is a human screen label, not a URL path. It may not match /onboarding. |
"Onboarding" are fine for analytics, but do not rely on
them when the Lucent filter is path-like, such as /onboarding.
For React Navigation, matching is strongest when the route evidence is
path-like. Prefer route paths such as /onboarding or /checkout/review over
display names such as Onboarding.
Excluded URL and domain filters
Excluded URL and domain filters skip sessions only when Lucent observes screen or URL evidence that matches the excluded patterns. The same React Native path caveat applies: use path-style screen names if you expect path-style filters to match mobile sessions.User, email, and anonymous-user controls
User, email, and domain filters depend on identity metadata. Identify users as soon as the app knows who they are, ideally before the important flow begins. Anonymous sessions may not match user, email, or email-domain filters.identify as soon as the user is known so
their mobile session is eligible for user-aware filters and processing rules.
Property filters
User and session properties are filterable metadata where configured. Set them before important flows so the properties are present when Lucent evaluates the session.Sampling, event triggers, and minimum duration
You should not expect every mobile app launch to produce an analyzed session. Local SDK sampling and remote-config sampling can prevent a session from being recorded or processed.replay.minimumDurationMs. If you are testing with tiny sessions, keep the app
open long enough to exceed your minimum duration and allow a flush.
Privacy masking
Lucent masks sensitive mobile content before screenshots leave the device. Input fields, images, and sandboxed system views are masked by default.Capture toggles
Lucent can capture console logs, network telemetry, app lifecycle events, JavaScript errors, unhandled promise rejections, and native crashes. Disable individual capture types when they do not fit your privacy or telemetry policy.Offline and batching behavior
Mobile sessions are batched and flushed periodically. If the app is offline or backgrounded, events may be queued and flushed later. Do not expect every mobile session to appear instantly in the dashboard.Source maps and release metadata
Set release metadata and upload source maps for readable React Native JavaScript stack traces. For Expo and EAS builds, configure the optional Expo plugin, Metro helper, and build environment variables described in Expo source-map tooling.Autocapture and errors
Enable touch autocapture by passingautocapture. Lucent wraps your app in a
responder-capture view and emits $touch events alongside replay screenshots.
$native_crash on the next launch.
Configuration
Optional Expo and Metro tooling
No Expo config plugin is required for replay capture. The native module autolinks during React Native linking or Expo prebuild/dev-client/EAS native project generation. Use the optional Expo config plugin and Metro helper only when you want Lucent production source-map metadata and upload hooks.Troubleshooting
I only see Expo Go fallback or no sessions
I only see Expo Go fallback or no sessions
Expo Go cannot load Lucent’s native module. Use an Expo development build,
EAS build, or prebuilt native project via
npx expo run:ios or
npx expo run:android. In Expo Go, provider/hooks/API calls are safe, but
getSessionInfo() returns null and no native replay batches are sent.Native module not linked
Native module not linked
Rebuild the native app after installing the package. For Expo, run
npx expo prebuild and then npx expo run:ios, npx expo run:android,
or an EAS build. For bare React Native, run npx pod-install for iOS and
rebuild both native targets.iOS pods or CocoaPods fail
iOS pods or CocoaPods fail
Run
npx pod-install from the app root. If pods are stale, delete
ios/Pods and ios/Podfile.lock, then run npx pod-install again. Make
sure Xcode command-line tools and CocoaPods are installed before rebuilding.Android SDK, Gradle, or JDK is missing
Android SDK, Gradle, or JDK is missing
Install Android Studio command-line tools, a JDK supported by your React
Native version, and Gradle or the app’s
android/gradlew wrapper. Set
ANDROID_HOME or ANDROID_SDK_ROOT if your SDK is not in the default
location.No replay batches are arriving
No replay batches are arriving
Confirm you are running a native build, not Expo Go. Check that the public
key starts with
luc_pk_, ingestBaseUrl is reachable, and
sampling.sessionReplay is greater than 0. If you configured
replay.eventTriggers, replay waits until one of those events is tracked.
If you configured replay.minimumDurationMs, very short sessions may be
dropped.My session ingested but was skipped from analysis
My session ingested but was skipped from analysis
Check whether your source has Required URL filters. Required URL filtering
applies to processing eligibility, not ingestion. If the filter is
/onboarding, use path-style screen evidence such as
useLucentScreen("/onboarding") instead of relying on a display label such
as Onboarding.Verifying events with track()
Verifying events with track()
Add a temporary button that calls
lucent.track("lucent_mobile_test"),
interact with the app in a native build, then open Sessions in the
Lucent dashboard. Call await lucent.getSessionInfo() from inside the app
to confirm the SDK has an active session.Next steps
Expo setup
Configure Lucent in Expo development builds, EAS builds, and prebuilt apps.
Session replay integrations
See how Lucent handles web, mobile, screenshot, and wireframe replay data.