There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API Keys are being deprecated and are no longer supported. Continued use of HubSpot API Keys is a security risk to your account and data. Your API Keys could be deactivated at any time after Nov. 30th, and we recommend that you migrate to Private Apps as soon as possible so you do not lose business-critical functionality.

Refresh the chat widget

Last updated June 17, 2020

HubSpotConversations.widget.refresh()

Refresh and re-render the widget's information, given the current page url.

If you house the chat widget on a single-page application, this method can be useful to refresh the widget on route changes. This allows you to specify different chatflows on different page routes. If widget.refresh is called on a route where there is no chatflow, the widget will be removed.

Notes: 
  • widget.refresh will preserve any existing conversations that a page visitor has started in the widget.
  • widget.refresh is throttled to one call per second.