Reference
Complete reference for the Screeb Kotlin Multiplatform SDK.
โจ New to Screeb? Start with the Install guide.
Methods by capabilityโ
Lifecycleโ
| 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. | ๐ |
closeSdk(): Boolean? | Stop the SDK. | ๐ |
Identityโ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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โ
| 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. | ๐ |
closeSurvey(surveyId: String? = null): Boolean? | Close the currently displayed survey. | - |
Messagesโ
| 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. | ๐ |
closeMessage(messageId: String? = null): Boolean? | Close the currently displayed message. | ๐ |
Session replayโ
| Method | Description | More |
|---|---|---|
sessionReplayStart(): Boolean? | Start session replay recording. | ๐ |
sessionReplayStop(): Boolean? | Stop session replay recording. | ๐ |
Debugโ
| Method | Description | More |
|---|---|---|
debug(): String? | Get SDK debug information. | ๐ |
debugTargeting(): String? | Get targeting debug information. | ๐ |
Privacy helpersโ
| Method | Description | More |
|---|---|---|
View.screebMaskText(): View | Mask a view or component in session replay. | ๐ |
UIView.screebMaskText(): UIView | Mask a view or component in session replay. | ๐ |
View.screebNoCapture(): View | Exclude a view or component from session replay capture. | ๐ |
UIView.screebNoCapture(): UIView | Exclude a view or component from session replay capture. | ๐ |
View.screebId(id: String): View | Set a stable Screeb element ID for IAM targeting. | ๐ |
UIView.screebId(id: String): UIView | Set 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, )