Skip to content
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

feat: support loading masking remotely #1734

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

joshsny
Copy link
Contributor

@joshsny joshsny commented Feb 13, 2025

Changes

Add support for setting up session replay masking in remote config / decide

Checklist

  • Tests for new code (see advice on the tests we use) - added unit tests
  • Accounted for the impact of any changes across different browsers - should be independent of browser variation
  • Accounted for backwards compatibility of any changes (no breaking changes in posthog-js!) - no breaking changes as this is an optional new config

Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Feb 21, 2025 4:07pm

Copy link

github-actions bot commented Feb 13, 2025

Size Change: +7.58 kB (+0.23%)

Total Size: 3.32 MB

Filename Size Change
dist/array.full.es5.js 270 kB +780 B (+0.29%)
dist/array.full.js 373 kB +757 B (+0.2%)
dist/array.full.no-external.js 372 kB +757 B (+0.2%)
dist/array.js 185 kB +755 B (+0.41%)
dist/array.no-external.js 183 kB +755 B (+0.41%)
dist/main.js 185 kB +755 B (+0.41%)
dist/module.full.js 373 kB +757 B (+0.2%)
dist/module.full.no-external.js 372 kB +757 B (+0.2%)
dist/module.js 185 kB +755 B (+0.41%)
dist/module.no-external.js 183 kB +755 B (+0.41%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 216 kB
dist/customizations.full.js 14 kB
dist/dead-clicks-autocapture.js 14.5 kB
dist/exception-autocapture.js 9.51 kB
dist/external-scripts-loader.js 2.64 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/surveys-preview.js 70 kB
dist/surveys.js 73.1 kB
dist/tracing-headers.js 1.76 kB
dist/web-vitals.js 10.4 kB

compressed-size-action

@joshsny joshsny marked this pull request as ready for review February 14, 2025 12:10
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds remote configuration support for session recording masking options in PostHog's JavaScript SDK, allowing masking settings to be controlled from the server side.

  • Added new constant SESSION_RECORDING_MASKING in src/constants.ts for storing server-side masking configuration
  • Extended RemoteConfig interface in src/types.ts to include optional masking property for server configuration
  • Implemented masking getter in SessionRecording class that combines client and server configurations, with client settings taking precedence
  • Added comprehensive tests verifying masking behavior across different server/client configuration scenarios

4 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@joshsny joshsny changed the title feat: load masking remotely feat: support loading masking remotely Feb 14, 2025
@joshsny joshsny requested review from pauldambra and a team February 14, 2025 12:15
@joshsny
Copy link
Contributor Author

joshsny commented Feb 14, 2025

@pauldambra not sure why safari is failing here, seems unrelated...

Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks correct to me... You could add a playwright test to prove that remote config applies

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.

2 participants