Search Events
Every vviinn widget emits events that you can listen to with document.addEventListener().
All these events are available on Search (Button, Widget), and the following props are available for each event:
campaignTypeIdcampaignTypeNamewidgetId(if exists)widgetVersion
Some events have additional props, summarized in the table below.
| Name | Description | Props |
|---|---|---|
vviinnImageUploadStarted |
Triggered after the image upload button is clicked. | isTriggeredByVpsWidget |
vviinnImageCrop |
Triggered after the crop area changes — by cropping, by selecting a detected object or by removing the crop. | isTriggeredByVpsWidget |
vviinnSelectObject |
Triggered after an object is selected. | detectedObjectsearchArea |
Examples
Section titled “Examples”document.addEventListener("vviinnImageUploadStarted", ({ detail }) => { console.log(detail);});
// Output: Search Modal{ "campaignTypeId": "VPS", "campaignTypeName": "Visual Search", "widgetId": "my-search-widget", "widgetVersion": "2.87.0", "isTriggeredByVpsWidget": true}