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.

Automatic Masking

These elements are automatically masked (replaced with ●●●●) in recordings:

UITextField

with isSecureTextEntry = true

Password fields

Any field with textContentType = .password

Credit card inputs

Fields with textContentType = .creditCardNumber

One-time codes

Fields with textContentType = .oneTimeCode

Manual Masking

Mark additional views as sensitive to exclude them from recordings:

Mark Sensitive Views
// Mark a specific view as sensitive
let sensitiveView = UIView()
PipeKit.shared.markViewAsSensitive(sensitiveView)
// Or use the extension
mySecretLabel.sr_markAsSensitive()
// Mark in SwiftUI
struct ProfileView: View {
var body: some View {
Text(user.ssn)
.srSensitive() // This text will be masked
}
}

Mask by Class

Mask all instances of a specific view class:

swift
// Mask all instances of a custom view class
PipeKit.shared.addSensitiveClass(CreditCardView.self)
PipeKit.shared.addSensitiveClass(BankAccountView.self)
// Mask by class name (useful for third-party views)
PipeKit.shared.addSensitiveClassName("PKPaymentButton")
PipeKit.shared.addSensitiveClassName("StripeCardFormView")

Network Request Filtering

Filter sensitive data from network requests:

swift
// Don't capture requests to certain URLs
PipeKit.shared.addNetworkBlacklistPattern("/api/auth/.*")
PipeKit.shared.addNetworkBlacklistPattern(".*stripe.com.*")
// Remove sensitive headers
PipeKit.shared.addSensitiveHeader("Authorization")
PipeKit.shared.addSensitiveHeader("X-API-Key")
// Filter request/response bodies
PipeKit.shared.setShouldCaptureRequestBody { request in
// Don't capture bodies for auth endpoints
return !request.url.path.contains("/auth/")
}

Log Filtering

Filter sensitive information from captured logs:

swift
// Filter logs containing sensitive patterns
PipeKit.shared.addLogFilter { message in
// Redact email addresses
let redacted = message.replacingOccurrences(
of: "[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}",
with: "[EMAIL REDACTED]",
options: [.regularExpression, .caseInsensitive]
)
return redacted
}
// Skip certain log messages entirely
PipeKit.shared.setShouldCaptureLog { message, level in
return !message.contains("Bearer ")
}

Disable Recording for Screens

Completely pause recording on sensitive screens:

swift
class PaymentViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Pause recording on this screen
PipeKit.shared.pauseRecording()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
// Resume recording
PipeKit.shared.resumeRecording()
}
}

GDPR & Compliance

User Consent

For GDPR compliance, get user consent before recording:

swift
// Check consent before starting
if UserDefaults.standard.bool(forKey: "userConsentedToRecording") {
PipeKit.shared.startRecording()
}
// Show consent dialog
func 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) { _ in
UserDefaults.standard.set(true, forKey: "userConsentedToRecording")
PipeKit.shared.startRecording()
})
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 →