Reference
Complete reference for the Screeb Flutter SDK.
โจ New to Screeb? Start with the Install guide.
Methods by capabilityโ
Lifecycleโ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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โ
| Method | Description | More |
|---|---|---|
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(...))