Skip to main content
Version: React Native SDK

Reference

Complete reference for @screeb/react-native.

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

Methods by capabilityโ€‹

Lifecycleโ€‹

MethodDescriptionMore
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โ€‹

MethodDescriptionMore
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โ€‹

MethodDescriptionMore
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โ€‹

MethodDescriptionMore
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โ€‹

MethodDescriptionMore
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โ€‹

MethodDescriptionMore
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โ€‹

MethodDescriptionMore
sessionReplayStart(): Promise<void>Start session replay recording.๐Ÿ‘‰
sessionReplayStop(): Promise<void>Stop session replay recording.๐Ÿ‘‰

Debugโ€‹

MethodDescriptionMore
debug(): Promise<string>Get SDK debug information.๐Ÿ‘‰
debugTargeting(): Promise<string>Get targeting debug information.๐Ÿ‘‰

Privacy helpersโ€‹

MethodDescriptionMore
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;
};