Self-hosting the Pendo agent

Last updated:

The Pendo agent is the JavaScript that runs in your web application, collects raw event data, and displays guides. A standard Pendo installation loads pendo.js securely and asynchronously from a CDN. We highly recommend loading the Pendo agent from our CDN to ensure that you're using the most current version. However, you can self-host the Pendo agent if security restrictions require you to do so.

For more information on Pendo installation and configuration, see:

Disadvantages of self-hosting

Pendo continuously releases updates to the Pendo agent, typically weekly. Many of these updates include feature enhancements that require the updated Pendo agent to be present in your application for the feature enhancement to work properly. Self-hosting the Pendo agent stops you from receiving the current version of the agent when the application loads, which may block access to those updates. More importantly, self-hosting the Pendo agent prevents you from automatically receiving critical security updates. Self-hosting also requires additional developer time to install and manage the agent.

The agent reflects the current Pendo settings. If any changes are made, you must update the agent for those changes to take effect. This means that changes to your settings in Pendo don't occur until the updated agent is downloaded and hosted with a locally hosted agent.

Adding or removing staging environments in Pendo requires an updated version of the agent to recognize those changes. Staging environments are used to deploy and test guides outside of your production environment. The staging version of the Pendo agent always comes from the Pendo CDN and any modification of the install script to change this isn't supported.

Download the Pendo agent

Download the Pendo agent from Agent Settings, which is an application-level setting.

  1. Go to Settings > Subscription Settings.

  2. Open the Applications tab.

  3. Find and open the relevant application from your Applications list.

  4. Open the Agent Settings tab.
  5. Select Manage Production Settings.
  6. Select the Download link to download pendo.js.

DownloadLink.png

Host the Pendo agent

After downloading pendo.js, host the file somewhere your application can access. For example, you could host the agent at https://myapp.com/assets/pendo.js.

Update your install script

After you've uploaded pendo.js to your directory, update the install script to load pendo.js from your location. You need to update src='https://cdn.pendo.io/agent/static/'+apiKey+'/pendo.js' in the install script with the location of your locally hosted Agent. You must make this change everywhere Pendo is installed in your application. This could be on a single page or on multiple pages of your application depending on the details of your specific installation.

If you need to update the agent, you only need to replace pendo.js in your directory unless you also change the location or filename.

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