Skip to content
Open Screeb

Every public method of @screeb/react-native, with its signature.

Complete reference for @screeb/react-native. New to Screeb? Start with the install guide.

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. Guide
closeSdk(): Promise<void> Stop the SDK. Guide
Method Description More
setIdentity(userId: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> Identify the current user with optional properties. Guide
setProperties(properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> Send visitor properties without changing the identity. Guide
resetIdentity(): Promise<void> Reset the current visitor identity. Guide
setAnonymousId(anonymousId: string): Promise<void> Tell Screeb which anonymous id your CDP already uses for the current visitor. Guide
getIdentity(): Promise<{ [key: string]: unknown; } | null> Get the current visitor identity and properties. Guide
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. Guide
unassignGroup(type: string | null, name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> Remove the current user from a group. Guide
Method Description More
trackEvent(name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> Track a custom event. Guide
trackScreen(name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void> Track a screen navigation event. Guide
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. Guide
closeSurvey(surveyId?: string): Promise<void> Close the currently displayed survey. -
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. Guide
closeMessage(messageId?: string): Promise<void> Close the currently displayed message. Guide
Method Description More
sessionReplayStart(): Promise<void> Start session replay recording. Guide
sessionReplayStop(): Promise<void> Stop session replay recording. Guide
Method Description More
debug(): Promise<string> Get SDK debug information. Guide
debugTargeting(): Promise<string> Get targeting debug information. Guide
Method Description More
ScreebMaskText(props: ScreebPrivacyViewProps) Mask a view or component in session replay. Guide
ScreebNoCapture(props: ScreebPrivacyViewProps) Exclude a view or component from session replay capture. Guide
ScreebId({ id, ...props }: ScreebIdProps) Set a stable Screeb element ID for IAM targeting. Guide
Method Description More
handleDeepLink(url: string): Promise<void> Forward a Screeb deep link to the SDK, so editor, survey and message links open in-app. -
initSdk(channelId: string, userId?: string, properties?: Record<string, unknown> | Map<string, unknown>, hooks?: HookMap, initOptions?: InitOptions, language?: string): Promise<void>
closeSdk(): Promise<void>
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>
setAnonymousId(anonymousId: string): Promise<void>
getIdentity(): Promise<{ [key: string]: unknown; } | null>
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>
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>
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>
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>
sessionReplayStart(): Promise<void>
sessionReplayStop(): Promise<void>
debug(): Promise<string>
debugTargeting(): Promise<string>
ScreebMaskText(props: ScreebPrivacyViewProps)
ScreebNoCapture(props: ScreebPrivacyViewProps)
ScreebId({ id, ...props }: ScreebIdProps)
handleDeepLink(url: string): Promise<void>

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.

<ScreebMaskText>
<Text>Sensitive content</Text>
</ScreebMaskText>
<ScreebNoCapture>
<Text>Do not record</Text>
</ScreebNoCapture>
<ScreebId id="checkout-button">
<Button title="Checkout" />
</ScreebId>
type HookMap = {
version?: string;
[key: string]: unknown;
};
type InitOptions = {
isDebugMode?: boolean;
disableMirror?: boolean;
};
type ScreebPrivacyViewProps = ViewProps;
type ScreebIdProps = ViewProps & {
id: string;
};