Platform

Recording Sessions

Control when and how sessions are recorded in your app. Use the iOS / Android toggle on any code sample to switch languages.

Automatic Recording

By default, PipeKit starts recording automatically when your app launches (when enableSessionReplay is set in config). Recording continues until the app goes to background or you manually stop it.

Session Lifecycle

  1. 1App launches → Recording starts automatically
  2. 2App goes to background → Recording pauses, session saves
  3. 3App returns to foreground → New session starts
  4. 4Session uploads in background when WiFi available

Manual Control

For more control, configure session replay and manage recording manually:

ManualRecording.swift
import PipeKit
// Configure session replay at launch
PipeKit.configure(
apiKey: "your_key",
config: PipeKitConfig(enableSessionReplay: true)
)
// Start recording when ready
PipeKit.startSession()
// Stop recording
PipeKit.stopSession()
// Check if currently recording
if PipeKit.isRecording {
print("Recording in progress...")
}

Replay Configuration

Tune what gets captured by passing a SessionReplayConfig as the videoConfig of your PipeKitConfig. Control the capture frame rate, whether touches are captured, and how sensitive views are masked.

ReplayConfig.swift
import PipeKit
var video = SessionReplayConfig()
video.captureFrameRate = 2 // frames per second
video.captureTouches = true // record tap locations
video.maskSensitiveViews = true // mask views marked sensitive
video.autoMaskViewClasses = ["MyCardView"]
PipeKit.configure(
apiKey: "your_key",
config: PipeKitConfig(videoConfig: video)
)

Conditional Recording

Record only specific user flows or conditions:

ConditionalRecording.swift
import UIKit
import PipeKit
// Record only specific screens
class CheckoutViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
PipeKit.trackScreen("Checkout")
PipeKit.startSession()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
PipeKit.stopSession()
}
}
// Record based on user consent
func userDidConsentToRecording() {
PipeKit.startSession()
}
// Record only for specific user segments
if user.isBetaTester {
PipeKit.startSession()
}

Custom Events & Markers

Add custom log entries to mark important moments in your sessions:

Markers.swift
import PipeKit
// Log a message
PipeKit.log("purchase_completed")
// Log a warning
PipeKit.warning("Low memory detected")
// Log an error
PipeKit.error("Payment processing failed")

Managing Saved Sessions

Inspect sessions that are saved locally on the device, and delete ones you no longer need:

SavedSessions.swift
import PipeKit
// List sessions saved on the device
let sessions = PipeKit.getSavedSessions()
print("\(sessions.count) sessions pending upload")
// Delete a session you no longer need
if let session = sessions.first {
PipeKit.deleteSession(session)
}

Upload Control

Sessions are uploaded automatically, but you can also trigger manual uploads:

UploadControl.swift
import PipeKit
// Upload a specific saved session immediately
if let session = PipeKit.getSavedSessions().first {
PipeKit.uploadSession(sessionId: session.id) { result in
switch result {
case .success(let response):
print("Session uploaded: \(response.sessionId)")
case .failure(let error):
print("Upload failed: \(error)")
}
}
}

Upload Timing

Sessions are automatically uploaded when the app goes to background or when you callstopSession(). Manual upload is useful for ensuring critical sessions are saved immediately.

Next: User Identification

Learn how to link sessions to your users for easier debugging.

Continue to User Identification →