SessionReplay SDK - Native iOS Session Recording & Replay Framework

Hey Swift community! :waving_hand:

I've been working on an open-source session replay SDK for iOS that I'd love to share with you all. After spending considerable time building session recording capabilities for production apps, I've extracted the core functionality into a reusable framework.

What is it?

SessionReplaySDK is a native Swift framework that captures user interactions, UI changes, and app state in iOS applications, then allows you to replay those sessions for debugging, analytics, and UX optimization.

:link: SDK Repository: GitHub - AlmoutasemNabil/SessionReplaySDK: 📹 Lightweight iOS SDK for recording user sessions with video, touch events, console logs & network requests. Privacy-first with automatic PII masking. Pure Swift, zero dependencies.
:link: Demo App: GitHub - AlmoutasemNabil/SessionReplayDemo: A complete demo application showcasing the SessionReplaySDK capabilities, Record sessions, view synchronized playback, test uploads, and explore all SDK features in action

Key Features

  • Touch & Gesture Recording - Captures taps, swipes, scrolls, and all user interactions
  • UI State Snapshots - Records view hierarchy changes and visual state
  • Network Activity - Intercepts and logs network requests/responses via URLProtocol
  • Privacy-First - Built-in masking for sensitive data (passwords, PII)
  • Lightweight - Minimal performance impact on your app
  • Pure Swift - No external dependencies, Swift concurrency with actors
  • SwiftUI & UIKit - Works with both frameworks

Why I Built This

While working on large-scale POS applications serving thousands of restaurants, reproducing user-reported bugs was always challenging. Traditional logging wasn't enough - we needed to see exactly what the user experienced. Existing solutions were either too expensive, required backend infrastructure, or didn't fit our needs for offline-first apps.

Technical Highlights

  • Actor-based architecture for thread-safe event recording
  • Custom URLProtocol for transparent network interception
  • View hierarchy introspection using SwiftUI Environment and UIKit responder chain
  • Efficient serialization with Codable for session storage
  • Modular design - easy to extend with custom event types

Try It Out

The demo app shows the SDK in action with a simple note-taking interface. You can:

  1. Interact with the app (add notes, tap buttons, scroll)
  2. Stop recording and view the captured session
  3. Replay the session with synchronized events and UI state
// Simple integration
import SessionReplaySDK

let recorder = SessionRecorder()
recorder.startRecording()

// ... user interacts with app ...

let session = recorder.stopRecording()

What's Next?

I'm actively working on:

  • Video-style playback rendering
  • Better SwiftUI view diffing
  • Performance optimizations
  • More features

I'd Love Your Feedback!

Whether you're interested in session replay, debugging tools, or just curious about the implementation - I'd appreciate:

  • Code reviews and architectural feedback
  • Bug reports and feature requests
  • Performance optimization suggestions
  • Use cases I haven't considered

This is a learning project as much as a practical tool, so constructive criticism is very welcome!

Contributing

The project is open source under MIT license. PRs are welcome! If you find it useful, a :star: on GitHub would be appreciated.


Tech Stack: Swift 5.9+, iOS 16+, SwiftUI, Combine, Swift Concurrency (actors)

Looking forward to hearing your thoughts and ideas! :rocket:

2 Likes