Skip to main content
Version: Kotlin Multiplatform SDK

Reference

Complete reference for the Screeb Kotlin Multiplatform SDK.

โœจ New to Screeb? Start with the Install guide.

Methods by capabilityโ€‹

Lifecycleโ€‹

MethodDescriptionMore
initSdk(channelId: String, userId: String? = null, properties: Map<String, Any>? = null, hooks: ScreebHooks? = null, initOptions: ScreebInitOptions? = null, language: String? = null): Boolean?Initialize the Screeb SDK.๐Ÿ‘‰
closeSdk(): Boolean?Stop the SDK.๐Ÿ‘‰

Identityโ€‹

MethodDescriptionMore
setIdentity(userId: String, properties: Map<String, Any>? = null): Boolean?Identify the current user with optional properties.๐Ÿ‘‰
setProperties(properties: Map<String, Any>? = null): Boolean?Send visitor properties without changing the identity.๐Ÿ‘‰
resetIdentity(): Boolean?Reset the current visitor identity.๐Ÿ‘‰
getIdentity(): Map<String, Any>?Get the current visitor identity and properties.๐Ÿ‘‰

Groupsโ€‹

MethodDescriptionMore
assignGroup(groupType: String? = null, groupName: String, properties: Map<String, Any>? = null): Boolean?Assign the current user to a group.๐Ÿ‘‰
unassignGroup(groupType: String? = null, groupName: String, properties: Map<String, Any>? = null): Boolean?Remove the current user from a group.๐Ÿ‘‰

Trackingโ€‹

MethodDescriptionMore
trackEvent(name: String, properties: Map<String, Any>? = null): Boolean?Track a custom event.๐Ÿ‘‰
trackScreen(name: String, properties: Map<String, Any>? = null): Boolean?Track a screen navigation event.๐Ÿ‘‰

Surveysโ€‹

MethodDescriptionMore
startSurvey(surveyId: String, allowMultipleResponses: Boolean = true, hiddenFields: Map<String, Any>? = null, ignoreSurveyStatus: Boolean = true, hooks: ScreebHooks? = null, language: String? = null, distributionId: String? = null): Boolean?Start a specific survey programmatically.๐Ÿ‘‰
closeSurvey(surveyId: String? = null): Boolean?Close the currently displayed survey.-

Messagesโ€‹

MethodDescriptionMore
startMessage(messageId: String, allowMultipleResponses: Boolean = true, hiddenFields: Map<String, Any>? = null, ignoreMessageStatus: Boolean = true, hooks: ScreebHooks? = null, language: String? = null, distributionId: String? = null): Boolean?Start a specific message programmatically.๐Ÿ‘‰
closeMessage(messageId: String? = null): Boolean?Close the currently displayed message.๐Ÿ‘‰

Session replayโ€‹

MethodDescriptionMore
sessionReplayStart(): Boolean?Start session replay recording.๐Ÿ‘‰
sessionReplayStop(): Boolean?Stop session replay recording.๐Ÿ‘‰

Debugโ€‹

MethodDescriptionMore
debug(): String?Get SDK debug information.๐Ÿ‘‰
debugTargeting(): String?Get targeting debug information.๐Ÿ‘‰

Privacy helpersโ€‹

MethodDescriptionMore
View.screebMaskText(): ViewMask a view or component in session replay.๐Ÿ‘‰
UIView.screebMaskText(): UIViewMask a view or component in session replay.๐Ÿ‘‰
View.screebNoCapture(): ViewExclude a view or component from session replay capture.๐Ÿ‘‰
UIView.screebNoCapture(): UIViewExclude a view or component from session replay capture.๐Ÿ‘‰
View.screebId(id: String): ViewSet a stable Screeb element ID for IAM targeting.๐Ÿ‘‰
UIView.screebId(id: String): UIViewSet a stable Screeb element ID for IAM targeting.๐Ÿ‘‰

API signaturesโ€‹

Lifecycleโ€‹

initSdk(channelId: String, userId: String? = null, properties: Map<String, Any>? = null, hooks: ScreebHooks? = null, initOptions: ScreebInitOptions? = null, language: String? = null): Boolean?
closeSdk(): Boolean?

Identityโ€‹

setIdentity(userId: String, properties: Map<String, Any>? = null): Boolean?
setProperties(properties: Map<String, Any>? = null): Boolean?
resetIdentity(): Boolean?
getIdentity(): Map<String, Any>?

Groupsโ€‹

assignGroup(groupType: String? = null, groupName: String, properties: Map<String, Any>? = null): Boolean?
unassignGroup(groupType: String? = null, groupName: String, properties: Map<String, Any>? = null): Boolean?

Trackingโ€‹

trackEvent(name: String, properties: Map<String, Any>? = null): Boolean?
trackScreen(name: String, properties: Map<String, Any>? = null): Boolean?

Surveysโ€‹

startSurvey(surveyId: String, allowMultipleResponses: Boolean = true, hiddenFields: Map<String, Any>? = null, ignoreSurveyStatus: Boolean = true, hooks: ScreebHooks? = null, language: String? = null, distributionId: String? = null): Boolean?
closeSurvey(surveyId: String? = null): Boolean?

Messagesโ€‹

startMessage(messageId: String, allowMultipleResponses: Boolean = true, hiddenFields: Map<String, Any>? = null, ignoreMessageStatus: Boolean = true, hooks: ScreebHooks? = null, language: String? = null, distributionId: String? = null): Boolean?
closeMessage(messageId: String? = null): Boolean?

Session replayโ€‹

sessionReplayStart(): Boolean?
sessionReplayStop(): Boolean?

Debugโ€‹

debug(): String?
debugTargeting(): String?

Privacy helpersโ€‹

View.screebMaskText(): View
UIView.screebMaskText(): UIView
View.screebNoCapture(): View
UIView.screebNoCapture(): UIView
View.screebId(id: String): View
UIView.screebId(id: String): UIView

Hooksโ€‹

Hooks can be passed to initialization and programmatic survey/message starts. Callback payloads are forwarded as JSON strings by the mobile wrappers.

val hooks = ScreebHooks(
version = "1.0.0",
callbacks = mapOf(
"onSurveyShowed" to { payload -> /* handle hook payload */ },
),
)

For complete hook payload definitions, see the JS tag hooks reference.

Privacy helpersโ€‹

view.screebMaskText()

view.screebNoCapture()

view.screebId("checkout-button")

Type definitionsโ€‹

data class ScreebHooks( val version: String, val callbacks: Map<String, suspend (String) -> Any?> = emptyMap(), )

data class ScreebInitOptions( val isDebugMode: Boolean = false, val disableMirror: Boolean = false, )