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

feat(docs): manual start / stop for session recordings #10235

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion contents/docs/session-replay/_snippets/android-installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,26 @@

import AndroidInstall from "../../integrate/_snippets/install-android.mdx"

export const EnableSessionReplayDark = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/session-replay/enable-session-replay-in-project-settings-dark-mode.png"
export const EnableSessionReplayLight = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/session-replay/enable-session-replay-in-project-settings-light-mode.png"


<AndroidInstall />

> Session replay requires PostHog Android SDK version >= [3.4.0](https://github.com/PostHog/posthog-android/releases), and it's recommended to always use the latest version.

## Step two: Configure replay settings
## Step two: Enable session recordings in your project settings

Enable session recordings in your PostHog [Project Settings](https://app.posthog.com/project/settings).

<ProductScreenshot
imageLight={EnableSessionReplayLight}
imageDark={EnableSessionReplayDark}
alt="Enable session recordings in your PostHog'"
classes="rounded"
/>

## Step three: Configure replay settings

Add `sessionReplay = true` to your PostHog configuration alongside any of your other configuration options:

Expand Down
17 changes: 16 additions & 1 deletion contents/docs/session-replay/_snippets/flutter-installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

import FlutterInstall from "../../integrate/_snippets/install-flutter.mdx"

export const EnableSessionReplayDark = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/session-replay/enable-session-replay-in-project-settings-dark-mode.png"
export const EnableSessionReplayLight = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/session-replay/enable-session-replay-in-project-settings-light-mode.png"


<FlutterInstall />

#### Widget and Observer setup
Expand Down Expand Up @@ -43,7 +47,18 @@ class _MyAppState extends State<MyApp> {
}
```

## Step two: Configure replay settings
## Step two: Enable session recordings in your project settings

Enable session recordings in your PostHog [Project Settings](https://app.posthog.com/project/settings).

<ProductScreenshot
imageLight={EnableSessionReplayLight}
imageDark={EnableSessionReplayDark}
alt="Enable session recordings in your PostHog'"
classes="rounded"
/>

## Step three: Configure replay settings

Add `sessionReplay = true` to your PostHog configuration alongside any of your other configuration options:

Expand Down
37 changes: 34 additions & 3 deletions contents/docs/session-replay/_snippets/ios-installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,45 @@

import IOSInstall from "../../integrate/_snippets/install-ios.mdx"

export const EnableSessionReplayDark = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/session-replay/enable-session-replay-in-project-settings-dark-mode.png"
export const EnableSessionReplayLight = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/session-replay/enable-session-replay-in-project-settings-light-mode.png"

<IOSInstall />

> Requires PostHog iOS SDK version >= [3.6.0](https://github.com/PostHog/posthog-ios/releases), and it's recommended to always use the latest version.

## Step two: Configure replay settings
## Step two: Enable session recordings in your project settings

Enable session recordings in your PostHog [Project Settings](https://app.posthog.com/project/settings).

<ProductScreenshot
imageLight={EnableSessionReplayLight}
imageDark={EnableSessionReplayDark}
alt="Enable session recordings in your PostHog'"
classes="rounded"
/>

## Step three: Configure replay settings

### Automatically start session recordings

Setting `config.sessionReplay = true` to your PostHog configuration will start session recordings on SDK setup.

### Manually control session recordings

Setting `config.sessionReplay = false` to 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 two 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).

Add `config.sessionReplay = true` to your PostHog configuration alongside any of your other configuration options:
## Configuration options

```swift
let config = PostHogConfig(apiKey: "<ph_project_api_key>")
Expand Down Expand Up @@ -49,6 +81,5 @@ config.sessionReplayConfig.debouncerDelay = 1.0

- On iOS, minimum deployment target is [iOS13](/docs/libraries/ios)
- [SwiftUI](https://developer.apple.com/xcode/swiftui/) is only supported if the `screenshotMode` option is enabled.
- `Text` views in SwiftUI are considered images, so they are masked unless `maskAllImages` is disabled.
- Custom views are not fully supported if `screenshotMode` is disabled.
- WebView is not supported. A placeholder will be shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ title: React Native session replay

import ReactNativeInstall from "../../integrate/_snippets/install-react-native.mdx"

export const EnableSessionReplayDark = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/session-replay/enable-session-replay-in-project-settings-dark-mode.png"
export const EnableSessionReplayLight = "https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/session-replay/enable-session-replay-in-project-settings-light-mode.png"


<ReactNativeInstall />

> Requires PostHog React Native SDK version >= [3.2.0](https://github.com/PostHog/posthog-js-lite/releases), and it's recommended to always use the latest version.
Expand All @@ -20,7 +24,18 @@ yarn add posthog-react-native-session-replay
npm i -s posthog-react-native-session-replay
```

## Step two: Configure replay settings
## Step two: Enable session recordings in your project settings

Enable session recordings in your PostHog [Project Settings](https://app.posthog.com/project/settings).

<ProductScreenshot
imageLight={EnableSessionReplayLight}
imageDark={EnableSessionReplayDark}
alt="Enable session recordings in your PostHog'"
classes="rounded"
/>

## Step three: Configure replay settings

Add `enableSessionReplay: true` to your PostHog configuration alongside any of your other configuration options:

Expand Down
Loading