Skip to content

Conversation

@riley-wv
Copy link

@riley-wv riley-wv commented Oct 21, 2025

  • Add error tracking to Android & Web plugins
  • Update documentation with new API methods and configuration options
  • Maintain backward compatibility with existing implementations
  • Update PostHog versions on iOS, Android & Web

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).
  • I have read and followed the pull request guidelines.

Close #645

…lugin

Implemented comprehensive session replay and error tracking capabilities across iOS, Android, and Web platforms for the PostHog Capacitor plugin.

**Key Changes:**
- Added `captureException()` method to capture and track errors with optional properties
- Added `startSessionRecording()` and `stopSessionRecording()` methods with configurable sampling and linked flag options
- Updated TypeScript definitions with new interfaces: `CaptureExceptionOptions` and `StartSessionRecordingOptions`
- Extended Capacitor configuration interface with session replay and error tracking options
- Implemented platform-specific option classes for iOS (Swift) and Android (Java)
- Updated configuration handling to automatically enable features based on plugin config
- Enhanced web implementation using posthog-js session recording and exception capture APIs
- Added iOS implementation using PostHog iOS SDK methods
- Added Android implementation using PostHog Android SDK methods

**Configuration Options Added:**
- `enableSessionReplay`: Auto-enable session recording on app start
- `sessionReplaySampling`: Set sampling rate (0.0 to 1.0, default 1.0)
- `sessionReplayLinkedFlag`: Enable linked flags for session recording
- `enableErrorTracking`: Auto-enable error tracking

These changes provide a unified, cross-platform API for session replay and error tracking while maintaining backward compatibility.
Commit includes:
- Revert changes to root package.json and posthog package.json
- Sort definitions correctly
- Update version in definitions
- Remove undefined type
- Remove capacitor config from web package
This commit includes the following:
- Remove error tracking from iOS (unsupported)
- Fix session replays for android and iOS
@robingenz
Copy link
Member

What about iOS?

@riley-wv
Copy link
Author

Error tracking isn't supported in iOS at the moment. Once it is, I will implement it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants