Relay is a compact library for emitting Event Protocol analytics events. It simplifies tracking relevant user interactions. This analytics data powers reports and helps train Coveo Machine Learning models.
First, create an instance of Relay in your project. This instance can then be used to emit an event or perform other actions.
import { createRelay } from "@coveo/relay";
const config = {...};
const relay = createRelay(config);
const payload = {...};
relay.emit('itemView', payload);