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
- 1App launches → Recording starts automatically
- 2App goes to background → Recording pauses, session saves
- 3App returns to foreground → New session starts
- 4Session uploads in background when WiFi available
Manual Control
For more control, configure session replay and manage recording manually:
import PipeKit// Configure session replay at launchPipeKit.configure(apiKey: "your_key",config: PipeKitConfig(enableSessionReplay: true))// Start recording when readyPipeKit.startSession()// Stop recordingPipeKit.stopSession()// Check if currently recordingif 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.
import PipeKitvar video = SessionReplayConfig()video.captureFrameRate = 2 // frames per secondvideo.captureTouches = true // record tap locationsvideo.maskSensitiveViews = true // mask views marked sensitivevideo.autoMaskViewClasses = ["MyCardView"]PipeKit.configure(apiKey: "your_key",config: PipeKitConfig(videoConfig: video))
Conditional Recording
Record only specific user flows or conditions:
import UIKitimport PipeKit// Record only specific screensclass 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 consentfunc userDidConsentToRecording() {PipeKit.startSession()}// Record only for specific user segmentsif user.isBetaTester {PipeKit.startSession()}
Custom Events & Markers
Add custom log entries to mark important moments in your sessions:
import PipeKit// Log a messagePipeKit.log("purchase_completed")// Log a warningPipeKit.warning("Low memory detected")// Log an errorPipeKit.error("Payment processing failed")
Managing Saved Sessions
Inspect sessions that are saved locally on the device, and delete ones you no longer need:
import PipeKit// List sessions saved on the devicelet sessions = PipeKit.getSavedSessions()print("\(sessions.count) sessions pending upload")// Delete a session you no longer needif let session = sessions.first {PipeKit.deleteSession(session)}
Upload Control
Sessions are uploaded automatically, but you can also trigger manual uploads:
import PipeKit// Upload a specific saved session immediatelyif let session = PipeKit.getSavedSessions().first {PipeKit.uploadSession(sessionId: session.id) { result inswitch 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 →