This document describes the Pendo React Native SDK Public APIs.
Note: The information here is relevant for SDK versions lower than 3.0. For API documentation for the latest Pendo SDK versions and information about the integration process, refer to our GitHub.
Pendo Class Public API - SDK Version 2.22+
Public API Method | Description |
screenContentChanged() | Used when Pendo is not able to tag specific components in the app (delayed elements, components with state change, etc). The API needs to be called by the developer when the component becomes visible/on each state change. Must be called after the SDK is initialized. |
Pendo Class Public API - SDK Version 2.21+
Public API Method | Description |
WithPendoReactNavigation(NavigationContainer) | Only for apps that use React Navigation library. This function wraps the navigation container to track the navigation state. |
Pendo Class Public API - SDK Version 2.10+
Public API Method | Description |
setup(appKey: string, navigationOptions: NavigationOptions, pendoOptions?: PendoOptions) | Initializes the Pendo SDK. PendoOptions should always be null. This API should be used instead of initSDK and initSDKWithoutVisitor, which will be deprecated in future versions. |
startSession(visitorId: string, accountId: string, visitorData: object, accountData: object) |
Starts mobile session with provided visitor and account information. If a session is already in progress, the session will end and a new session will start. |
endSession() |
Ends the active session and stops collection analytics or showing guides to the user. See Exclude Pendo Mobile for specific users. Must be called after the SDK is initialized |
clearVisitor() |
Ends the active session and starts a new session with an anonymous visitor. Must be called after the SDK is initialized. |
setVisitorData(visitorData: object) |
Updates the visitor metadata Must be called after the SDK is initialized. |
setAccountData(accountData: object) |
Updates the account metadata Must be called after the SDK is initialized. |
async getVisitorId(): Promise<string | null> | Returns the Visitor ID in the active session |
async getAccountId(): Promise<string | null> | Sets the Account ID for the active session |
track(name: string, params: object)
|
Sends a Track Event with the specified properties. Must be called after the SDK is initialized. |
dismissVisibleGuides() |
Dismisses all visible guides |
pauseGuides(dismissGuides:boolean) |
Pauses any guide from showing during an active session If dismissGuides is true, then all visible guides will be dismissed. Must be called after the SDK is initialized. |
resumeGuides() |
Resumes showing guides during the active session. Should only be used after pauseGuides. |
async getDeviceId(): Promise<string | null>
|
Returns the device's unique Pendo-generated id. The device id is used by Pendo to generate a unique id for each anonymous visitor. This id is unique per application. |
withPendoRN() | Only for apps that use React Navigation library. This function wraps the navigation container to track the navigation state. |