Skip to main content

Core

additionalPublicAppIds : Array.<string>

Formerly additionalApiKeys. Array of additional app IDs that are set in the config. If no primary app ID is set, the first in this array will be assigned to pendo.publicAppId.

Example

pendo.additionalPublicAppIds => ['FIRST_PUBLIC_APP_ID', 'SECOND_PUBLIC_APP_ID']

getConfigValue ⇒ *

Retrieve a configuration value from the web sdk's config. Available configuration keys can be found in the configuration section.

Returns: * - The configuration value.

ParamTypeDescription
keystringThe configuration key to retrieve.

Example

pendo.getConfigValue('excludeAllText') => false

getVersion() ⇒ string

Returns current version of the Pendo Web SDK as a string. Also directly accessible at pendo.VERSION.

Returns: string - web SDK version
Example

pendo.getVersion() => '2.150.0'

initialize(options)

Initializes the Pendo Web SDK in a browser window. This function only needs to be called once per page load. Any subsequent calls, without first having called teardown, will be ignored. Once the web SDK has been initialized, any updates to identity or metadata should be done using identify or updateOptions.

See: Pendo Installation

ParamTypeDescription
optionsobjectidentity metadata and configuration to initialize web SDK

Example

pendo.initialize({
visitor: {
id: <visitor-id-goes-here>, // Required if user is logged in
// full_name: "John Doe", // Recommended if using Pendo Feedback
// email: "user@acme.com", // Recommended if using Pendo Feedback or NPS email
// role: "Viewer" // Optional

// You can add any additional visitor level key-values here,
// as long as it's not one of the above reserved names.
},
account: {
id: <account-id-goes-here>, // Recommended, required if using Pendo Feedback
// name: "Acme Co", // Optional
// is_paying: false, // Recommended if using Pendo Feedback,
// monthly_value: 0, // Recommended if using Pendo Feedback

// You can add any additional account level key-values here,
// as long as it's not one of the above reserved names.
}
});

isReady() ⇒ boolean

Returns boolean representing whether the Pendo Web SDK is fully loaded and has an API key.

Example

if (pendo.isReady()) {
// runs if web SDK has fully loaded
}

publicAppId : string

Formerly apiKey. Public app ID that is associated with the current Pendo installation as a string.

Example

pendo.publicAppId => 'PUBLIC_APP_ID'

teardown() ⇒ void

Shuts down the web SDK and cleans up all timers and listeners. Upon completion the web SDK will be able to be re-initialized when needed or cleaned up from the window. This will halt all guides and data collection.

Example

window.pendo.teardown();
pendo.isReady(); // this will return false
delete window.pendo;