Quickstart guide
Requirements
- Flutter 3.3.0 or later.
- Dart SDK 3.5.0 or later.
- Android: minimum API level 24.
- iOS: minimum deployment target 15.0.
Installation
To install the DevRev SDK, run the following command:
flutter pub add devrev_sdk_flutterIt automatically fetches the latest version of our package and adds it to your project's pubspec.yaml file:
dependencies:
devrev_sdk_flutter: <VERSION>Alternatively, you can add the dependency manually by adding the package to your pubspec.yaml file under the dependencies section and run flutter pub get to install the package.
To get the latest version of the SDK, you can check the pub.dev page.
Starting with version 2.2.5, the iOS portion of the plugin ships with a CocoaPods podspec. Flutter uses CocoaPods by default, so no additional Swift Package Manager configuration is required. If you prefer to keep using Swift Package Manager (flutter config --enable-swift-package-manager), the package continues to publish a Package.swift.
Set up the DevRev SDK
- Open the DevRev web app at https://app.devrev.ai and go to the Settings page.
- Under PLuG settings copy the value under Your unique App ID.
- Configure the DevRev SDK in your app using the obtained credentials.
The DevRev SDK must be configured before you can use any of its features.
The SDK becomes ready for use once the configuration API is executed. Import the SDK and use FeatureConfiguration and SupportWidgetTheme when you need to customize behavior:
import 'package:devrev_sdk_flutter/devrev.dart';
// Configure with app ID only (defaults for all options).
await DevRev.configure(appID);To provide a feature configuration during setup, pass a FeatureConfiguration as the second argument:
await DevRev.configure(appID, featureConfiguration);For default behavior, call with just the app ID:
await DevRev.configure("abcdefg12345");To customize behavior such as frame capture, auto-start recording, dialog mode (Android only), or theme preferences, pass a FeatureConfiguration:
final featureConfiguration = FeatureConfiguration(
enableFrameCapture: true,
autoStartRecording: true,
alwaysUseRemoteConfig: true,
prefersDialogMode: false, // Android only
supportWidgetTheme: SupportWidgetTheme(
prefersSystemTheme: false,
primaryTextColor: '#000000',
accentColor: '#FF5733',
spacing: {'bottom': '20px', 'side': '15px'},
),
);
await DevRev.configure(appID, featureConfiguration);Update the feature configuration
You can adjust the feature configuration without reconfiguring the SDK:
await DevRev.updateFeatureConfiguration(FeatureConfiguration(
enableFrameCapture: true,
autoStartRecording: false,
alwaysUseRemoteConfig: true,
prefersDialogMode: false, // Android only
supportWidgetTheme: SupportWidgetTheme(prefersSystemTheme: true),
));Feature configuration reference
FeatureConfiguration controls how the SDK behaves both during initial setup and when calling DevRev.updateFeatureConfiguration. All properties are required when providing a feature configuration.
| Property | Type | Default | Description |
|---|---|---|---|
enableFrameCapture | bool | true | Enables the screen capture pipeline used by session replay. |
autoStartRecording | bool | true | Automatically starts recording after the SDK finishes remote configuration. |
prefersDialogMode | bool | false | Prefer dialog mode for the support UI (Android only). |
alwaysUseRemoteConfig | bool | true | Always use remote config. |
supportWidgetTheme | SupportWidgetTheme | — | Controls the appearance of the in-app support widget, including dynamic theme behavior. |
Support widget theme options
SupportWidgetTheme lets you fine-tune the support UI. Use the supportWidgetTheme property inside your feature configuration.
SupportWidgetTheme(
prefersSystemTheme: false,
primaryTextColor: '#1F2933',
accentColor: '#F97316',
spacing: {'bottom': '20px', 'side': '16px'},
)| Property | Type | Default | Description |
|---|---|---|---|
prefersSystemTheme | bool | true | Follows the device appearance when true; otherwise uses your custom colors. |
primaryTextColor | String? | — | Hex color string (e.g. '#000000', '#1F2933') for primary text in the support widget. |
accentColor | String? | — | Hex color string (e.g. '#F97316', '#FF0000') applied to buttons and highlights. |
spacing | Map<String, String>? | — | CSS-like spacing overrides (bottom and side keys are recognized). |
Sample app
A sample app with use cases for the DevRev SDK for Flutter has been provided as a part of our public repository. To set up and run the sample app:
-
Go to the
sampledirectory:cd sample flutter clean rm -rf ios android web linux macos windows flutter create --platforms=android,ios . -
Install dependencies:
flutter pub get -
iOS app: Open the
ios/Runner.xcworkspacein Xcode for running the iOS app or run the following command.flutter run -d iosAdditional Steps for iOS before running the app:
- Change the minimum iOS deployment target version to
15.0. - Go to the
iosdirectory and performpod install. - (Optional) If you have enabled Flutter's Swift Package Manager integration, open
ios/Runner.xcodeprojin Xcode and setPackage dependencies -> FlutterGeneratedPluginSwiftPackage -> Package.swiftto use:platforms: [ .iOS("15.0") ] - Build and run the app.
- Change the minimum iOS deployment target version to
-
Android app: Open the
androiddirectory in Android Studio or run the following command.flutter run -d android
Last updated on