Skip to main content
Version: Flutter SDK

Reference

Complete reference for the Screeb Flutter SDK.

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

Methods by capabilityโ€‹

Lifecycleโ€‹

MethodDescriptionMore
initSdk(String channelId, {String? userId, Map<String, dynamic>? properties, Map<String, dynamic>? initOptions, Map<String, dynamic>? hooks, String? language}): Future<bool?>Provides a way to initialize the SDK with a specific channel ID Call this method first elsewhere subsequent calls will fail Providing a [channelId] is mandatory, please visit your account to find the identifiers๐Ÿ‘‰
closeSdk(): Future<bool?>Provide a way to stop the SDK Its the opposite of initSdk๐Ÿ‘‰

Identityโ€‹

MethodDescriptionMore
setIdentity(String userId, {Map<String, dynamic>? properties}): Future<bool?>Provides an id for the user of the app with optional [properties] Providing a [userId] is important to sharpen the Screeb targeting engine and avoid survey triggering more than necessary.๐Ÿ‘‰
setProperties(Map<String, dynamic>? properties): Future<bool?>Send to Screeb backend the user's custom [properties] This api call is important to trigger a survey where the targeting is configured using visitor properties parameters.๐Ÿ‘‰
setProperty(Map<String, dynamic>? properties): Future<bool?>Deprecated alias for [setProperties].๐Ÿ‘‰
resetIdentity(): Future<bool?>Provide a way to reset the identity of the user You can use it on the disconnection of a user for example to make it anonymous๐Ÿ‘‰
getIdentity(): Future<Map<String, dynamic>?>Provides a way to get the current visitor identity๐Ÿ‘‰

Groupsโ€‹

MethodDescriptionMore
assignGroup(String? groupType, String groupName, {Map<String, dynamic>? properties}): Future<bool?>Send to Screeb backend a group assignation for current user [properties] This api call is important to improve analysis.๐Ÿ‘‰
unassignGroup(String? groupType, String groupName, Map<String, dynamic>? properties): Future<bool?>Send to Screeb backend a group unassignation for current user [properties] This api call is important to improve analysis.๐Ÿ‘‰

Trackingโ€‹

MethodDescriptionMore
trackEvent(String eventId, {Map<String, dynamic>? properties}): Future<bool?>Send to Screeb backend a tracking [eventId] with optional [properties]๐Ÿ‘‰
trackScreen(String screen, {Map<String, dynamic>? properties}): Future<bool?>Send to Screeb backend a tracking [screen] name with optional [properties] This api call is important to trigger a survey where the targeting is configured using screens parameters.๐Ÿ‘‰

Surveysโ€‹

MethodDescriptionMore
startSurvey(String surveyId, { bool allowMultipleResponses = true, Map<String, dynamic>? properties, bool ignoreSurveyStatus = true, Map<String, dynamic>? hooks, String? language, String? distributionId, }): Future<bool?>Provide a way to start a survey with a specific [surveyId] You can provide optional [properties] to sharpen targeting rules You can also provide [hooks] to handle survey events๐Ÿ‘‰
closeSurvey({String? surveyId}): Future<bool?>Provide a way to close the survey Its the opposite of startSurvey-

Messagesโ€‹

MethodDescriptionMore
startMessage(String messageId, { bool allowMultipleResponses = true, Map<String, dynamic>? properties, bool ignoreMessageStatus = true, Map<String, dynamic>? hooks, String? language, String? distributionId, }): Future<bool?>Provide a way to start a message with a specific [messageId] You can provide optional [properties] to sharpen targeting rules You can also provide [hooks] to handle message events๐Ÿ‘‰
closeMessage({String? messageId}): Future<bool?>Provide a way to close the message Its the opposite of startMessage๐Ÿ‘‰

Session replayโ€‹

MethodDescriptionMore
sessionReplayStart(): Future<bool?>Provide a way to start session replay recording๐Ÿ‘‰
sessionReplayStop(): Future<bool?>Provide a way to stop session replay recording Its the opposite of sessionReplayStart๐Ÿ‘‰

Debugโ€‹

MethodDescriptionMore
debug(): Future<String?>Provide a way to get various debug informations๐Ÿ‘‰
debugTargeting(): Future<String?>Provide a way to debug targeting rules If you don't know why your survey isn't showing you can use this command to print debug log๐Ÿ‘‰

Privacy helpersโ€‹

MethodDescriptionMore
ScreebMaskText({Key? key, required Widget child})Marks [child] as sensitive in Screeb session replay. The underlying native SDK masks the view instead of recording its content.๐Ÿ‘‰
ScreebNoCapture({Key? key, required Widget child})Excludes [child] from Screeb session replay capture.๐Ÿ‘‰
ScreebId(String id, {Key? key, required Widget child})Sets a stable Screeb element ID on [child] for IAM targeting.๐Ÿ‘‰

API signaturesโ€‹

Lifecycleโ€‹

initSdk(String channelId, {String? userId, Map<String, dynamic>? properties, Map<String, dynamic>? initOptions, Map<String, dynamic>? hooks, String? language}): Future<bool?>
closeSdk(): Future<bool?>

Identityโ€‹

setIdentity(String userId, {Map<String, dynamic>? properties}): Future<bool?>
setProperties(Map<String, dynamic>? properties): Future<bool?>
setProperty(Map<String, dynamic>? properties): Future<bool?>
resetIdentity(): Future<bool?>
getIdentity(): Future<Map<String, dynamic>?>

Groupsโ€‹

assignGroup(String? groupType, String groupName, {Map<String, dynamic>? properties}): Future<bool?>
unassignGroup(String? groupType, String groupName, Map<String, dynamic>? properties): Future<bool?>

Trackingโ€‹

trackEvent(String eventId, {Map<String, dynamic>? properties}): Future<bool?>
trackScreen(String screen, {Map<String, dynamic>? properties}): Future<bool?>

Surveysโ€‹

startSurvey(String surveyId, { bool allowMultipleResponses = true, Map<String, dynamic>? properties, bool ignoreSurveyStatus = true, Map<String, dynamic>? hooks, String? language, String? distributionId, }): Future<bool?>
closeSurvey({String? surveyId}): Future<bool?>

Messagesโ€‹

startMessage(String messageId, { bool allowMultipleResponses = true, Map<String, dynamic>? properties, bool ignoreMessageStatus = true, Map<String, dynamic>? hooks, String? language, String? distributionId, }): Future<bool?>
closeMessage({String? messageId}): Future<bool?>

Session replayโ€‹

sessionReplayStart(): Future<bool?>
sessionReplayStop(): Future<bool?>

Debugโ€‹

debug(): Future<String?>
debugTargeting(): Future<String?>

Privacy helpersโ€‹

ScreebMaskText({Key? key, required Widget child})
ScreebNoCapture({Key? key, required Widget child})
ScreebId(String id, {Key? key, required Widget child})

Hooksโ€‹

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

final hooks = {
'version': '1.0.0',
'onSurveyShowed': (String payload) async {
// handle hook payload
},
};

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

Privacy helpersโ€‹

ScreebMaskText(child: Text('Sensitive content'))

ScreebNoCapture(child: Text('Do not record'))

ScreebId('checkout-button', child: ElevatedButton(...))