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.

Remove the chat widget

Last updated June 17, 2020

HubSpotConversations.widget.remove()

Remove the widget from the page. If the widget is not present on the page, this is a no-op. To display the widget again, a full page refresh will have to occur, or one can invoke widget.load.

Additionally, you can pass {resetWidget:true} to the clear() function to clear all chat related cookies, remove the widget from the page, and create a new instance of the chat widget.

Note: This is not the same as closing the widget, as it will be unavailable to the visitor. See widget.close to close the widget without removing it from the page.