Skip to content

feat: Session Recordings #630

@riley-wv

Description

@riley-wv

Plugin(s)

  • Accelerometer
  • Android Battery Optimization
  • Android Dark Mode Support
  • Android Edge-to-Edge Support
  • Android Foreground Service
  • App Review
  • App Shortcuts
  • App Update
  • Asset Manager
  • Audio Recorder
  • Background Task
  • Badge
  • Barometer
  • Bluetooth Low Energy
  • Cloudinary
  • Contacts
  • Datetime Picker
  • File Compressor
  • File Opener
  • File Picker
  • Live Update
  • Managed Configurations
  • NFC
  • Pedometer
  • Photo Editor
  • Posthog
  • Printer
  • Screen Orientation
  • Screenshot
  • Speech Recognition
  • Speech Synthesis
  • SQLite
  • Torch
  • Zip

Current problem

The PostHog plugin lacks built-in support for session replay, which is an essential feature available in the native PostHog SDKs. Users cannot easily enable session recording without manually implementing workarounds.

Preferred solution

Add native session replay features to the PostHog Capacitor plugin with:

  1. Session Recording Methods:

    • startSessionRecording() - Start recording user sessions with configurable options
    • stopSessionRecording() - Stop recording user sessions
  2. Configuration Options:

    • enableSessionReplay - Auto-enable session recording on plugin initialization
    • sessionReplayConfig - Add session replay config map
  3. Cross-Platform Support:

    • Implement using PostHog JS SDK for web
    • Implement using PostHog iOS SDK for iOS
    • Implement using PostHog Android SDK for Android

This solution provides a consistent API across all platforms and follows PostHog's official SDK patterns.

Alternative options

  1. Manual Implementation: Users could manually integrate PostHog SDKs alongside the Capacitor plugin, but this creates complexity and inconsistency.

  2. Third-Party Plugins: Use separate plugins for session recording, but this doesn't integrate well with PostHog's analytics.

  3. Web-Only Solution: Only implement for web platform using PostHog JS, but this leaves mobile platforms unsupported.

Additional context

Before submitting

  • I have read and followed the feature request guidelines.
  • I have attached links to possibly related issues and discussions.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions