Skip to main content
All events bubble and are composed, allowing you to listen on parent elements for convenient event delegation.

Reference Table

EventWhen it firesPayload
searchAfter the user submits a query (Enter or button){ query }
resultsWhen initial results are received and rendered{ results }
aiWhen AI-scored results/recommendations arrive{ success, recommendations, results, count, maxRelevance }
errorWhen a network or parsing error occurs{ error }

Examples

Fields trimmed for brevity.
{ "query": "What is your return policy?" }
{
  "results": [
    {
      "id": "product_123",
      "name": "Product Name",
      "publicUrl": "https://example.com/products/product-name",
      "price": "$42.00"
    }
  ]
}
{
  "success": true,
  "count": 5,
  "maxRelevance": 0.92,
  "recommendations": [
    {
      "text": "Best for small spaces",
      "productIds": ["product_123"],
      "relevancyScore": 0.91,
      "reasoning": "Compact footprint and quiet operation"
    }
  ],
  "results": [
    { "id": "product_123", "name": "Product Name", "publicUrl": "https://example.com/products/product-name" }
  ]
}
{ "error": "Request timed out" }