Skip to content

Document strict minimum duration mode for session replay#13635

Merged
gewenyu99 merged 4 commits intomasterfrom
copilot/update-replay-page-documentation
Nov 12, 2025
Merged

Document strict minimum duration mode for session replay#13635
gewenyu99 merged 4 commits intomasterfrom
copilot/update-replay-page-documentation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 12, 2025

Changes

Added documentation for strictMinimumDuration config option introduced in posthog-js 1.291.0 (PostHog/posthog-js#2557). This mode changes how minimum duration is enforced for session recordings.

Updated section: "Minimum duration" in how-to-control-which-sessions-you-record.mdx

Key documentation changes:

  • Legacy mode (default): Checks against session age. Starts sending after session is X seconds old, even if buffer cleared by page refresh. Can miss early session data.

  • Strict mode (1.291.0+): Checks against actual buffered data timestamps. Only sends after X seconds of continuous recording on a single page. More accurate for filtering short sessions.

Example with 12s minimum:

  • Legacy: User on page A (6s) → navigates to page B → after 6s more, sends recording (captures only page B)
  • Strict: User on page A (6s) → navigates to page B → must stay 12s on page B before sending (captures full page B session)

Configuration:

posthog.init('<ph_project_api_key>', {
  session_recording: {
    strictMinimumDuration: true
  }
})

Added guidance on choosing between modes and noted strict mode will become default in future releases.

Checklist

  • Words are spelled using American English
  • Titles are in sentence case
  • Feature names are in sentence case too. It's "product analytics" not "Product Analytics" and so on.
  • Use relative URLs for internal links
  • If I moved a page, I added a redirect in vercel.json
  • Remove this template if you're not going to fill it out!

Article checklist

  • I've added (at least) 3-5 internal links to this new article
  • I've added keywords for this page to the rank tracker in Ahrefs
  • I've checked the preview build of the article
  • The date on the article is today's date
  • I've added this to the relevant "Tutorials and guides" docs page (if applicable)
Original prompt

in PR PostHog/posthog-js#2557 we have added a new mode to the replay minimum duration config. i want to update the documentation on the how to control reply page to explain the new mode and the difference between that and the old one. in the new mode you must be on a single page without navigation or refresh for minium duration or we won't start sending the recording, in the old mode we would start sending the recording to the backend after the session was min dur seconds old even if the buffer had been cleared by navigation or page refresh. the new config is available in 1.291.0 and will soon be the default


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
posthog Ready Ready Preview Nov 12, 2025 6:04pm

Co-authored-by: pauldambra <984817+pauldambra@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation for replay minimum duration mode Document strict minimum duration mode for session replay Nov 12, 2025
Copilot AI requested a review from pauldambra November 12, 2025 12:06
@pauldambra pauldambra marked this pull request as ready for review November 12, 2025 12:12
@pauldambra pauldambra requested review from a team, TueHaulund, ksvat and veryayskiy and removed request for a team November 12, 2025 12:12
Copy link
Copy Markdown
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.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@gewenyu99
Copy link
Copy Markdown
Contributor

😆 nice, let me give copilot a bit of help, but generally looks fine

@gewenyu99 gewenyu99 enabled auto-merge (squash) November 12, 2025 17:28
@gewenyu99 gewenyu99 merged commit 9fdf2be into master Nov 12, 2025
11 checks passed
@gewenyu99 gewenyu99 deleted the copilot/update-replay-page-documentation branch November 12, 2025 18:04
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.

4 participants