### Pendo Mobile SDK - initSDKWithoutVisitor Migration Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/ios-2.x-to-3.x-migration.md Guides on migrating from `initSDKWithoutVisitor` to the `setup` method in Pendo SDK v3.x. ```APIDOC ## Pendo Mobile SDK - initSDKWithoutVisitor Migration ### Description The `initSDKWithoutVisitor` method is replaced by the `setup` API in Pendo SDK v3.x. Use `setup` to initialize the SDK without immediately starting a visitor session. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example #### Deprecated (2.x): ```swift PendoManager.shared().initSDKWithoutVisitor("someAppKey", with: nil) ``` #### Recommended (3.x): ```swift PendoManager.shared().setup("someAppKey", with: nil) ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Start Session API Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/ios/pnddocs/native-ios.md Initiates a new session to track a visitor's analytics and enable the display of guides. This API can be called at any point after the initial setup. ```APIDOC ## POST /pendo-mobile-sdk ### Description Starts a new Pendo session for tracking user analytics and displaying guides. ### Method POST ### Endpoint This is a client-side SDK method, not a network endpoint. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **visitorId** (String) - Required - The unique identifier for the visitor. - **accountId** (String) - Required - The identifier for the account the visitor belongs to. - **visitorData** (Dictionary) - Optional - Additional data associated with the visitor. - **accountData** (Dictionary) - Optional - Additional data associated with the account. ### Request Example ```swift var visitorId = "John Doe" var accountId = "ACME" var visitorData: [String : any Hashable] = ["age": 27, "country": "USA"] var accountData: [String : any Hashable] = ["Tier": 1, "size": "Enterprise"] PendoManager.shared().startSession(visitorId, accountId:accountId, visitorData:visitorData, accountData:accountData) ``` ### Response #### Success Response (200) This method does not return a value. #### Response Example N/A ``` -------------------------------- ### Replace initSDK with setup and startSession (Swift) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/ios-2.x-to-3.x-migration.md Migrate from the deprecated `initSDK` method to the new `setup` and `startSession` APIs. Initialization parameters are now passed directly to these new methods. ```swift // 2.x (deprecated): // let pendoInitParams = PendoInitParams() // pendoInitParams.visitorId = "someVisitorID" // pendoInitParams.accountId = "someAccountID" // pendoInitParams.visitorData = ["age" : 27, "country" : "USA"] // pendoInitParams.accountData = ["tier" : 1, "size" : "Enterprise"] // PendoManager.shared().initSDK("someAppKey", initParams: pendoInitParams) // 3.x: // establish connection to server PendoManager.shared().setup("someAppKey") // start a session PendoManager.shared().startSession("someVisitorID", accountId: "someAccountID", visitorData: ["age" : 27, "country" : "USA"], accountData: ["tier" : 1, "size" : "Enterprise"]) ``` -------------------------------- ### Replace initSDKWithoutVisitor with setup (Swift) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/ios-2.x-to-3.x-migration.md The `initSDKWithoutVisitor` method is deprecated. Use the `setup` API instead, optionally providing `nil` for the `with` parameter. ```swift // 2.x (deprecated): // PendoManager.shared().initSDKWithoutVisitor("someAppKey", with: nil) // 3.x: PendoManager.shared().setup("someAppKey", with: nil) ``` -------------------------------- ### Setup and Start Pendo Session in Swift Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/other/native-with-flutter-components.md This Swift code demonstrates how to set up the Pendo SDK with an API key and start a user session with associated visitor and account data. It also shows how to run the Flutter engine and register the Pendo Flutter Plugin. ```swift import UIKit import Flutter import FlutterPluginRegistrant import Pendo @UIApplicationMain class AppDelegate: FlutterAppDelegate { lazy var flutterEngine = FlutterEngine(name: "my flutter engine") override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // connect to Pendo's server PendoManager.shared().setup("YOUR_API_KEY_HERE") // start a session let visitorId = "John Doe" let accountId = "ACME" let visitorData: [String : any Hashable] = ["age": 27, "country": "USA"] let accountData: [String : any Hashable] = ["Tier": 1, "size": "Enterprise"] PendoManager.shared().startSession(visitorId, accountId:accountId, visitorData:visitorData, accountData:accountData) // Run the default Dart entrypoint with a default Flutter route flutterEngine.run() // Connect the plugin to the iOS platform code GeneratedPluginRegistrant.register(with: self.flutterEngine) // Register the Pendo Plugin PendoFlutterPlugin.registerWithRegistry(self.flutterEngine) return super.application(application, didFinishLaunchingWithOptions: launchOptions); } } ``` -------------------------------- ### Pendo Mobile SDK - initSDK Migration Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/ios-2.x-to-3.x-migration.md Explains how to migrate from the deprecated `initSDK` method to the new `setup` and `startSession` methods in Pendo SDK v3.x. ```APIDOC ## Pendo Mobile SDK - initSDK Migration ### Description Starting from Pendo SDK v3.x, the `initSDK` method is deprecated. You should now use the `setup` method for establishing a connection to the server and the `startSession` method to initiate a user session, passing initialization parameters directly to these new methods. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example #### Deprecated (2.x): ```swift // set session parameters let pendoInitParams = PendoInitParams() pendoInitParams.visitorId = "someVisitorID" pendoInitParams.accountId = "someAccountID" pendoInitParams.visitorData = ["age" : 27, "country" : "USA"] pendoInitParams.accountData = ["tier" : 1, "size" : "Enterprise"] // establish connection to server and start a session PendoManager.shared().initSDK("someAppKey", initParams: pendoInitParams) ``` #### Recommended (3.x): ```swift // establish connection to server PendoManager.shared().setup("someAppKey") // start a session PendoManager.shared().startSession("someVisitorID", accountId: "someAccountID", visitorData: ["age" : 27, "country" : "USA"], accountData: ["tier" : 1, "size" : "Enterprise"]) ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Start Pendo Session with JWT (Swift) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/ios-2.x-to-3.x-migration.md Demonstrates how to start a Pendo session using JWT authentication. The 3.x version introduces a `jwt` sub-namespace for this functionality. ```swift PendoManager.shared().startSession("someJWT", "someSigningKeyName") ``` ```swift PendoManager.shared().jwt.startSession("someJWT", "someSigningKeyName") ``` -------------------------------- ### Start Pendo Session (Swift) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/ios/pnddocs/native-ios.md Initiates a new session to track a visitor's analytics and display guides. Requires visitor and account information, which can be optionally provided. ```swift var visitorId = "John Doe" var accountId = "ACME" var visitorData: [String : any Hashable] = ["age": 27, "country": "USA"] var accountData: [String : any Hashable] = ["Tier": 1, "size": "Enterprise"] PendoManager.shared().startSession(visitorId, accountId:accountId, visitorData:visitorData, accountData:accountData) ``` -------------------------------- ### Update Pendo Flutter SDK: initSDKWithoutVisitor Migration (Dart) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/flutter-2.x-to-3.x-migration.md This code example shows the transition for `initSDKWithoutVisitor` in the Pendo Flutter SDK from v2.x to v3.x. Version 3.x simplifies this by using the `setup` method, removing the need for a dedicated `initSDKWithoutVisitor` function. ```dart await PendoFlutterPlugin.initSDKWithoutVisitor('someAppKey', null ); ``` ```dart await PendoFlutterPlugin.setup('someAppKey', null ); ``` -------------------------------- ### Setup and Start Pendo Session in Objective-C Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/other/native-with-flutter-components.md This Objective-C code illustrates setting up the Pendo SDK with an API key and initiating a user session, including visitor and account details. It also covers running the Flutter engine and registering the Pendo Flutter Plugin. ```objectivec @import UIKit; @import Flutter; @import Pendo; #import #import "PendoFlutterPlugin.h" #import "AppDelegate.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // connect to Pendo's server [[PendoManager sharedManager] setup:@"YOUR_API_KEY_HERE"]; // start a session [[PendoManager sharedManager] startSession:@"John Doe" accountId:@"ACME" visitorData:@{@"age": @27, @"country": @"USA"} accountData:@{@"Tier": @1, @"size": @"Enterprise"}]; // Run the default Dart entrypoint with a default Flutter route FlutterEngine *flutterEngine = [[FlutterEngine alloc] initWithName:@"my flutter engine"]; [flutterEngine run]; // Connect the plugin to the iOS platform code [GeneratedPluginRegistrant registerWithRegistry:flutterEngine]; // Register the Pendo Plugin [PendoFlutterPlugin registerWithRegistry:flutterEngine]; return YES; } @end ``` -------------------------------- ### Setup Pendo SDK with GoRouter Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/android/pnddocs/flutter-android.md Configures the Pendo SDK for use with the GoRouter navigation library by specifying `NavigationLibrary.GoRouter` during the setup process. ```dart PendoSDK.setup(pendoKey, navigationLibrary: NavigationLibrary.GoRouter); ``` -------------------------------- ### Pendo Initialization Callbacks (Java) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Implement PendoPhasesCallbackInterface to handle session initialization status. onInitComplete is called when a session starts successfully and guides are ready. onInitFailed is called if there's an issue connecting to Pendo's servers or starting a session. ```java class PendoCallbackImp implements PendoPhasesCallbackInterface { @Override public void onInitComplete() { Log.d("The session has begun"); } @Override public void onInitFailed() { Log.d("Session failed to begin"); } } // Setup Pendo with the callback implementation Pendo.setup(appContext, "your.app.key", null, new PendoCallbackImp()); ``` -------------------------------- ### Setup Pendo SDK Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/android/pnddocs/flutter-android.md Initializes the Pendo SDK with your application's API key. This should be called at the beginning of your app's execution. Ensure you replace 'YOUR_API_KEY_HERE' with your actual Pendo API key. ```dart import 'package:pendo_sdk/pendo_sdk.dart'; var pendoKey = 'YOUR_API_KEY_HERE'; await PendoSDK.setup(pendoKey); ``` -------------------------------- ### Configure Local Maven Repository for Pendo SDK (Gradle) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/android/pnddocs/android_sdk_manual_installation.md Adds a local directory containing the Pendo SDK as a Maven repository in your Gradle build file. This is necessary for manually installing the SDK when not using remote repositories. ```java repositories { maven { url = uri("/path/to/local/file") } } ``` -------------------------------- ### Setup Pendo SDK Connection in C# Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/xamarin-maui-apis.md Shows how to establish a connection with Pendo's server using the Setup method. This method requires an App Key and should be called once in the application's OnStart() method before any session-related APIs are invoked. ```csharp void Setup(string appKey) ``` ```csharp Pendo.Setup("your.app.key"); ``` -------------------------------- ### Start Pendo Session (Objective-C) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/ios/pnddocs/native-ios.md Initiates a new session to track a visitor's analytics and display guides using Objective-C. Supports optional visitor and account data. ```objectivec [[PendoManager sharedManager] startSession:@"someVisitor" accountId:@"someAccount" visitorData:@{@"age": @27, @"country": @"USA"} accountData:@{@"Tier": @1, @"size": @"Enterprise"}]; ``` -------------------------------- ### Replace initSDKWithoutVisitor with setup in Android (Kotlin) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/android-2.x-to-3.x-migration.md Demonstrates replacing the `initSDKWithoutVisitor` method with the `setup` API in Pendo SDK v3.x for establishing a connection to the server. ```Kotlin import com.pendo.sdk.Pendo // establish connection to server Pendo.initSDKWithoutVisitor( this, // Application or Activity "someAppKey", null, // PendoOptions null // PendoPhasesCallbackInterface ) ``` ```Kotlin import com.pendo.sdk.Pendo // establish connection to server Pendo.setup( this, // Context "someAppKey", null, // PendoOptions null // PendoPhasesCallbackInterface ) ``` -------------------------------- ### Setup Pendo SDK for GoRouter (Dart) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/ios/pnddocs/flutter-ios.md Configures the Pendo SDK to work with the GoRouter navigation library. This involves specifying the navigation library during setup and adding a Pendo listener to the GoRouter delegate. ```dart import 'package:pendo_sdk/pendo_sdk.dart'; PendoSDK.setup(pendoKey, navigationLibrary: NavigationLibrary.GoRouter); final GoRouter _router = GoRouter()..addPendoListenerToDelegate() class _AppState extends State { @override Widget build(BuildContext context) { return PendoActionListener( child: MaterialApp.router( routerConfig: _router, ), ); } } ``` -------------------------------- ### Setup Pendo SDK with AutoRoute Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/android/pnddocs/flutter-android.md Configures the Pendo SDK for use with the AutoRoute navigation library by specifying `NavigationLibrary.AutoRoute` during the setup process. ```dart PendoSDK.setup(pendoKey, navigationLibrary: NavigationLibrary.AutoRoute); ``` -------------------------------- ### Pause Guide Display (C#) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/flutter-apis.md Pauses the display of Pendo guides during the current session. If `dismissGuides` is true, any currently visible guide will also be dismissed. Starting a new session will re-enable guide display. ```csharp static Future pauseGuides(bool dismissGuides) async { await PendoSDK.pauseGuides(false); } ``` -------------------------------- ### Resume Guide Display (C#) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/flutter-apis.md Resumes the display of Pendo guides during the ongoing session, reversing the effect of the `pauseGuides` API. Guides will be shown according to the configured rules. ```csharp static Future resumeGuides() async { await PendoSDK.resumeGuides(); } ``` -------------------------------- ### Resume Guides with resumeGuides Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Resumes displaying guides during the ongoing session, reversing the effect of the pauseGuides API. ```java static synchronized void resumeGuides() Pendo.resumeGuides(); ``` -------------------------------- ### Specify Pendo SDK Dependency in Gradle Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/android/pnddocs/android_sdk_manual_installation.md Declares the Pendo SDK as an implementation dependency in your Android project's Gradle file, specifying the group, name, and version. ```java implementation (group:'sdk.pendo.io' , name:'pendoIO', version:'3.7.0.x', changing:true) ``` -------------------------------- ### Initialize and Start Pendo SDK Session (Kotlin) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/other/native-with-flutter-components.md Initializes the Pendo SDK with an API key and starts a user session with optional visitor and account data. This code is typically placed in the application's main entry point. ```kotlin package io.tsh.flutterloginembedding import android.app.Application import io.flutter.embedding.engine.FlutterEngine import io.flutter.embedding.engine.FlutterEngineCache import io.flutter.embedding.engine.dart.DartExecutor import io.flutter.plugins.GeneratedPluginRegistrant import sdk.pendo.io.Pendo class App : Application() { companion object { const val FLUTTER_ENGINE_ID = "newLoginEngine" } override fun onCreate() { super.onCreate() // Instantiate a FlutterEngine and val flutterEngine = FlutterEngine(this) // Execute the Dart code to pre-warm the FlutterEngine flutterEngine.dartExecutor.executeDartEntrypoint( DartExecutor.DartEntrypoint.createDefault() ) // Cache the FlutterEngine to be used by FlutterActivity FlutterEngineCache .getInstance() .put(FLUTTER_ENGINE_ID, flutterEngine) // connect to Pendo's server Pendo.setup( this, "YOUR_API_KEY_HERE", null, // PendoOptions (use only if instructed by Pendo support) null // PendoPhasesCallbackInterface (Optional) ); // start a session val visitorId = "VISITOR-UNIQUE-ID" val accountId = "ACCOUNT-UNIQUE-ID" val visitorData = HashMap() visitorData.put("age", 27) visitorData.put("country", "USA") val accountData = HashMap() accountData.put("Tier", 1) accountData.put("Size", "Enterprise") Pendo.startSession( visitorId, accountId, visitorData, accountData) // Connect the plugin GeneratedPluginRegistrant.registerWith(flutterEngine) } } ``` -------------------------------- ### PendoSDK.setup Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/rn-apis.md Establishes a connection with Pendo's server. This is a required one-time setup for the SDK. ```APIDOC ## PendoSDK.setup ### Description Initializes the Pendo SDK by establishing a connection with Pendo's servers. This method must be called once during the application's lifecycle, preferably in the main entry file, before any other Pendo APIs are invoked. ### Method `static setup` ### Endpoint N/A (Client-side static method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```typescript import { PendoSDK, NavigationLibraryType } from 'rn-pendo-sdk'; // Example using React Navigation const navigationOptions = { library: NavigationLibraryType.ReactNavigation }; PendoSDK.setup('your.app.key', navigationOptions); ``` ### Response #### Success Response (void) This method does not return a value. #### Response Example N/A ``` -------------------------------- ### Resume Guides - Swift Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-ios-apis.md The `resumeGuides` method in PendoManager resumes the display of guides during the ongoing session, reversing the effect of the `pauseGuides` method. ```swift PendoManager.shared().resumeGuides() ``` -------------------------------- ### Update initSDK to setup and startSession in Android (Kotlin) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/android-2.x-to-3.x-migration.md Replaces the deprecated `initSDK` method with the new `setup` and `startSession` APIs in Pendo SDK v3.x. Initialization parameters are now passed directly to these new methods. ```Kotlin import com.pendo.sdk.Pendo // set session parameters val pendoParams = Pendo.PendoInitParams() pendoParams.visitorId = "someVisitorID" pendoParams.accountId = "someAccountID" pendoParams.visitorData = mapOf("age" to 27, "country" to "USA") pendoParams.accountData = mapOf("tier" to 1, "size" to "Enterprise") // establish connection to server and start a session Pendo.initSDK( this, // Application or Activity "someAppKey", pendoParams ) ``` ```Kotlin import com.pendo.sdk.Pendo // establish connection to server Pendo.setup( this, // Context "someAppKey", null, // PendoOptions null // PendoPhasesCallbackInterface ) // start a session Pendo.startSession( "someVisitorID", "someAccountID", mapOf("age" to 27, "country" to "USA"), mapOf("tier" to 1, "size" to "Enterprise") ) ``` -------------------------------- ### Replace clearVisitor with startSession (Swift) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/ios-2.x-to-3.x-migration.md To clear the current visitor and start a session with anonymous data, use the `startSession` API with `nil` values for visitor and account parameters. ```swift // 2.x (deprecated): // PendoManager.shared().clearVisitor() // 3.x: // start a session with an anonymous visitor PendoManager.shared().startSession(nil, accountId:nil, visitorData:nil, accountData:nil) ``` -------------------------------- ### Start Session Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-ios-apis.md Starts a new mobile session with visitor and account information. If a session is active, it will be terminated and a new one started. Termination of the app also terminates the session. ```APIDOC ## POST /api/pendo/startSession ### Description Starts a mobile session with the provided visitor and account information. If a session is already in progress, the current session will terminate and a new session will begin. The termination of the app will also terminate the session. ### Method POST ### Endpoint /api/pendo/startSession ### Parameters #### Request Body - **visitorId** (String?) - Optional - The session visitor ID. For an anonymous visitor set to `nil` - **accountId** (String?) - Optional - The session account ID - **visitorData** ([AnyHashable : Any]?) - Optional - Additional visitor metadata - **accountData** ([AnyHashable : Any]?) - Optional - Additional account metadata ### Request Example ```json { "visitorId": "John Doe", "accountId": "ACME", "visitorData": { "age": 27, "country": "USA" }, "accountData": { "Tier": 1, "size": "Enterprise" } } ``` ### Response #### Success Response (200) This endpoint does not return a response body upon success. SDK posts notifications for success or failure. #### Response Example ```json // No response body ``` **Notifications:** - `kPNDDidSuccessfullyInitializeSDKNotification` on success. - `kPNDErrorInitializeSDKNotification` on failure. ``` -------------------------------- ### Update Pendo SDK initialization from initSDK to setup and startSession in React Native Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/react-native-2.x-to-3.x-migration.md This snippet illustrates the changes required for initializing the Pendo SDK in React Native, moving from the `initSDK` method in version 2.x to a two-step process using `setup` followed by `startSession` in version 3.x. It includes options for different navigation libraries. ```javascript import { PendoSDK, NavigationLibraryType } from 'rn-pendo-sdk'; // only if using React Native Navigation import { Navigation } from "react-native-navigation"; // set session parameters const pendoParams = {'visitorId': 'someVisitorID', 'accountId': 'someAccountID', 'vistiorData': {'age': '25', 'country': 'USA'}, 'accountData': {'tier': '1', 'size': 'Enterprise'}}; // select the correct NavigationLibraryType according to your application const navigationOptions = {library: NavigationLibraryType.ReactNavigation}; const navigationOptions = {library: NavigationLibraryType.ReactNativeNavigation, navigation: Navigation}; const navigationOptions = {library: NavigationLibraryType.Other}; // establish connection to server and start a session PendoSDK.initSdk('someAppKey', pendoParams, navigationOptions); ``` ```javascript import { PendoSDK, NavigationLibraryType } from 'rn-pendo-sdk'; // only if using React Native Navigation import { Navigation } from "react-native-navigation"; // select the correct NavigationLibraryType according to your application const navigationOptions = {library: NavigationLibraryType.ReactNavigation}; const navigationOptions = {library: NavigationLibraryType.ReactNativeNavigation, navigation: Navigation}; const navigationOptions = {library: NavigationLibraryType.Other}; // establish connection to server PendoSDK.setup('someAppKey', navigationOptions); // start a session PendoSDK.startSession('someVisitorID', 'someAccountID', {'age': '25', 'country': 'USA'}, {'tier': '1', 'size': 'Enterprise'}); ``` -------------------------------- ### startSession Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Starts a mobile session with the provided visitor and account information. Can update an ongoing session or start a new one. ```APIDOC ## POST /api/pendo/startSession ### Description Starts a mobile session with the provided visitor and account information. If a session is already in progress, the current session will terminate and a new session will begin. The termination of the app will also terminate the session. ### Method POST ### Endpoint /api/pendo/startSession ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **visitorId** (String) - Required - The session visitor ID. For an anonymous visitor set to `null`. - **accountId** (String) - Required - The session account ID. - **visitorData** (Map) - Optional - Additional visitor metadata. - **accountData** (Map) - Optional - Additional account metadata. ### Request Example ```json { "visitorId": "John Doe", "accountId": "ACME", "visitorData": { "age": 21, "country": "USA" }, "accountData": { "Tier": 1, "size": "Enterprise" } } ``` ### Response #### Success Response (200) void #### Response Example None (void return type) ``` -------------------------------- ### Setup API Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/xamarin-forms-apis.md Establishes a connection with Pendo’s server. This API must be called before any other session-related APIs. ```APIDOC ## POST /pendo/setup ### Description Establishes a connection with Pendo’s server. Call this API in your application’s OnStart() method. The setup method can only be called once during the application lifecycle. Calling this API is required before tracking sessions or invoking session-related APIs. ### Method POST ### Endpoint /pendo/setup ### Parameters #### Request Body - **appKey** (string) - Required - The App Key is listed in your Pendo Subscription Settings in App Details ### Request Example ```csharp Pendo.Setup("your.app.key"); ``` ### Response #### Success Response (200) - **void** - This method does not return a value. #### Response Example (No response body for void methods) ``` -------------------------------- ### PendoSDK API - setup Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/flutter-apis.md Establishes a connection with Pendo’s server. This API must be called once during the application lifecycle, before starting any sessions or invoking session-related APIs. The `setDebugMode` API is an exception and can be called anywhere. ```APIDOC ## POST /pendo/setup ### Description Establishes a connection with Pendo’s server. Call this API in your application’s main file (lib/main.dart). The setup method can only be called once during the application lifecycle. Calling this API is required before tracking sessions or invoking session-related APIs. ### Method POST ### Endpoint /pendo/setup ### Parameters #### Request Body - **appKey** (String) - Required - The App Key is listed in your Pendo Subscription Settings in App Details - **pendoOptions** (Map?) - Optional - PendoOptions should be `null` unless instructed otherwise by Pendo Support ### Request Example ```json { "appKey": "your.app.key", "pendoOptions": null } ``` ### Response #### Success Response (200) - **status** (String) - Indicates success or failure of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Update Pendo Flutter SDK: initSDK Migration (Dart) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/flutter-2.x-to-3.x-migration.md This snippet demonstrates the migration of the `initSDK` function from Pendo Flutter SDK v2.x to v3.x. The v3.x version replaces `initSDK` with separate `setup` and `startSession` calls, altering parameter handling for session details. ```dart final dynamic pendoParams = {'visitorId':'someVisitorID', 'accountId':'someAccountID', 'vistiorData': {'age':'25', 'country':'USA'}, 'accountData': {'tier': '1', 'size':'Enterprise'}; await PendoFlutterPlugin.startSession('someAppKey', pendoParams); ``` ```dart await PendoFlutterPlugin.setup('someAppKey', null ); await PendoFlutterPlugin.startSession('someVisitorID', 'someAccountID', {'age': '25', 'country': 'USA'}, {'tier': '1', 'size': 'Enterprise'}); ``` -------------------------------- ### Control Guide Display - TypeScript Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/rn-apis.md Manages the display of guides during an active session. The `pauseGuides` method can optionally dismiss currently visible guides. ```typescript static pauseGuides(dismissGuides: boolean): void PendoSDK.pauseGuides(false); static resumeGuides(): void PendoSDK.resumeGuides(); ``` -------------------------------- ### Update pauseGuides call (Swift) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/ios-2.x-to-3.x-migration.md The `pauseGuides` method now requires a boolean argument to control guide dismissal. Pass `true` to dismiss any currently displayed guide. ```swift // 2.x (deprecated): // PendoManager.shared().pauseGuides() // 3.x: PendoManager.shared().pauseGuides(true) // true == dismiss any displayed guide ``` -------------------------------- ### Pendo Initialization Callbacks Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Callbacks triggered during the Pendo SDK initialization process. `onInitComplete` is called after a successful session start, and `onInitFailed` is called if the session fails to start. ```APIDOC ## onInitComplete ### Description This callback is triggered once per session after each successful call to the StartSession API. The callback is triggered as soon as the analytics recording for the session has begun and the session guides are ready to be displayed. Guides that are not triggered on app launch may take a few additional moments after this callback to be ready for display. ### Method Callback Method ### Endpoint N/A ### Parameters None ### Request Example ```java class PendoCallbackImp implements PendoPhasesCallbackInterface { @Override public void onInitComplete() { Log.d("The session has begun"); } @Override public void onInitFailed() { Log.d("Session failed to begin"); } } // Usage: Pendo.setup(appContext, "your.app.key", null, new PendoCallbackImp()); ``` ### Response #### Success Response (void) This method does not return a value. ### `onInitFailed` ### Description This callback is triggered on a failed attempt to establish a connection with Pendo's server or on a failed attempt to start a new session when calling Pendo's Setup or StartSession APIs respectively. ### Method Callback Method ### Endpoint N/A ### Parameters None ### Request Example ```java class PendoCallbackImp implements PendoPhasesCallbackInterface { @Override public void onInitComplete() { Log.d("The session has begun"); } @Override public void onInitFailed() { Log.d("Session failed to begin"); } } // Usage: Pendo.setup(appContext, "your.app.key", null, new PendoCallbackImp()); ``` ### Response #### Success Response (void) This method does not return a value. ``` -------------------------------- ### Update Pendo SDK initialization from initSDKWithoutVisitor to setup in React Native Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/react-native-2.x-to-3.x-migration.md This snippet shows the migration of the `initSDKWithoutVisitor` method for the Pendo SDK in React Native. Version 3.x replaces this with a call to `setup`, simplifying the initialization process when visitor information is not immediately available. ```javascript import { PendoSDK, NavigationLibraryType } from 'rn-pendo-sdk'; // only if using React Native Navigation import { Navigation } from "react-native-navigation"; // select the correct NavigationLibraryType according to your application const navigationOptions = {library: NavigationLibraryType.ReactNavigation}; const navigationOptions = {library: NavigationLibraryType.ReactNativeNavigation, navigation: Navigation}; const navigationOptions = {library: NavigationLibraryType.Other}; // establish connection to server PendoSDK.initSDKWithoutVisitor('someAppKey', navigationOptions); ``` ```javascript import { PendoSDK, NavigationLibraryType } from 'rn-pendo-sdk'; // only if using React Native Navigation import { Navigation } from "react-native-navigation"; // select the correct NavigationLibraryType according to your application const navigationOptions = {library: NavigationLibraryType.ReactNavigation}; const navigationOptions = {library: NavigationLibraryType.ReactNativeNavigation, navigation: Navigation}; const navigationOptions = {library: NavigationLibraryType.Other}; // establish connection to server PendoSDK.setup('someAppKey', navigationOptions); ``` -------------------------------- ### Dismiss Visible Guides with dismissVisibleGuides Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Dismisses any currently visible guide. ```java static synchronized void dismissVisibleGuides() Pendo.dismissVisibleGuides(); ``` -------------------------------- ### Update Pendo Flutter SDK: switchVisitor Migration (Dart) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/migration-docs/flutter-2.x-to-3.x-migration.md This example details the migration of the `switchVisitor` functionality in the Pendo Flutter SDK from v2.x to v3.x. The `switchVisitor` method is now handled by `startSession`, which accepts new visitor or account IDs. ```dart await PendoFlutterPlugin.switchVisitor('someVisitorID', 'someAccountID', {'age': '25', 'country': 'USA'}, {'tier': '1', 'size': 'Enterprise'}); ``` ```dart await PendoFlutterPlugin.startSession('someVisitorID', 'someAccountID', {'age': '25', 'country': 'USA'}, {'tier': '1', 'size': 'Enterprise'}); ``` -------------------------------- ### Start Pendo Session Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/android/pnddocs/flutter-android.md Initializes a Pendo session for a specific visitor and account. This is typically done during user login or registration. It accepts visitor and account IDs, along with their respective metadata. Pass null or an empty string for anonymous visitors. ```dart import 'package:pendo_sdk/pendo_sdk.dart'; final String visitorId = 'VISITOR-UNIQUE-ID'; final String accountId = 'ACCOUNT-UNIQUE-ID'; final Map visitorData = {'Age': '25', 'Country': 'USA'}; final Map accountData = {'Tier': '1', 'Size': 'Enterprise'}; await PendoSDK.startSession(visitorId, accountId, visitorData, accountData); ``` -------------------------------- ### Start Pendo Mobile Session with JWT Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-ios-apis.md Starts a Pendo mobile session using a JWT for secure metadata. Requires a pre-generated signed JWT and the name of the signing key. This function can also terminate an ongoing session to start a new one. ```swift func startSession(_ jwt: String, signingKeyName: String) ``` ```swift /** * Example code on you server side to generate the JWT * * const jwt = JWT.sign({ * nonce: "abcdefg78910xyz", * visitor: { <-- the visitor element * id: "John Doe", <-- the id is mandatory * age: "21" <-- optional * }, * account: { * id: "ACME", <-- the id is mandatory * Tier: "1" <-- optional * } * }, * 'SECRET KEY VALUE' <-- sign with the secret key * ); */ // fetch the signed JWT and signing key from your server String jwt = Server.getSignedJWT(); String sKeyName = Server.getJWTSigningKeyName(); PendoManager.shared().jwt.startSession(jwt, signingKeyName:sKeyName); ``` -------------------------------- ### PendoSDK.resumeGuides Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/rn-apis.md Resumes displaying guides during the ongoing session, reversing the effect of the `pauseGuides` API. ```APIDOC ## PendoSDK.resumeGuides ### Description Resumes displaying guides during the ongoing session. This API reverses the logic of the `pauseGuides` API. ### Method Static method ### Endpoint N/A (Client-side SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```typescript PendoSDK.resumeGuides(); ``` ### Response #### Success Response (void) This method does not return a value. #### Response Example None ``` -------------------------------- ### pauseGuides Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Pauses the display of guides. Optionally dismisses any currently visible guide. ```APIDOC ## pauseGuides ### Description Pauses any guides from appearing during an active session. If the `dismissGuides` value is set to `true`, then any visible guide will be dismissed. Calling this API affects the current session. Starting a new session reverts this logic, enabling guides to be presented. ### Method static synchronized void ### Endpoint N/A (SDK Method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **dismissGuides** (boolean) - Required - Determines whether the displayed guide, if one is visible, is dismissed when pausing the display of the further guides. ### Request Example ```java Pendo.pauseGuides(false); ``` ### Response #### Success Response (void) This method does not return a value. #### Response Example None ``` -------------------------------- ### ResumeGuides API Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/xamarin-maui-apis.md Resumes the display of Pendo guides after they have been paused. ```APIDOC ## POST /pendo/resumeGuides ### Description Resumes the display of Pendo guides after they have been paused. This API should be called after `Setup` and `StartSession`. ### Method POST ### Endpoint /pendo/resumeGuides ### Parameters No parameters required. ### Request Example ```json {} ``` ### Response #### Success Response (200) - **message** (string) - Indicates that guides have been resumed. ### Response Example ```json { "message": "Pendo guides resumed." } ``` ``` -------------------------------- ### Pause Guides with pauseGuides Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Pauses any guides from appearing during an active session. If dismissGuides is true, any currently visible guide will be dismissed. This setting reverts when a new session starts. ```java static synchronized void pauseGuides(boolean dismissGuides) Pendo.pauseGuides(false); ``` -------------------------------- ### Start Pendo Session with Visitor and Account Data in C# Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/xamarin-maui-apis.md Illustrates how to start a mobile session with visitor and account information. This method allows for setting visitor and account IDs, along with optional metadata dictionaries. It handles session termination and restarts if called during an ongoing session. ```csharp void StartSession(string visitorId, string accountId, Dictionary visitorData, Dictionary accountData) ``` ```csharp var visitorData = new Dictionary { { "age", 21 }, { "country", "USA" } }; var accountData = new Dictionary { { "Tier", 1 }, { "Size", "Enterprise" } }; Pendo.StartSession("John Doe", "ACME", visitorData, accountData); ``` -------------------------------- ### resumeGuides Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Resumes the display of guides during the ongoing session, reversing the effect of `pauseGuides`. ```APIDOC ## resumeGuides ### Description Resumes displaying guides during the ongoing session. This API reverses the logic of the `pauseGuides` API. ### Method static synchronized void ### Endpoint N/A (SDK Method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java Pendo.resumeGuides(); ``` ### Response #### Success Response (void) This method does not return a value. #### Response Example None ``` -------------------------------- ### ResumeGuides API Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/xamarin-maui-apis.md Resumes the display of guides during the ongoing session, reversing the effect of the `PauseGuides` API. ```APIDOC ## ResumeGuides ### Description Resumes displaying guides during the ongoing session. This API reverses the logic of the `PauseGuides` API. ### Method void ### Request Example ```csharp Pendo.ResumeGuides(); ``` ``` -------------------------------- ### Initialize Pendo SDK (setup) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Establishes a connection with Pendo’s server. This API must be called in your application’s onCreate() method and can only be called once. It requires the application context, app key, optional Pendo options, and an optional callback interface for initialization status. ```java static synchronized void setup(Context context, String appKey, PendoOptions options, PendoPhasesCallbackInterface pendoPhasesCallback) ``` ```java Pendo.setup(appContext, "your.app.key", null, null) ``` -------------------------------- ### Pendo JWT Start Session API Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-ios-apis.md This API allows starting a mobile session using a provided JWT and signing-key name, facilitating secure metadata sessions. ```APIDOC ## POST /jwt/startSession ### Description Starts a mobile session using a JWT signed on the server-side. This API is used for secure metadata sessions. If a session is already in progress, it will be terminated and a new one will begin. App termination also terminates the session. The JWT payload must include `visitor` and `account` elements, each with a mandatory `id` property. ### Method POST ### Endpoint `/jwt/startSession` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body **jwt** (String) - Required - The signed JWT string containing visitor and account elements. **signingKeyName** (String) - Required - The name of the key used to sign the JWT. ### Request Example ```swift // On your server-side (example using Node.js): /* const jwt = JWT.sign({ nonce: "abcdefg78910xyz", visitor: { <-- the visitor element id: "John Doe", <-- the id is mandatory age: "21" <-- optional }, account: { id: "ACME", <-- the id is mandatory Tier: "1" <-- optional } }, 'SECRET KEY VALUE' <-- sign with the secret key ); */ // On the client-side: String signedJwt = Server.getSignedJWT(); // Fetch signed JWT from your server String keyName = Server.getJWTSigningKeyName(); // Fetch signing key name from your server PendoManager.shared().jwt.startSession(signedJwt, signingKeyName: keyName); ``` ### Response #### Success Response (200) void - The session starts successfully. #### Response Example N/A (No response body for success) ``` -------------------------------- ### Start Mobile Session with Visitor and Account Data (Java) Source: https://github.com/pendo-io/pendo-mobile-sdk/blob/master/api-documentation/native-android-apis.md Initiates a new mobile session with optional visitor and account details. If a session is active, it will be terminated and a new one started. The SDK handles offline network states and invokes callbacks on completion or failure. ```java static void startSession(final String visitorId, final String accountId, final Map visitorData, final Map accountData) ``` ```java HashMap visitorData = new HashMap<>(); visitorData.put("age", 21); visitorData.put("country", "USA"); HashMap accountData = new HashMap<>(); accountData.put("Tier", 1); accountData.put("size", "Enterprise"); Pendo.startSession("John Doe", "ACME", visitorData, accountData) ```