Skip to content

Conversation

@ericokuma
Copy link
Contributor

WHY: To enable unredacted session replays for non-EU/CA users while maintaining privacy compliance for regulated regions. This change implements capture-time masking based on user's GeoIP location, as recommended by PostHog (APP-582).

WHAT: Configured PostHog session_recording to dynamically apply masking:

  • Utilizes GeoIP data to identify EU/CA users and sets an is_regulated_region person property.
  • Applies a custom maskInputFn that masks inputs only for regulated users (passwords are always masked).
  • Integrated into posthog.init loaded and onFeatureFlags callbacks for timely GeoIP evaluation.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Linear Issue: APP-582

Open in Cursor Open in Web

@ericokuma ericokuma marked this pull request as ready for review November 20, 2025 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants