Skip to content

feat: add sampleRate to PostHogSessionReplayConfig#303

Draft
marandaneto wants to merge 1 commit intomainfrom
marandaneto/replay-sample-rate
Draft

feat: add sampleRate to PostHogSessionReplayConfig#303
marandaneto wants to merge 1 commit intomainfrom
marandaneto/replay-sample-rate

Conversation

@marandaneto
Copy link
Member

💡 Motivation and Context

Add sampleRate config option to PostHogSessionReplayConfig to control session replay recording frequency. This mirrors the React Native implementation.

  • Local SDK sampleRate takes precedence over remote config
  • If sampleRate is not set (null), sampling is controlled by remote config via the native SDKs
  • The value is forwarded to the native Android and iOS SDKs

Note: Native SDKs need sampleRate support on their PostHogSessionReplayConfig:

  • Android: PR #437 (open)
  • iOS: Planned (TODO in PostHogSessionReplayConfig.swift)

💚 How did you test it?

  • All existing Flutter tests pass (93/93)
  • Dart analyzer shows no new issues on changed files

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file
  • Added the release label to the PR

Add session replay sample rate config (0-1) that is forwarded to
native SDKs. Local config takes precedence over remote config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@marandaneto marandaneto requested a review from a team as a code owner February 23, 2026 13:17
@marandaneto marandaneto marked this pull request as draft February 23, 2026 13:18
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.

1 participant