rejourney 0.4.1 copy "rejourney: ^0.4.1" to clipboard
rejourney: ^0.4.1 copied to clipboard

Privacy-first Flutter session replay for iOS and Android with masking, crash and ANR reporting, network timing, and product analytics.

Rejourney for Flutter #

pub package Flutter platforms license: Apache-2.0

Privacy-first session replay, mobile observability, crash reporting, and product analytics for Flutter applications on iOS and Android.

Requirements #

  • Flutter 3.22 or newer
  • Dart 3.3 or newer
  • iOS 15.1 or newer
  • Android API 24 or newer

Installation #

dependencies:
  rejourney: ^0.4.1

Then install packages:

flutter pub get

Quick start #

Initialize the SDK once and start recording only after any consent your product requires:

import 'package:flutter/widgets.dart';
import 'package:rejourney/rejourney.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Rejourney.init('rj_your_public_key');
  await Rejourney.start();
  runApp(const App());
}

init configures the SDK but does not record. start begins a native session, fetches project recording settings, and respects sampling and the remote kill switch. Call stop when the user revokes consent or explicitly signs out of an instrumented experience.

Pause and resume (Beta, Flutter 0.4.1+) #

Pause Rejourney around a foreground camera, AR, or graphics-heavy route without ending the current session:

final paused = await Rejourney.pause();
// Present the high-cost experience.
final resumed = await Rejourney.resume();

Both calls are idempotent. Pause flushes pending work, emits sdk_paused, and stops screenshots, hierarchy and interaction capture, live hang sampling, network instrumentation, and ordinary Dart/native telemetry intake. Resume continues the same foreground session and emits sdk_resumed with the matching pauseId and gapDurationMs, making the gap explicit in replay.

Fatal-process hooks remain installed during a pause so crashes can still be recovered without periodic capture work. A background interval longer than the intentional 60-second boundary still creates a replacement session, which stays paused until resume. Resume returns false while backgrounded. This Beta API requires 0.4.1 or newer and needs no Android manifest or iOS Info.plist changes.

Route tracking #

Use RejourneyNavigatorObserver with MaterialApp, CupertinoApp, or a root Navigator:

final rejourneyObserver = RejourneyNavigatorObserver();

MaterialApp(
  navigatorObservers: <NavigatorObserver>[rejourneyObserver],
  routes: <String, WidgetBuilder>{
    '/': (_) => const HomeScreen(),
    '/checkout': (_) => const CheckoutScreen(),
  },
);

For Router-based packages, call Rejourney.trackScreen('checkout') from the router's navigation callback or provide your own NavigatorObserver integration.

Privacy masking #

Wrap sensitive Flutter content with RejourneyMask. The widget remains unchanged for the user; only its captured region is covered in replay frames.

RejourneyMask(
  child: TextField(
    obscureText: true,
    decoration: const InputDecoration(labelText: 'Card number'),
  ),
)

Native secure text fields are masked by default. Project-level text and media privacy settings are also applied by the native capture pipeline.

Identity, events, and metadata #

await Rejourney.setUserIdentity('user_abc123');
await Rejourney.logEvent('purchase_completed', <String, Object?>{
  'transactionId': 'order_123',
  'amount': 29.99,
  'currency': 'USD',
});
await Rejourney.setMetadata(<String, Object?>{
  'plan': 'pro',
  'checkoutVariant': 'v2',
});

// On logout:
await Rejourney.clearUserIdentity();

Use stable snake_case event names and internal user IDs rather than raw personal information.

Flutter and Dart errors #

Install framework and platform-dispatcher handlers before runApp:

RejourneyErrorCapture.install();

runApp(const App());

The installed Flutter and platform-dispatcher handlers capture framework and uncaught root-isolate errors without moving runApp into a different Dart zone. Keep the returned handle only when you intentionally need to restore previous handlers later. If your application uses runZonedGuarded, initialize Flutter bindings and call runApp inside that same zone. The native SDK also captures supported iOS crashes and Android crashes/ANRs when enabled.

HTTP instrumentation #

RejourneyHttpClient is a drop-in package:http client that records method, sanitized URL, status, timing, content type, and payload sizes. It never records request or response bodies.

final client = RejourneyHttpClient();
final response = await client.get(Uri.parse('https://api.example.com/items'));
client.close();

SDK ingestion endpoints are ignored automatically. Add product-specific patterns through networkIgnoreUrls or disable this integration with autoTrackNetwork: false.

Android GPU rendering compatibility #

Rejourney automatically detects the Android renderer/device combination where PixelCopy reports success for a Flutter SurfaceView but returns a black frame, including a black Flutter layer with a small native toast on top. The SDK then captures Flutter's retained layer tree at reduced replay resolution. It leaves the application's live FlutterSurfaceView untouched and does not require a host render-mode setting.

Rejourney.getSdkMetrics() exposes the active source and fallback timing through lastCaptureSource, flutterBlackFrameFallbackCount, flutterRendererCaptureCount, and the retained-layer readback duration fields.

Configuration #

await Rejourney.init(
  'rj_your_public_key',
  config: const RejourneyConfig(
    captureQuality: RejourneyCaptureQuality.medium,
    detectRageTaps: true,
    captureCrashes: true,
    captureAnrs: true,
    networkIgnoreUrls: <String>['/health', 'analytics.example.com'],
    disableInDevelopment: true,
  ),
);

Important options include enabled, observeOnly, captureFps, maxSessionDuration, stopTimeout, captureScreen, captureAnalytics, captureCrashes, captureAnrs, wifiOnly, captureQuality, trackConsoleLogs, autoTrackNetwork, and the privacy/device collection controls. stopTimeout defaults to 10 seconds; native teardown and best-effort persistence continue if an offline flush exceeds that deadline. Dashboard recording settings may further restrict local capture settings.

With collectDeviceInfo enabled, the plugin also sends coarse, permissionless battery, thermal, memory-pressure/headroom, UI environment, orientation, and display-refresh context. It uses lifecycle reads and OS callbacks only (no polling), needs no Android manifest permission or iOS usage-description key, and is omitted when collectDeviceInfo is disabled.

Additional API #

  • Rejourney.getSessionId() returns the active session identifier.
  • Rejourney.pause() and Rejourney.resume() control the Beta in-session capture gap.
  • Rejourney.trackScreen() records a screen manually.
  • Rejourney.markVisualChange() requests an immediate capture when allowed.
  • Rejourney.onScroll() supplies scroll activity to adaptive capture.
  • Rejourney.onOAuthStarted(), onOAuthCompleted(), and onExternalUrlOpened() preserve capture boundaries around external experiences.
  • Rejourney.logFeedback() adds user feedback to the session timeline.
  • Rejourney.getSdkMetrics() returns upload, retry, queue, memory, and session health counters.
  • Rejourney.nativeEvents reports native lifecycle events such as session rollover where supported.
  • Rejourney.debugCrash() and debugTriggerAnr() are debug-only validation helpers and intentionally terminate or block the app.

Example and documentation #

The package includes a runnable application in example/. The complete integration guide is available at rejourney.co/docs/flutter/overview.

License #

The Flutter API, platform bridges, native core, examples, and documentation are licensed under the Apache License 2.0. See LICENSE, LICENSE-APACHE, and THIRD_PARTY_NOTICES.md.

1
likes
150
points
214
downloads
screenshot

Documentation

Documentation
API reference

Publisher

verified publisherrejourney.co

Weekly Downloads

Privacy-first Flutter session replay for iOS and Android with masking, crash and ANR reporting, network timing, and product analytics.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#session-replay #observability #analytics #crash-reporting #monitoring

License

unknown (license)

Dependencies

flutter, http, plugin_platform_interface

More

Packages that depend on rejourney

Packages that implement rejourney