Skip to content

Latest commit

 

History

History
64 lines (53 loc) · 2.32 KB

README.md

File metadata and controls

64 lines (53 loc) · 2.32 KB


AmplitudeSessionReplay-Android

Integrations

AmplitudeSessionReplay integrates via plugin to your core analytics library.

Instructions

Depending on the analytics library you use, you can use one of the following integrations to capture session replays.

Amplidue-Kotlin SDK

  1. Install the dependencies
implementation("com.amplitude:plugin-session-replay-android:[0.11.1, 1.0.0]")
implementation("com.amplitude:analytics-android:[1.16.8, 2.0.0]")
  1. Initialize the SDK
// Initialize Amplitude Analytics SDK instance
val amplitude = Amplitude(Configuration(
    apiKey = API_KEY,
    context = applicationContext,
    defaultTracking = DefaultTrackingOptions(sessions = true),
))
 
// Create and Install Session Replay Plugin
// Recording will be handled automatically
val sessionReplayPlugin = SessionReplayPlugin(sampleRate = 1.0)
amplitude.add(sessionReplayPlugin)

Developer docs

Ampitude-Android SDK (Legacy SDK)

  1. Install the dependencies
implementation("com.amplitude:middleware-session-replay-android:[0.11.1, 1.0.0]")
implementation("com.amplitude:android-sdk:[2.40.1,3.0.0]")
  1. Initialize the SDK
val amplitude = Amplitude.getInstance()
    .initialize(this, AMPLITUDE_API_KEY)
    // Replay events will be flushed on close as well
    // If setFlushEventsOnClose(false) you must call flush() manually
    .setFlushEventsOnClose(true)
 
// Create Session Replay Middleware
val sessionReplayMiddleware = SessionReplayMiddleware(amplitude, sampleRate = 1.0)
 
// Add session replay middleware
// Recording will be handled automatically
amplitude.addEventMiddleware(sessionReplayMiddleware)

Developer docs

Need Help?

If you have any issues using our SDK, feel free to create a GitHub issue or submit a request on Amplitude Help.