Skip to main content

Initialization

Returns the boostgpt API object with the methods below.

Methods

boostgpt.open()

Opens the chat frame. No-op if already open.

boostgpt.close()

Minimizes the widget back to the bubble. No-op if already closed.

boostgpt.toggle()

Toggles between open and closed states.

boostgpt.hide()

Hides the entire widget (bubble + frame) from the page. Useful for conditionally showing the widget based on user state.

boostgpt.show()

Shows the widget again after hide().

boostgpt.destroy()

Removes the widget from the DOM entirely and cleans up event listeners.

boostgpt.addMessage(text, options)

Adds a custom message card above the bubble without firing an event.

Events

Listen for widget lifecycle events:

Global Access

The widget is available globally as boostgpt (and BoostGPTWidget for backwards compatibility):

Custom Chat Buttons

Use the programmatic API to open the widget from your own buttons:
You can hide the default bubble and use only your own buttons: