Skip to content
Open Screeb

Every public method of Screeb KMP SDK, with its signature.

Complete reference for the Screeb Kotlin Multiplatform SDK. New to Screeb? Start with the install guide.

Method Description More
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. Guide
closeSdk(): Boolean? Stop the SDK. Guide
Method Description More
setIdentity(userId: String, properties: Map<String, Any>? = null): Boolean? Identify the current user with optional properties. Guide
setProperties(properties: Map<String, Any>? = null): Boolean? Send visitor properties without changing the identity. Guide
resetIdentity(): Boolean? Reset the current visitor identity. Guide
setAnonymousId(anonymousId: String): Boolean? Adopts the anonymous id your CDP already uses (Amplitude device id, Segment or RudderStack anonymous id) on the current respondent, which stays anonymous. Call it right after [initSdk]: the call is resolved during init. 5 to 128 characters. Guide
getIdentity(): Map<String, Any>? Get the current visitor identity and properties. Guide
Method Description More
assignGroup(groupType: String? = null, groupName: String, properties: Map<String, Any>? = null): Boolean? Assign the current user to a group. Guide
unassignGroup(groupType: String? = null, groupName: String, properties: Map<String, Any>? = null): Boolean? Remove the current user from a group. Guide
Method Description More
trackEvent(name: String, properties: Map<String, Any>? = null): Boolean? Track a custom event. Guide
trackScreen(name: String, properties: Map<String, Any>? = null): Boolean? Track a screen navigation event. Guide
Method Description More
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. Guide
closeSurvey(surveyId: String? = null): Boolean? Close the currently displayed survey. -
Method Description More
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. Guide
closeMessage(messageId: String? = null): Boolean? Close the currently displayed message. Guide
Method Description More
sessionReplayStart(): Boolean? Start session replay recording. Guide
sessionReplayStop(): Boolean? Stop session replay recording. Guide
Method Description More
debug(): String? Get SDK debug information. Guide
debugTargeting(): String? Get targeting debug information. Guide
Method Description More
View.screebMaskText(): View Mask a view or component in session replay. Guide
UIView.screebMaskText(): UIView Mask a view or component in session replay. Guide
View.screebNoCapture(): View Exclude a view or component from session replay capture. Guide
UIView.screebNoCapture(): UIView Exclude a view or component from session replay capture. Guide
View.screebId(id: String): View Set a stable Screeb element ID for IAM targeting. Guide
UIView.screebId(id: String): UIView Set a stable Screeb element ID for IAM targeting. Guide
Method Description More
handleDeepLink(url: String?) Forward an incoming deep link (e.g. screeb-<channel-id>://inspector) to the SDK so it can act on it - used by the in-app message editor / native inspector. Pass the URL of the launch (or new) intent. On Android, call this from your Activity’s onCreate and onNewIntent. -
initSdk(channelId: String, userId: String? = null, properties: Map<String, Any>? = null, hooks: ScreebHooks? = null, initOptions: ScreebInitOptions? = null, language: String? = null): Boolean?
closeSdk(): Boolean?
setIdentity(userId: String, properties: Map<String, Any>? = null): Boolean?
setProperties(properties: Map<String, Any>? = null): Boolean?
resetIdentity(): Boolean?
setAnonymousId(anonymousId: String): Boolean?
getIdentity(): Map<String, Any>?
assignGroup(groupType: String? = null, groupName: String, properties: Map<String, Any>? = null): Boolean?
unassignGroup(groupType: String? = null, groupName: String, properties: Map<String, Any>? = null): Boolean?
trackEvent(name: String, properties: Map<String, Any>? = null): Boolean?
trackScreen(name: String, properties: Map<String, Any>? = null): Boolean?
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?
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?
sessionReplayStart(): Boolean?
sessionReplayStop(): Boolean?
debug(): String?
debugTargeting(): String?
View.screebMaskText(): View
UIView.screebMaskText(): UIView
View.screebNoCapture(): View
UIView.screebNoCapture(): UIView
View.screebId(id: String): View
UIView.screebId(id: String): UIView
handleDeepLink(url: String?)

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.

view.screebMaskText()
view.screebNoCapture()
view.screebId("checkout-button")
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, )