There are some configurations that can be used to adjust how recordings are captured.
| Attribute | Description | 
|---|---|
| maskAllInputsType: Boolean Default: true | When true, all data from user input fields will be replaced by '*'s. | 
| maskInputOptionsType: Object Default: {} | Only takes effect if maskAllInputsisfalse. It determines which specific input field types should be masked. An example value might be{ password: true }. Options are:password,textarea,select,color,date,email,month,number,range,search,tel,text,time,url,week, anddatetime-local. | 
| inlineStylesheetType: Boolean Default: true | If false, stylesheets will not be included with the recording data. Rather, a URL pointing to the stylesheet will be included. Setting this to false will decrease the storage space used for recordings and improve playback buffering time, but it can also cause some flickering in the playback experience. | 
| recordCanvasType: Boolean Default: false | If true, canvas elements will be recorded by rrweb. | 
To configure these options, pass them to your posthog.init call along with your other posthog-js configurations. They go inside of the session_recording attribute, like so:
Console logs recording (beta)
PostHog can also capture console logs from your application. This is useful for debugging, providing extra context on what is happening in your users browser environment. As console logs can contain sensitive information we do not capture these logs automatically. You can enable this feature globally from your PostHog project settings page or client-side by setting enable_recording_console_log in our JavaScript library config to true.
Console logs will be recorded if either the project setting or the client-side config is set to true. If recordings overall are disabled then console logs will also not be recorded.
Further controls
If you want more granular controls, you can choose to enable session recording using feature flags. This enables you to control session recordings based on users with certain previous events/actions or properties (or just to capture a percentage of all sessions).
To do this set disable_session_recording in our JavaScript library config to true.
Then conditionally call the method posthog.startSessionRecording to enable it using the feature flag.
For example:
Equally you can stop the recording at any point via: