SDK Reference

Complete API reference for the PipeKit iOS SDK. All methods are called as static functions on the PipeKit enum.

import PipeKit

Configuration

Initialize PipeKit once on app launch, typically in your AppDelegate or SwiftUI App.init().

Session Recording

Control session replay recording. Sessions capture video, touch events, logs, and network requests.

User Identification

Associate sessions with users in your system. User info is included in session metadata and visible in the dashboard.

Screen Tracking

Track screen transitions so you can correlate activity with the screen the user was on.

Logging

Add custom log entries to the session. Logs appear in the activity timeline alongside network requests, synchronized with the video replay.

Session Management

Access and manage locally stored sessions.

Upload

Sessions are automatically uploaded after being saved. You can also trigger uploads manually or control the auto-upload behavior.

Flows & Runtime Control

Build and run dynamic flows composed of registered nodes. Flows can be defined in code or pushed remotely from the dashboard.

Privacy & Sensitive Content

Mark views as sensitive to mask them in session recordings. Masked views appear as solid rectangles in the captured video. Text fields and secure entries are auto-masked by default.

Auto-Masking Options

These SessionReplayConfig properties control automatic masking behavior.

PropertyTypeDefaultDescription
maskSensitiveViewsBooltrueRespect .sensitiveContent() and .markAsSensitive() markers
autoMaskTextFieldsBooltrueAutomatically mask all UITextField content
autoMaskSecureTextFieldsBooltrueAutomatically mask password/secure text fields
autoMaskViewClasses[String][]Class names to auto-mask (e.g. ["CreditCardInputView"])
sensitiveViewMaskColorColor.grayColor used for the mask overlay

SwiftUI Integration

View modifiers and components for SwiftUI apps.

UIKit Integration

Base classes and utilities for UIKit apps.

Configuration Reference

PipeKitConfig

Top-level SDK configuration passed to PipeKit.configure().

PropertyTypeDefaultDescription
enableSessionReplayBooltrueEnable session replay (video + logs + network capture)
enableFlowsBooltrueEnable dynamic flow composition and remote sync
captureNetworkBooltrueCapture network requests
captureConsoleLogsBooltrueCapture console logs
videoConfigSessionReplayConfigSessionReplayConfig()Video capture settings (iOS only)
logConfigSessionLoggerConfigSessionLoggerConfig()Logging capture settings (iOS only)

SessionReplayConfig

Fine-grained control over video capture and session behavior.

PropertyTypeDefaultDescription
enableVideoRecordingBooltrueSet to false for logs-only mode (no video)
captureFrameRateInt1Frames per second (1-10). Higher = smoother but larger files
jpegCompressionQualityCGFloat0.3JPEG quality (0.0 - 1.0)
captureScaleCGFloat1.0Scale factor for captured images
videoBitrateInt75,000H.264 bitrate in bits/second
maxStorageSizeInt50 MBMaximum local storage in bytes
segmentDurationTimeInterval10.0Duration per video segment in seconds
captureTouchesBooltrueRecord touch events
showTouchIndicatorsBooltrueRender touch indicators on captured frames
autoStartOnLaunchBoolfalseAuto-start recording on app launch
autoStopOnBackgroundBooltrueAuto-stop when app enters background
autoStopOnTerminateBooltrueAuto-stop and save on app termination
enableCrashRecoveryBooltrueSave periodic checkpoints for crash recovery
crashRecoveryIntervalTimeInterval5.0Seconds between crash recovery checkpoints
storageDirectoryURLDocuments/SessionReplaysDirectory for stored recordings
debugLoggingBooltruePrint SDK debug logs to console

SessionLoggerConfig

Control how console logs and network requests are captured.

PropertyTypeDefaultDescription
captureConsoleLogsBooltrueCapture print/os_log messages
captureNetworkRequestsBooltrueCapture HTTP requests/responses
minimumLogLevelLogLevel.debugMinimum log level to capture
maxLogMessageLengthInt2000Truncate messages longer than this
maxBodySizeInt100 KBMax request/response body size to capture
redactedHeadersSet<String>authorization, cookie, ...Headers redacted from network capture (case-insensitive)
excludedURLPatterns[String][]URL patterns to exclude from capture (regex)
excludeSDKLogsBooltrueExclude [PipeKit] internal logs from session data

Data Models

Key types you'll encounter when working with the SDK.

Full Example

AppDelegate.swift
import UIKit
import PipeKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// 1. Configure the SDK
PipeKit.configure(
apiKey: "pk_live_YOUR_KEY",
config: PipeKitConfig(
enableSessionReplay: true,
enableFlows: true,
captureNetwork: true,
captureConsoleLogs: true
)
)
// 2. Identify user (after login)
PipeKit.identifyUser(
userId: "user_12345",
)
// 3. Start recording
PipeKit.startSession()
return true
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Sessions auto-stop on background by default
// Auto-upload handles the rest
}
}
SwiftUI Example
import SwiftUI
import PipeKit
@main
struct MyApp: App {
init() {
PipeKit.configure(apiKey: "pk_live_YOUR_KEY")
PipeKit.startSession()
}
var body: some Scene {
WindowGroup {
ContentView()
.trackScreen("Home")
.withTouchIndicators()
}
}
}
struct PaymentView: View {
@State private var cardNumber = ""
var body: some View {
VStack {
TextField("Card Number", text: $cardNumber)
.sensitiveContent() // Masked in recordings
Button("Pay") {
PipeKit.log("Payment initiated", attributes: [
"amount": "49.99"
])
}
}
.trackScreen("Payment")
}
}

Need Help?

Check out our guides for step-by-step setup or learn about privacy controls.