Reference
Complete reference for @screeb/react-native.
โจ New to Screeb? Start with the Install guide.
Methods by capabilityโ
Lifecycleโ
| Method | Description | More |
|---|---|---|
initSdk(channelId: string, userId?: string, properties?: Record<string, unknown> | Map<string, unknown>, hooks?: HookMap, initOptions?: InitOptions, language?: string): Promise<void> | Initialize the Screeb SDK. | ๐ |
closeSdk(): Promise<void> | Stop the SDK. | ๐ |
Identityโ
| Method | Description | More |
|---|---|---|
setIdentity(userId: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> | Identify the current user with optional properties. | ๐ |
setProperties(properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> | Send visitor properties without changing the identity. | ๐ |
resetIdentity(): Promise<void> | Reset the current visitor identity. | ๐ |
getIdentity(): Promise<{ [key: string]: unknown; } | null> | Get the current visitor identity and properties. | ๐ |
Groupsโ
| Method | Description | More |
|---|---|---|
assignGroup(type: string | null, name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> | Assign the current user to a group. | ๐ |
unassignGroup(type: string | null, name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> | Remove the current user from a group. | ๐ |
Trackingโ
| Method | Description | More |
|---|---|---|
trackEvent(name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> | Track a custom event. | ๐ |
trackScreen(name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> | Track a screen navigation event. | ๐ |
Surveysโ
| Method | Description | More |
|---|---|---|
startSurvey(surveyId: string, allowMultipleResponses?: boolean, hiddenFields?: Record<string, unknown> | Map<string, unknown> | null, ignoreSurveyStatus?: boolean, hooks?: HookMap, language?: string, distributionId?: string): Promise<void> | Start a specific survey programmatically. | ๐ |
closeSurvey(surveyId?: string): Promise<void> | Close the currently displayed survey. | - |
Messagesโ
| Method | Description | More |
|---|---|---|
startMessage(messageId: string, allowMultipleResponses?: boolean, hiddenFields?: Record<string, unknown> | Map<string, unknown> | null, ignoreMessageStatus?: boolean, hooks?: HookMap, language?: string, distributionId?: string): Promise<void> | Start a specific message programmatically. | ๐ |
closeMessage(messageId?: string): Promise<void> | Close the currently displayed message. | ๐ |
Session replayโ
| Method | Description | More |
|---|---|---|
sessionReplayStart(): Promise<void> | Start session replay recording. | ๐ |
sessionReplayStop(): Promise<void> | Stop session replay recording. | ๐ |
Debugโ
| Method | Description | More |
|---|---|---|
debug(): Promise<string> | Get SDK debug information. | ๐ |
debugTargeting(): Promise<string> | Get targeting debug information. | ๐ |
Privacy helpersโ
| Method | Description | More |
|---|---|---|
ScreebMaskText(props: ScreebPrivacyViewProps) | Mask a view or component in session replay. | ๐ |
ScreebNoCapture(props: ScreebPrivacyViewProps) | Exclude a view or component from session replay capture. | ๐ |
ScreebId({ id, ...props }: ScreebIdProps) | Set a stable Screeb element ID for IAM targeting. | ๐ |
API signaturesโ
Lifecycleโ
initSdk(channelId: string, userId?: string, properties?: Record<string, unknown> | Map<string, unknown>, hooks?: HookMap, initOptions?: InitOptions, language?: string): Promise<void>
closeSdk(): Promise<void>
Identityโ
setIdentity(userId: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>
setProperties(properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>
resetIdentity(): Promise<void>
getIdentity(): Promise<{ [key: string]: unknown; } | null>
Groupsโ
assignGroup(type: string | null, name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>
unassignGroup(type: string | null, name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>
Trackingโ
trackEvent(name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>
trackScreen(name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>
Surveysโ
startSurvey(surveyId: string, allowMultipleResponses?: boolean, hiddenFields?: Record<string, unknown> | Map<string, unknown> | null, ignoreSurveyStatus?: boolean, hooks?: HookMap, language?: string, distributionId?: string): Promise<void>
closeSurvey(surveyId?: string): Promise<void>
Messagesโ
startMessage(messageId: string, allowMultipleResponses?: boolean, hiddenFields?: Record<string, unknown> | Map<string, unknown> | null, ignoreMessageStatus?: boolean, hooks?: HookMap, language?: string, distributionId?: string): Promise<void>
closeMessage(messageId?: string): Promise<void>
Session replayโ
sessionReplayStart(): Promise<void>
sessionReplayStop(): Promise<void>
Debugโ
debug(): Promise<string>
debugTargeting(): Promise<string>
Privacy helpersโ
ScreebMaskText(props: ScreebPrivacyViewProps)
ScreebNoCapture(props: ScreebPrivacyViewProps)
ScreebId({ id, ...props }: ScreebIdProps)
Hooksโ
Hooks can be passed to initialization and programmatic survey/message starts. Callback payloads are forwarded as JSON strings by the mobile wrappers.
const hooks = {
version: "1.0.0",
onSurveyShowed: async (payload: string) => {
// handle hook payload
},
};
For complete hook payload definitions, see the JS tag hooks reference.
Privacy helpersโ
<ScreebMaskText>
<Text>Sensitive content</Text>
</ScreebMaskText>
<ScreebNoCapture>
<Text>Do not record</Text>
</ScreebNoCapture>
<ScreebId id="checkout-button">
<Button title="Checkout" />
</ScreebId>
Type definitionsโ
type HookMap = {
version?: string;
[key: string]: unknown;
};
type InitOptions = {
isDebugMode?: boolean;
disableMirror?: boolean;
};
type ScreebPrivacyViewProps = ViewProps;
type ScreebIdProps = ViewProps & {
id: string;
};