lucent_flutter. The MVP
supports iOS and Android. Flutter Web is deferred because Flutter Web needs a
separate web capture path, while this SDK sends screenshot-mode mobile replay.
Requirements
- Flutter
>=3.27.0 - Dart
>=3.6.0 - iOS
13.0or later - Android min SDK
23or later - A Lucent public key (
luc_pk_...)
Install
lucent_flutter is not published on pub.dev yet. Until 0.1.0 is published,
install it from the Lucent monorepo or from a local SDK checkout.
android/app/src/main/AndroidManifest.xml.
CocoaPods is the verified iOS packaging path for the MVP. Swift Package
Manager support is deferred because Flutter can generate a package identity
from the local SDK directory that differs from the pub package name.
Quick start
Set up Lucent beforerunApp, then wrap your app in LucentWidget.
LucentWidget captures screenshot-mode replay, touch events, and app lifecycle
events. Keep it near the root of the app so remounts do not reset the replay
surface.
Screen tracking
AddLucentObserver() to your MaterialApp navigator observers to emit
$screen events and update the replay URL.
PageRoutes, call Lucent().screen(...)
from your route listener.
Identify users
Sessions start with a generated anonymous ID. Callidentify when you know the
user, and call resetIdentity on sign out.
Track events
Usetrack for custom events. Event properties also receive metadata from
LucentMetadataConfig.
Control recording
Replay starts automatically by default when the session is sampled in. You can pause, resume, flush, and inspect the current session.Lucent().stop() when you need to tear down the SDK. It stops native
recording, clears installed Dart hooks, and performs a final native flush.
Use autoStart: false or LucentReplayConfig.eventTriggers when you need to
wait for consent or only record after specific events.
Privacy masking
Flutter replay is privacy-first. Text, text inputs, and images are masked by default. Wrap extra-sensitive regions inLucentMask, and wrap safe public
regions in LucentNoMask.
LucentNoMask opts the subtree into replay visibility, so only use it for UI
that is safe to show in a session replay.
Logs
Whencapture.logs is enabled, Lucent captures Flutter debugPrint output.
Wrapping runApp in Lucent().runZoned(...) also captures print(...).
Network breadcrumbs
Whencapture.network is enabled, Lucent().runZoned(...) installs a
zone-scoped dart:io HttpClient wrapper. It captures method, sanitized URL,
status, duration, and transfer size for requests made inside the zone.
dart:io, call captureNetworkRequest from your
HTTP wrapper or interceptor.
Errors and crashes
Lucent captures Flutter framework errors andPlatformDispatcher async errors
when the corresponding capture options are enabled. Use captureException for
handled exceptions and addExceptionStep for lightweight breadcrumbs.
$native_crash on the next launch.
If your app already has a top-level async error handler, pass it to
runZoned.
Example app
The SDK package includes an example app that exercises setup,LucentWidget,
LucentObserver, masking, custom events, manual network breadcrumbs, handled
exceptions, and flush.
Next steps
- Flutter support reference - options, replay envelope, persistence, limitations, and troubleshooting.
- Replay endpoint - ingest payload schema.