Package 

Class PostHogSessionReplayConfig


  • 
    public final class PostHogSessionReplayConfig
    
                        

    Android session replay capture options.

    Use this as PostHogAndroidConfig.sessionReplayConfig when enabling session replay through PostHogConfig.sessionReplay.

    • Method Detail

      • getCaptureTouches

         final Boolean getCaptureTouches()

        Capture touch coordinates in session replay. Defaults to true. Set before SDK setup. Runtime changes are not supported. Screenshot and view capture are unaffected. Disable this when touch positions could reveal sensitive input, even if the views are masked.

      • setCaptureTouches

         final Unit setCaptureTouches(Boolean captureTouches)

        Capture touch coordinates in session replay. Defaults to true. Set before SDK setup. Runtime changes are not supported. Screenshot and view capture are unaffected. Disable this when touch positions could reveal sensitive input, even if the views are masked.

      • getVerifyScreenshotMaskAlignment

         final Boolean getVerifyScreenshotMaskAlignment()

        Verifies mask alignment for session replay screenshots. This can preserve screenshots during pixel-only redraws, including continuously animated content, but performs additional view hierarchy walks while a screenshot is captured. Defaults to false. Windows with a Compose root always use the verified path regardless of this flag, so setting it to false does not disable verification for them.

      • setVerifyScreenshotMaskAlignment

         final Unit setVerifyScreenshotMaskAlignment(Boolean verifyScreenshotMaskAlignment)

        Verifies mask alignment for session replay screenshots. This can preserve screenshots during pixel-only redraws, including continuously animated content, but performs additional view hierarchy walks while a screenshot is captured. Defaults to false. Windows with a Compose root always use the verified path regardless of this flag, so setting it to false does not disable verification for them.

      • getScreenshotCompressionQuality

         final Integer getScreenshotCompressionQuality()

        WebP compression quality for screenshots, clamped to 0..100. Defaults to 30. Higher values generally retain more detail and produce larger payloads. Compression is lossy, except on Android 10 (API 29), where the platform's legacy WebP encoder uses lossless compression at quality 100. Does not change screenshot resolution or enable screenshot capture.

      • getScreenshotScale

         final Float getScreenshotScale()

        Multiplier for the physical width and height of screenshot captures, clamped to 0.1..1.0. For example, 0.5 captures half the width and height, or one quarter of the pixels. Dimensions are rounded up to at least one pixel; the logical replay viewport is unchanged. Defaults to 1.0 (full resolution). NaN and infinite values reset the scale to 1.0. Does not change compression quality, color mode, or enable screenshot capture.

      • getDrawableConverter

         final PostHogDrawableConverter getDrawableConverter()

        Converts custom Drawable to Bitmap By default PostHog tries to convert the Drawable to Bitmap, the supported types are BitmapDrawable, ColorDrawable, GradientDrawable, InsetDrawable, LayerDrawable, RippleDrawable

      • setDrawableConverter

         final Unit setDrawableConverter(PostHogDrawableConverter drawableConverter)

        Converts custom Drawable to Bitmap By default PostHog tries to convert the Drawable to Bitmap, the supported types are BitmapDrawable, ColorDrawable, GradientDrawable, InsetDrawable, LayerDrawable, RippleDrawable

      • getScreenshot

         final Boolean getScreenshot()

        By default Session replay will capture all the views on the screen as a wireframe, By enabling this option, PostHog will capture the screenshot of the screen. The screenshot may contain sensitive information, use with caution.

      • setScreenshot

         final Unit setScreenshot(Boolean screenshot)

        By default Session replay will capture all the views on the screen as a wireframe, By enabling this option, PostHog will capture the screenshot of the screen. The screenshot may contain sensitive information, use with caution.

      • getDebouncerDelayMs

         final Long getDebouncerDelayMs()

        Debouncer delay used to reduce the number of snapshots captured and reduce performance impact. This is used for capturing the view as a wireframe or screenshot. The lower the number, the more snapshots are captured and the higher the performance impact. Defaults to 1000ms = 1s. Ps: it was 500ms by default until version 3.8.2.

      • setDebouncerDelayMs

         final Unit setDebouncerDelayMs(@Deprecated(message = Use throttleDelayMs instead) Long debouncerDelayMs)

        Debouncer delay used to reduce the number of snapshots captured and reduce performance impact. This is used for capturing the view as a wireframe or screenshot. The lower the number, the more snapshots are captured and the higher the performance impact. Defaults to 1000ms = 1s. Ps: it was 500ms by default until version 3.8.2.

      • getThrottleDelayMs

         final Long getThrottleDelayMs()

        Throttling delay used to reduce the number of snapshots captured and reduce performance impact. This is used for capturing the view as a wireframe or screenshot. The lower the number, the more snapshots are captured and the higher the performance impact. Defaults to 1000ms = 1s.

      • setThrottleDelayMs

         final Unit setThrottleDelayMs(Long throttleDelayMs)

        Throttling delay used to reduce the number of snapshots captured and reduce performance impact. This is used for capturing the view as a wireframe or screenshot. The lower the number, the more snapshots are captured and the higher the performance impact. Defaults to 1000ms = 1s.

      • getSampleRate

         final Double getSampleRate()

        Local sample rate for session recording, a value between 0.0 and 1.0. When set, this takes precedence over the remote config sample rate. null means no local override, so the SDK uses the remote config value. Defaults to null.

      • setSampleRate

         final Unit setSampleRate(Double sampleRate)

        Local sample rate for session recording, a value between 0.0 and 1.0. When set, this takes precedence over the remote config sample rate. null means no local override, so the SDK uses the remote config value. Defaults to null.