Session Replay for iOS lets you visually replay your user's app interactions, providing powerful qualitative insights to complement your quantitative analytics.
Mixpanel Session Replay enables you to quickly understand why users behave a certain way in your app, complementing analytics insights on where they drop off.
This section is relevant only if you are developing or contributing to this SDK repository.
This repository uses Apple's swift-format to ensure consistent Swift formatting across all developers.
Formatting rules are defined in the .swift-format file at the repo root.
Install swift-format:
brew install swift-formatFormat the entire repository:
sh ./scripts/format-swift.shFormat a single file:
sh ./scripts/format-swift.sh MixpanelSessionReplay/MixpanelSessionReplay/MyFile.swiftFormat multiple files:
sh ./scripts/format-swift.sh MixpanelSessionReplay/FileA.swift MixpanelSessionReplay/FileB.swiftAfter pulling the repo, run:
git config core.hooksPath .githooksThis enables the pre-commit hook that checks formatting before each commit.
- When you commit, the hook checks if staged Swift files are properly formatted
- If formatting issues are found, the commit is blocked
- The hook displays which files need formatting and provides the exact command to fix them
- After running the formatter, stage the files again and recommit
🧹 Running Apple swift-format pre-commit hook (staged only)
→ Checking formatting on staged Swift files
❌ These files need formatting:
MixpanelSessionReplay/Foo.swift
MixpanelSessionReplay/Bar.swift
Run the formatter and re-stage:
sh ./scripts/format-swift.sh MixpanelSessionReplay/Foo.swift MixpanelSessionReplay/Bar.swift
Then run the suggested command, re-stage, and commit again.
This section is for app developers integrating the SDK into their iOS applications.
- Active Mixpanel account
Add the Session Replay SDK using Swift Package Manager directly in Xcode:
- In Xcode, go to File → Add Package Dependencies...
- Paste the GitHub URL:
https://github.com/mixpanel/mixpanel-ios-session-replay-package - Follow the prompts to select the latest version and add the package to your project.
Open podfile and add Mixpanel Session Replay library to your dependencies:
target 'MyApp' do
pod 'MixpanelSessionReplay', :git => 'https://github.com/mixpanel/mixpanel-ios-session-replay-package.git', :tag => '1.0.0'
end
Install the Mixpanel Session Replay by running the following in the Xcode project directory:
pod install
For detailed setup instructions, configuration options, and usage examples, please visit our official documentation:
📚 Mixpanel Session Replay for Swift - Complete Guide
The documentation covers:
- Quick start setup
- Initialization and configuration
- Recording sessions
- Privacy controls and sensitive data masking
- Advanced features and customization
Have any questions? Reach out to Mixpanel Support to speak to someone smart, quickly.
