Skip to content

PutRumEvents

Source: src/AWS/RUM/PutRumEvents.ts

Runtime binding for rum:PutRumEvents — send a batch of telemetry events from one user session to the bound AppMonitor’s data plane (the same operation the RUM web client uses); the monitor id and details are injected automatically.

Provide RUM.PutRumEventsHttp on the hosting Lambda Function to satisfy the requirement.

// init — grants rum:PutRumEvents on the monitor
const putRumEvents = yield* AWS.RUM.PutRumEvents(monitor);
// runtime
yield* putRumEvents({
BatchId: crypto.randomUUID(),
UserDetails: { userId, sessionId },
RumEvents: [
{
id: crypto.randomUUID(),
timestamp: new Date(),
type: "com.amazon.rum.session_start_event",
details: "{}",
},
],
});