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

add canvas config instructions #10591

Merged
merged 5 commits into from
Feb 6, 2025
Merged

add canvas config instructions #10591

merged 5 commits into from
Feb 6, 2025

Conversation

pauldambra
Copy link
Member

i've manually recreated this a couple of times in support... adding to docs to save the future traveller

Copy link

vercel bot commented Feb 6, 2025

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

Name Status Preview Updated (UTC)
posthog ✅ Ready (Inspect) Visit Preview Feb 6, 2025 5:10pm

@mxzinke
Copy link

mxzinke commented Feb 6, 2025

Hey there! In Typescript, the SessionRecordingCanvasOptions type tells that 'canvasQuality' is a string. May this needs to be respected.

type SessionRecordingCanvasOptions = {
    recordCanvas?: boolean | null;
    canvasFps?: number | null;
    canvasQuality?: string | null;
};

@mxzinke
Copy link

mxzinke commented Feb 6, 2025

Had a quick look onto it. Maybe there is an issue on the typescript interface itself!

Here the session recording is using the canvasQuality as number:
https://github.com/PostHog/posthog-js/blob/3b5bb8f883343b819d286cd95a808f8cec5ff4bf/src/extensions/replay/sessionrecording.ts#L336

@pauldambra
Copy link
Member Author

No, that's a good catch @mxzinke. It comes out of the backend as a string... but we use it as a number... it (will|must) always be a valid decimal

@mxzinke
Copy link

mxzinke commented Feb 6, 2025

Alright. But than still may the documentation needs to be updated on the posthog-js. The defaults aren't matching with your documentation here. Sorry for being so picky...

https://github.com/PostHog/posthog-js/blob/3b5bb8f883343b819d286cd95a808f8cec5ff4bf/src/types.ts#L1173

session_recording: {
captureCanvas: {
// accepts a number between 0 and 12
// if not set locally, when canvas recording is enabled, remote config sets this to 4
Copy link
Member Author

Choose a reason for hiding this comment

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

it's best to comment on lines or files @mxzinke cos then we can thread :)
literally the worst UX feature of GitHub, that you can't thread on the conversation tab

default was a poor choice of words maybe... if you turn on canvas recoding, the backend provides a fixed value. to change it you have to override in config

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link

@mxzinke mxzinke Feb 6, 2025

Choose a reason for hiding this comment

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

Thanks for clarifying. Now way more understandable.

It would be awesome if the docs on types on posthog-js repo would also have this information :)

Copy link
Contributor

@ivanagas ivanagas left a comment

Choose a reason for hiding this comment

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

nice!

contents/docs/session-replay/canvas-recording.mdx Outdated Show resolved Hide resolved
contents/docs/session-replay/canvas-recording.mdx Outdated Show resolved Hide resolved
@pauldambra pauldambra enabled auto-merge (squash) February 6, 2025 16:41
@pauldambra pauldambra merged commit 799870b into master Feb 6, 2025
3 checks passed
@pauldambra pauldambra deleted the pauldambra-patch-5 branch February 6, 2025 17:10
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