Reference
Every public method of @screeb/react-native, with its signature.
Complete reference for @screeb/react-native. New to Screeb? Start with the install guide.
Methods by capability
Section titled “Methods by capability”Lifecycle
Section titled “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. | Guide |
closeSdk(): Promise<void> |
Stop the SDK. | Guide |
Identity
Section titled “Identity”| 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 |
Groups
Section titled “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. | 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 |
Tracking
Section titled “Tracking”| 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 |
Surveys
Section titled “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. | Guide |
closeSurvey(surveyId?: string): Promise<void> |
Close the currently displayed survey. | - |
Messages
Section titled “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. | Guide |
closeMessage(messageId?: string): Promise<void> |
Close the currently displayed message. | Guide |
Session replay
Section titled “Session replay”| 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 |
Privacy helpers
Section titled “Privacy helpers”| 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. | - |
API signatures
Section titled “API signatures”Lifecycle
Section titled “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
Section titled “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>setAnonymousId(anonymousId: string): Promise<void>getIdentity(): Promise<{ [key: string]: unknown; } | null>Groups
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “Session replay”sessionReplayStart(): Promise<void>sessionReplayStop(): Promise<void>debug(): Promise<string>debugTargeting(): Promise<string>Privacy helpers
Section titled “Privacy helpers”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.
Privacy helpers
Section titled “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
Section titled “Type definitions”type HookMap = { version?: string; [key: string]: unknown;};
type InitOptions = { isDebugMode?: boolean; disableMirror?: boolean;};
type ScreebPrivacyViewProps = ViewProps;
type ScreebIdProps = ViewProps & { id: string;};