Flutter developer APIs

Last updated:

This document describes the Pendo Flutter 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.20+

Return type Public API method - Dart Description
Future<void> setDebugMode(bool isDebugEnabled)

Enables/disables debug log from Pendo SDK.

This API can be called anywhere in your code and will be valid after startSession has been called.

 

Pendo Class Public API - SDK Version 2.12+

Return type Public API method - Dart Description
static PendoFlutterPlugin PendoFlutterPlugin Returns a shared instance of the PendoFlutterPlugin.
Future<void> setup(String appKey, [Map<String, dynamic>? appParams])

Initializes the Pendo SDK. Call this API in In the application main file (lib/main.dart).

This API should be used instead of initSDK and initSDKWithoutVisitor, which will be deprecated in future versions. 

Future<void> startSession(String visitorId, String accountId, Map<String, dynamic>? visitorData, Map<String, dynamic>? accountData)

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.

To generate an anonymous visitor, pass null as the visitorId.

This API should be used instead of switchVisitor, which will be deprecated in future versions. 

Must be called after the SDK is initialized.

Future<void> endSession()

Ends the active session and stops collecting analytics or showing guides to the user. More details here.

Must be called after the SDK is initialized.

Future<void> clearVisitor()

Ends the active session and starts a new session with an anonymous visitor.

Must be called after the SDK is initialized.

Future<void> setVisitorData(Map<String, dynamic> visitorData)

Updates the visitor metadata. 

Must be called after the SDK is initialized.

Future<void> setAccountData(Map<String, dynamic> accountData)

Update the account metadata

Must be called after the SDK is initialized.

Future<String?> getVisitorId() Property: Returns the ID of the visitor in the active session. 
Future<String?> getAccountId() Property: Returns the ID for the account in the active session. 
Future<void> setAccountId(String accountId) Property: Sets the ID for the account in the active session. 
Future<void> track(String event, Map<String, dynamic> properties)

Sends a track event with the specified properties.

Must be called after the SDK is initialized.

Future<void> dismissVisibleGuides() Dismisses all visible guides.
Future<void> pauseGuides(bool dismissGuides)

Pauses any guides 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.

Future<void>
resumeGuides()

Resumes showing guides during the active session. Should only be used after pauseGuides. 

Must be called after the SDK is initialized.

Future<String?> getDeviceId() 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.

 

SDK Installation

Instructions for installing the Pendo Flutter SDK can be found on the Github

Was this article helpful?
1 out of 2 found this helpful