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.trigger(eventName, context, options)

Shows a proactive message card above the bubble. See Event Triggers for full documentation.

boostgpt.addMessage(text, options)

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

boostgpt.dismiss(eventName)

Removes a specific trigger card.

boostgpt.dismissAll()

Removes all active trigger cards.

Events

Listen for widget lifecycle events:

Global Access

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

Custom Trigger Buttons

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