Skip to main content
Event triggers let you show contextual messages above the chat widget bubble when specific events happen in your application — a user hits an error, completes onboarding, abandons checkout, etc. When the user clicks the trigger message, it fires the event to your agent and opens the resulting conversation in the widget.

Basic Usage

The trigger message appears as a card stacked above the widget bubble — same style as greeting messages.

Trigger Options

Options

Screenshots

Enable screenshot capture to give your agent visual context about what the user was seeing:
Screenshot capture requires html2canvas. Add it to your page:

Dismissing Triggers

Custom Messages

Use addMessage() to show cards without firing an event — useful for announcements, tips, or custom CTAs:

Trigger Events

Listen for trigger lifecycle events:

Trigger-Only Mode

If you only want triggers without the persistent chat bubble, set widget: false:

Migration from trigger.js

If you were using the standalone trigger.js script, migrate to the unified widget.js:
Key changes:
  • Replace trigger.js with widget.js
  • Remove type: 'toast' (toast is now the only trigger style)
  • Use text instead of message for the trigger card text
  • boostgpt.triggerDirect() is now just boostgpt.trigger()
  • The old trigger.js still works with a deprecation warning but will be removed in a future version