PutEvents
The PutEvents feature allows you to record events such as user interactions with items. These events are used to train and update machine learning models for personalized recommendations.
const { PersonalizeEventsClient, PutEventsCommand } = require('@aws-sdk/client-personalize-events');
const client = new PersonalizeEventsClient({ region: 'us-west-2' });
const params = {
sessionId: 'exampleSessionId',
trackingId: 'exampleTrackingId',
userId: 'exampleUserId',
eventList: [
{
eventType: 'exampleEventType',
sentAt: new Date(),
properties: JSON.stringify({
itemId: 'exampleItemId'
})
}
]
};
const command = new PutEventsCommand(params);
client.send(command).then(
(data) => console.log(data),
(error) => console.error(error)
);