Skip to content

Recommendations Data & Events

The Recommendations drop-in uses the event bus to emit and listen to events for communication between drop-ins and external integrations.

Version: 3.0.0
EventDirectionDescription
recommendations/dataEmits and listensTriggered when data is available or changes.

The following sections provide detailed information about each event, including its direction, event payload, and usage examples.

Emitted when product recommendations are loaded. This includes recommended products based on user behavior, cart contents, or product associations.

RecommendationUnitModel[] | null

See RecommendationUnitModel for full type definition.

import { events } from '@dropins/tools/event-bus.js';
events.on('recommendations/data', (payload) => {
console.log('recommendations/data event received:', payload);
// Add your custom logic here
});

The following data models are used in event payloads for this drop-in.

Used in: recommendations/data.

interface RecommendationUnitModel {
displayOrder: number;
pageType: PageType;
title: string;
items: Item[];
totalProducts: number;
typeId: string;
unitId: string;
unitName: string;
}