-
Notifications
You must be signed in to change notification settings - Fork 748
chore: flutter manual start and stop recording #14487
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
Merged
+133
−82
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f836635
chore: flutter manual start and stop recording
ioannisj c91e34e
Merge branch 'master' into chore/docs/flutter-start-stop-recording
ioannisj cf8595d
feat: move manual session controls to replay section
ioannisj 15d14b1
fix: extract privacy note
ioannisj 293d06c
Merge branch 'master' into chore/docs/flutter-start-stop-recording
ioannisj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
contents/docs/session-replay/_snippets/android-manual-replay-control.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| > Requires PostHog Android SDK version >= [3.16.0](https://github.com/PostHog/posthog-android/releases/tag/3.16.0). | ||
|
|
||
| Setting `config.sessionReplay = false` in your PostHog configuration will prevent PostHog from automatically starting session recordings on SDK setup. | ||
|
|
||
| You can manually control when to start and stop session recordings using the following methods: | ||
|
|
||
| - `startSessionReplay(resumeCurrent: Boolean)` | ||
| - Set **resumeCurrent** to `true` to resume a previous session recording (Default). | ||
| - Set **resumeCurrent** to `false` to start a new session recording. | ||
| - `stopSessionReplay()` | ||
| - Stops/pauses the current session recording. | ||
|
|
||
| > **Note:** Calling these methods will have no effect if session recordings are disabled in your PostHog [Project Settings](https://app.posthog.com/project/settings). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
contents/docs/session-replay/_snippets/flutter-manual-replay-control.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| > Requires PostHog Flutter SDK version >= [5.14.0](https://github.com/PostHog/posthog-flutter/releases/5.14.0). Available on iOS, Android, and Web. | ||
|
|
||
| Setting `config.sessionReplay = false` in your PostHog configuration will prevent PostHog from automatically starting session recordings on SDK setup. | ||
|
|
||
| You can manually control when to start and stop session recordings using the following methods: | ||
|
|
||
| - `startSessionRecording({bool resumeCurrent = true})` | ||
| - Set **resumeCurrent** to `true` to resume a previous session recording (Default). | ||
| - Set **resumeCurrent** to `false` to start a new session recording. | ||
| - `stopSessionRecording()` | ||
| - Stops/pauses the current session recording. | ||
|
|
||
| > **Note:** Calling these methods will have no effect if session recordings are disabled in your PostHog [Project Settings](https://app.posthog.com/project/settings). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
contents/docs/session-replay/_snippets/ios-manual-replay-control.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| > Requires PostHog iOS SDK version >= [3.19.0](https://github.com/PostHog/posthog-ios/releases/tag/3.19.0). | ||
|
|
||
| Setting `config.sessionReplay = false` in your PostHog configuration will prevent PostHog from automatically starting session recordings on SDK setup. | ||
|
|
||
| You can manually control when to start and stop session recordings using the following methods: | ||
|
|
||
| - `startSessionRecording(resumeCurrent: Bool)` | ||
| - Set **resumeCurrent** to `true` to resume a previous session recording (Default). | ||
| - Set **resumeCurrent** to `false` to start a new session recording. | ||
| - `stopSessionRecording()` | ||
| - Stops/pauses the current session recording. | ||
|
|
||
| > **Note:** Calling these methods will have no effect if session recordings are disabled in your PostHog [Project Settings](https://app.posthog.com/project/settings). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
contents/docs/session-replay/_snippets/react-native-manual-replay-control.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Support for programmatic start/stop in React Native is planned. You can track progress in [issue #2169](https://github.com/PostHog/posthog-js/issues/2169). |
3 changes: 3 additions & 0 deletions
3
contents/docs/session-replay/_snippets/sensitive-third-party-screens.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ### Handling sensitive third-party screens | ||
|
|
||
| For third-party components (like payment forms or authentication screens) that can't be masked, you can manually stop and start session recordings. See [how to control which sessions you record](/docs/session-replay/how-to-control-which-sessions-you-record#programmatically-start-and-stop-recordings) for details. |
38 changes: 38 additions & 0 deletions
38
contents/docs/session-replay/_snippets/web-manual-replay-control.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { ProductScreenshot } from 'components/ProductScreenshot' | ||
|
|
||
| export const ImgSampleConfigLight = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/tutorials/limit-session-recordings/sampling-config-light-mode.png" | ||
| export const ImgSampleConfigDark = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/tutorials/limit-session-recordings/sampling-config-dark-mode.png" | ||
| export const ImgMinDurationLight = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/tutorials/limit-session-recordings/min-duration-light-mode.png" | ||
| export const ImgMinDurationDark = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/tutorials/limit-session-recordings/min-duration-dark-mode.png" | ||
|
|
||
| 1. For older projects, there is a section for 'Authorized domains for replay' in the [project replay settings](https://us.posthog.com/settings/environment-replay#replay-authorized-domains). Ensure your domain is added if the section is present. | ||
|
|
||
| 2. Set `disable_session_recording: true` in your [config](/docs/libraries/js/config). | ||
|
|
||
| ```js-web | ||
| posthog.init('<ph_project_api_key>', { | ||
| api_host: '<ph_client_api_host>', | ||
| defaults: '<ph_posthog_js_defaults>', | ||
| disable_session_recording: true, | ||
| // ... other options | ||
| }) | ||
| ``` | ||
|
|
||
| 3. Manually start recording by calling `posthog.startSessionRecording()`. Similarly, you can stop the recording at any point by calling `posthog.stopSessionRecording()`. | ||
|
|
||
| By default, `startSessionRecording` obeys any ingestion controls you've set - so you might call start and not record a session because of sampling or some other control. | ||
|
|
||
| You can pass override options to `startSessionRecording` to change this. | ||
|
|
||
| ``` | ||
| posthog.startSessionRecording(true) // start ignoring all ingestion controls | ||
| posthog.startSessionRecording({ | ||
| // you don't have to send all of these | ||
| sampling: true || false; | ||
| linked_flag: true || false; | ||
| url_trigger: true || false; | ||
| event_trigger: true || false | ||
| }) | ||
| ``` | ||
|
|
||
| > **Note:** Calling these methods will have no effect if session recordings are disabled in your PostHog [Project Settings](https://app.posthog.com/project/settings). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.