-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal duration support for Session replay #189
Comments
@marandaneto are there any good first issues to contribute to? I guess I can pick this up as well but would need some discussions with the team on the implementation - i.e. = If this should be a separate layer, if this should use an existing layer, what should be the default duration length, etc.. Looking to start contributing to the Android / Flutter SDK / BE of PostHog as we have been using it extensively across products. :) |
Hello @karntrehan, I am happy to hear that and glad to guide you through the implementation as well :) posthog-android/posthog/src/main/java/com/posthog/internal/PostHogFeatureFlags.kt Lines 127 to 136 in 85f6ef1
Most likely we will add this config here too https://github.com/PostHog/posthog-android/blob/main/posthog-android/src/main/java/com/posthog/android/replay/PostHogSessionReplayConfig.kt See the JS implementation https://github.com/PostHog/posthog-js/blob/8e7e1ea6bc95199d9cc031ea975847cbc9209f55/src/types.ts#L386 Look for minimumDurationMilliseconds , receivedMinimumDuration , and SESSION_RECORDING_MINIMUM_DURATION .I think a draft PR with making this work is a good start, by checking the JS SDK, and then we see how to structure, and organize the code and so on, WDYT? |
Thank you for the details. |
Hie @marandaneto, Also, could you please configure a min time for this project and let me know? I have looked at the code and going to start making changes to the config first. Thanks! |
@karntrehan the apiKey is considered public and not private, and the server side has DDoS protection but there's not much we can do about it since apps can be reverse-engineered and there's no way to protect such keys, people could send trash data to your project though but it's not something common. |
I configured min. 1s for the project with API key phc_QFbR1y41s5sxnNTZoyKG2NJo2RlsCIWkUfdpawgb40D just in case you wanna test it quickly =) |
@marandaneto Got it. Are these DDoS protections also built in into the self-hosting offering? If not, we should talk about this in the comparision. On the key being easy to reverse engineer, I somewhat agree. We can always use the secrets approach to make it slightly harder to guess. This would also promote people to do it at their end as well. Just an added security. Also, the addition of the config helps. Thanks! |
session length.
@marandaneto I have for now created a commit for Adding minSessionDuration to config and update usage. As a next steps I was adding a handling to the PostHogReplayIntegration but the uninstall function is not getting called when the app is pushed to the background or killed. Do let me know if I am on the right track here: Deleting the recording if the time diff is less than min session time. Or maybe add this check before the capture here |
Description
https://posthog.com/docs/session-replay/how-to-control-which-sessions-you-record#minimum-duration
The text was updated successfully, but these errors were encountered: