> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boostgpt.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Set up the chat widget and your first trigger in 5 minutes

## Prerequisites

Before you begin, make sure you have:

* A BoostGPT account ([sign up free](https://app.boostgpt.co/signup))
* An AI agent created and trained with your content
* Access to your website's code

## Step 1: Create an Event

Events define the friction points where you want to engage users.

1. Go to your agent's **Events** page in the dashboard
2. Click **Create Event**
3. Fill in the details:
   * **Name**: `checkout_abandoned` (use snake\_case, no spaces)
   * **Label**: "Checkout Abandoned" (display name)
   * **Description**: "User started checkout but didn't complete"
   * **Prompt Template**:
     ```
     A user abandoned their checkout. Cart value: {{cart_value}}.
     Help them complete their purchase.
     ```
4. Click **Save**

## Step 2: Add the Chat Widget

Add this script to your website:

```html theme={null}
<script src="https://embed.boostgpt.co/widget.js" data-bot-id="YOUR_AGENT_UUID"></script>
```

Replace `YOUR_AGENT_UUID` with your agent's UUID from the dashboard.

## Step 3: Trigger on Friction Points

Call `boostgpt.trigger()` when users hit friction points:

```javascript theme={null}
// Example: Trigger when user is about to leave checkout
window.addEventListener('beforeunload', function(e) {
  if (isOnCheckoutPage() && cartHasItems()) {
    boostgpt.trigger('checkout_abandoned', {
      cart_value: '$149.00',
      items: 3
    });
  }
});
```

Or trigger after inactivity:

```javascript theme={null}
// Example: Trigger after 30 seconds of inactivity on checkout
let timeout;
function resetTimer() {
  clearTimeout(timeout);
  timeout = setTimeout(function() {
    if (isOnCheckoutPage()) {
      boostgpt.trigger('checkout_abandoned', {
        cart_value: getCartValue()
      });
    }
  }, 30000);
}

document.addEventListener('mousemove', resetTimer);
document.addEventListener('keypress', resetTimer);
```

## Step 4: Test Your Trigger

1. Open your website in a browser
2. Navigate to the page where you added the trigger
3. Trigger the condition (e.g., sit idle for 30 seconds)
4. You should see the trigger card appear above the widget bubble
5. Click it — the chat opens in the widget with context

## Customizing the Trigger UI

Customize the trigger appearance:

```javascript theme={null}
boostgpt.trigger('checkout_abandoned', {
  cart_value: '$149.00'
}, {
  text: 'Need help checking out?',  // Message shown in the trigger card
  delay: 1000                       // Delay before showing (ms)
});
```

## What Happens When User Clicks

When the user clicks the trigger card:

1. The widget calls the BoostGPT API with the event and context
2. Your agent receives a message built from the prompt template + context
3. The agent generates a contextual response
4. The chat opens in the widget with the agent already responding

**Example agent message:**

> "Hi! I noticed you were about to leave without completing your order. Your cart has \$149.00 worth of items. Is there anything I can help with? Maybe you have questions about shipping, returns, or payment options?"

## Next Steps

<CardGroup cols={2}>
  <Card title="Events Overview" icon="bolt" href="/saas/events/overview">
    Learn more about events and context
  </Card>

  <Card title="Event Triggers" icon="palette" href="/saas/chat-widget/triggers">
    Proactive messages via the widget
  </Card>

  <Card title="Widget Configuration" icon="settings" href="/saas/chat-widget/configuration">
    All available options
  </Card>

  <Card title="Use Case Guides" icon="book" href="/saas/guides/checkout-abandonment">
    Real-world implementation examples
  </Card>
</CardGroup>
