Reference
Introduction
The reference is your key to a comprehensive understanding of the Screeb React Native SDK.
✨ If this is your first look at the documentation, we recommend beginning with the Getting started guide.
Screeb methods
After installing the Screeb React Native SDK in your mobile application, you will have access to the SDK module methods via @screeb/react-native.
Use the following syntax:
import { methodName } from "@screeb/react-native";
methodName(argument1, argument2, ...);
| Method | Definition | More |
|---|---|---|
initSdk | The initSdk method starts the SDK and associates the current session to your Screeb project. Your channel identifier must be passed. Optionally, this method can identify the current user. If no user identifier is provided, an anonymous visitor session is created. You will be able to later change the current user by using the setIdentity method. | 👉 |
closeSdk | The closeSdk method shutdowns the Screeb SDK. It is the opposite to initSdk. | 👉 |
setIdentity | The setIdentity method tells Screeb who the current user is. When Screeb is only installed on the logged page, please identify users using the initSdk method instead. This method allows identifying users lazily, on user login. | 👉 |
resetIdentity | The resetIdentity method tells Screeb to reset the current user session and switch to an anonymous user. Please note it won't disable the React Native SDK until you call the closeSdk command. | 👉 |
getIdentity | The getIdentity method returns the current visitor identity (anonymous id and user id). | |
setProperties | The setProperties method associates some contextual properties to the current user session. You will be able to personalize surveys and target questions to the right audience. | 👉 |
assignGroup | The assignGroup method assigns the current user to a Screeb segment. Some properties can be passed to the method to contextualize the segment. | 👉 |
unassignGroup | The unassignGroup method unassigns the current user from a Screeb segment. | 👉 |
trackEvent | The trackEvent method tracks actions performed by current user, along with properties describing the event. | 👉 |
trackScreen | The trackScreen method tracks the screen/view of the current user, along with properties describing the event. | 👉 |
startSurvey | The startSurvey method starts a survey by providing its id. Optionally, this command can prevent a user to see a single survey multiple times. Please note that running a survey using startSurvey will require a developer: to be autonomous, use the Screeb targeting engine instead. | 👉 |
closeSurvey | The closeSurvey method closes the current survey. Optionally, a survey id can be passed to close a specific survey. | |
startMessage | The startMessage method starts a message by providing its id. | |
closeMessage | The closeMessage method closes the current message. Optionally, a message id can be passed to close a specific message. | |
sessionReplayStart | The sessionReplayStart method starts session replay recording. | |
sessionReplayStop | The sessionReplayStop method stops session replay recording. | |
debug | The debug method prints the current configuration of Screeb SDK, with channel id, user id, session duration... | 👉 |
debugTargeting | The debugTargeting method prints the status of each targeting rule for each survey of your account. | 👉 |