Skip to content
Open Screeb

Add the Screeb SDK to your app and start it with your channel id, so surveys, messages and session replay can run.

Install the Screeb SDK once, at the start of your app, with the channel id of your workspace. Until a user is identified, Screeb tracks them as an anonymous visitor: see Identity to attach your own user id.

Your channel id is on the Install page of your workspace settings. The steps on the admin side are in the help center: Install Screeb on your website and Install Screeb in your mobile app.

  • iOS 15.0 or later and Swift 5.9 or later for the iOS SDK. Android API 21 or later, compileSdk 35 and Kotlin 2.1 or later for the Android SDK.
  • Flutter 3.19 or later. Kotlin Multiplatform: Kotlin 2.1.0 or later, Android minSdk 21, iOS 15. .NET MAUI: Android API 24 and iOS 15.
  • The SDK adds about 450 KB to an iOS release app and about 110 KB to an Android one. The iOS SDK has no third-party dependency.
// build.gradle.kts of your shared module
commonMain.dependencies {
implementation("app.screeb.sdk.kmp:screeb-kmp:x.x.x")
}
import app.screeb.sdk.kmp.Screeb
// From a coroutine started at app launch
Screeb.initSdk(
channelId = "<YOUR-CHANNEL-ID>",
)

Start the SDK once, when the app launches. When the user is already logged in at that point, pass their user id and properties too, so Screeb never creates an anonymous visitor for them (see Identity).

Every method of the Kotlin Multiplatform SDK is a suspend function: call it from a coroutine, for example LaunchedEffect(Unit) in your root composable.

On iOS, Screeb reads the Compose accessibility tree to see your UI: element roles, labels and bounds. Without it, in-app message targeting and the element picker cannot see your Compose elements, and session replay records pixels only. Compose Multiplatform builds that tree on iOS only when an assistive technology runs, so turn it on in your ComposeUIViewController:

import androidx.compose.runtime.ExperimentalComposeApi
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.platform.AccessibilitySyncOptions
import androidx.compose.ui.window.ComposeUIViewController
@OptIn(ExperimentalComposeUiApi::class, ExperimentalComposeApi::class)
fun MainViewController() = ComposeUIViewController(configure = {
accessibilitySyncOptions = AccessibilitySyncOptions.Always(debugLogger = null)
}) {
App()
}

Android always exposes the Compose semantics tree. To give an element a stable id for targeting, use Modifier.testTag("...").

The Screeb in-app message editor opens your app through a deep link on the screeb-<YOUR-CHANNEL-ID> scheme. Declare the scheme, then forward the links to the SDK.

<!-- Info.plist -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>screeb</string>
<key>CFBundleURLSchemes</key>
<array>
<string>screeb-<YOUR-CHANNEL-ID></string>
</array>
</dict>
</array>
<!-- AndroidManifest.xml, inside your main <activity> -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="screeb-<YOUR-CHANNEL-ID>" />
</intent-filter>
// androidMain, MainActivity.kt
import app.screeb.sdk.kmp.Screeb
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Screeb.handleDeepLink(intent?.dataString)
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
Screeb.handleDeepLink(intent.dataString)
}

On iOS, pass the URL your app receives (for example in SwiftUI onOpenURL) to Screeb.handleDeepLink of your shared module.

Stop Screeb at any time, for example when the user withdraws consent. It stays off until you start it again.

Screeb.closeSdk()