Skip to content

Commit 419231d

Browse files
authored
feat(posthog): Add session recording support (#632)
* Add session replay and error tracking features to PostHog Capacitor plugin 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. * Add changeset to branch * Simplify changeset and change to minor change * Request Changes 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 * Sort alphabetically for SetupOptions * Revert package-lock * Fix Session Replays & Error tracking This commit includes the following: - Remove error tracking from iOS (unsupported) - Fix session replays for android and iOS * Fix android compile failure * Fix linting issues * Updates to web types and definitions * feat(rm-error-tracking): Remove error tracking to make minor bump * Fix commented out setup and remove remain error capture code * revert package-lock and update changeset * Resolve type issues for PostHogConfig * remove error tracking types and add jvm target * Fix Kotlin Options * Fix linting errors
1 parent 045ed28 commit 419231d

18 files changed

Lines changed: 525 additions & 83 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@capawesome/capacitor-posthog': minor
3+
---
4+
5+
feat: support session replay

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
"prettier-plugin-java": "2.6.7",
4040
"turbo": "2.5.6"
4141
}
42-
}
42+
}

0 commit comments

Comments
 (0)