Privacy & Masking
Protect sensitive user data and ensure compliance with privacy regulations.
Privacy by Default
PipeKit automatically masks common sensitive inputs like password fields and secure text entries. No configuration needed for basic privacy protection —maskSensitiveViews is enabled by default on both iOS and Android.
Automatic Masking
These elements are automatically masked (replaced with ●●●●) in recordings:
with isSecureTextEntry = true
Any field with textContentType = .password
Fields with textContentType = .creditCardNumber
Fields with textContentType = .oneTimeCode
Manual Masking
Mark additional views as sensitive to mask them in recordings:
On UIKit, call markAsSensitive() on anyUIView. In SwiftUI, apply the.sensitiveContent() modifier.
import UIKitimport SwiftUIimport PipeKit// UIKit — mask a specific viewlet sensitiveView = UIView()sensitiveView.markAsSensitive()// UIKit — mask a label showing private datamySecretLabel.markAsSensitive()// SwiftUI — mask with the .sensitiveContent() modifierstruct ProfileView: View {let user: Uservar body: some View {VStack {SecureField("Password", text: $password).sensitiveContent()Text(user.ssn).sensitiveContent() // This text will be masked}}}
Mask by Class
Auto-mask every instance of a view class by listing its class name in autoMaskViewClasses on the SessionReplayConfig you pass at configure time:
import PipeKitvar video = SessionReplayConfig()video.maskSensitiveViews = true// Class names to auto-mask (useful for custom and third-party views)video.autoMaskViewClasses = ["CreditCardView","BankAccountView","StripeCardFormView",]PipeKit.configure(apiKey: "pk_live_xxxxxxxxxxxxxxxx",config: PipeKitConfig(videoConfig: video))
Network Request Filtering
Configure network redaction through SessionLoggerConfig. Use excludedURLPatterns (regex) to skip capturing specific endpoints entirely, and redactedHeaders to strip sensitive headers. The defaults for redactedHeaders already include authorization, cookie, and x-api-key. Request and response bodies are captured up to maxBodySize — lower it (or exclude the URL) when a body may contain sensitive data.
import PipeKitvar logs = SessionLoggerConfig()// Don't capture requests to certain URLs (regex patterns)logs.excludedURLPatterns = [".*/api/auth/.*",".*stripe.com.*",]// Redact additional sensitive headers// (authorization, cookie, x-api-key are redacted by default)logs.redactedHeaders.insert("x-session-token")// Cap how much of each body is capturedlogs.maxBodySize = 4096PipeKit.configure(apiKey: "pk_live_xxxxxxxxxxxxxxxx",config: PipeKitConfig(logConfig: logs))
Log Filtering
Control how much console output is captured with minimumLogLevel on SessionLoggerConfig. Raising the threshold (for example to .warning) prevents verbose debug logs — which may contain user data — from being recorded. To keep sensitive values out of logs entirely, avoid logging them; PipeKit captures the messages your app emits as-is.
import PipeKitvar logs = SessionLoggerConfig()// Only capture warnings and abovelogs.minimumLogLevel = .warningPipeKit.configure(apiKey: "pk_live_xxxxxxxxxxxxxxxx",config: PipeKitConfig(logConfig: logs))
Disable Recording for Screens
Stop the session entirely while a sensitive screen is on display, then start a new one once the user leaves. Check PipeKit.isRecording before resuming so you only restart if recording was active.
import UIKitimport PipeKitclass PaymentViewController: UIViewController {override func viewWillAppear(_ animated: Bool) {super.viewWillAppear(animated)// Stop recording while this screen is visiblePipeKit.stopSession()}override func viewWillDisappear(_ animated: Bool) {super.viewWillDisappear(animated)// Resume recording after leaving the screenPipeKit.startSession()}}
GDPR & Compliance
User Consent
For GDPR compliance, get user consent before recording:
import UIKitimport PipeKit// Check consent before startingif UserDefaults.standard.bool(forKey: "userConsentedToRecording") {PipeKit.startSession()}// Show consent dialogfunc showRecordingConsentDialog() {let alert = UIAlertController(title: "Help us improve",message: "Allow us to record your session to improve the app?",preferredStyle: .alert)alert.addAction(UIAlertAction(title: "Allow", style: .default) { _ inUserDefaults.standard.set(true, forKey: "userConsentedToRecording")PipeKit.startSession()})alert.addAction(UIAlertAction(title: "Deny", style: .cancel))present(alert, animated: true)}
Data Retention
Sessions are automatically deleted after your plan's retention period (7-90 days). Users can request data deletion through your app, and you can delete specific sessions via the dashboard or API.
Next: API Reference
Explore all available SDK methods and integration options.
Continue to API Reference →