Flutter session replay installation
Contents
- 1
Add PostHog to your app
RequiredSession replay requires PostHog Flutter SDK version >= 4.7.0, and it's recommended to always use the latest version.
Note: For session replay, you must setup the SDK manually.
Manual installation
First, add
posthog_flutterto yourpubspec.yaml:pubspec.yamlThen complete the manual setup for each platform:
Android setup
Add your PostHog configuration to your
AndroidManifest.xmlfile located in theandroid/app/src/main:android/app/src/main/AndroidManifest.xmlYou'll also need to update the minimum Android SDK version to
21inandroid/app/build.gradle:android/app/build.gradleiOS setup
Add your PostHog configuration to the
Info.plistfile located in theios/Runnerdirectory:ios/Runner/Info.plistYou'll need to set the minimum platform version to iOS 13.0 in your Podfile:
ios/PodfileDart setup
Then setup the SDK manually:
DartWidget and Observer setup
This configuration is only needed for mobile session replay.
Wrap your app with the
PostHogWidgetWidget and Install thePosthogObserverObserver.DartIf you're using
go_router, check this page to learn how to set up thePosthogObserver. - 2
Enable session recordings in your project settings
RequiredEnable session recordings in your PostHog Project Settings.
If you're using Flutter Web, also enable the Canvas capture in your project settings. This is needed as Flutter renders your app using a browser canvas element.


- 3
Configure replay settings
RequiredAdd
sessionReplay = trueto your PostHog configuration alongside any of your other configuration options:Dart
Limitations for mobile session replay
- On Android, requires API >= 26.
- On iOS, minimum deployment target is iOS13.
- Wireframe mode isn't supported, only screenshot mode.
- Network performance recording isn't supported yet.
Limitations for flutter web session replay
- The Canvas capture enabled is required.
Troubleshooting
- Update your SDK and iOS Pods.
- Make sure to set the minimum platform version to iOS 13.0 in your Podfile.
- Make sure you have disabled automatic SDK intialization.
- Run a clean build if you experience issues.
- For blank recordings for mobile session replay, be sure to set up the Widget and Observer.
- For blank recordings for flutter web session replay, be sure to enable Canvas capture.
- If you have enabled session replay using feature flags, the flags are evaluated on the device once the PostHog SDK starts as early as possible. The SDK might be using the cached flags from the previous SDK start. If you have changed the flag or its condition, kill and reopen the app to force a new SDK start at least once.
- This will also happen in production, and you might experience some delay for the new flag/conditions to take effect on your users. We're tracking this bug in issue #263.
- Session replay feature flag evaluation does not capture
$feature_flag_calledevents, so theUsagetab on the feature flag page won't show anything. We're tracking this feature request in issue #250.