Skip to content

GetEvent

Source: src/AWS/FraudDetector/GetEvent.ts

Read a stored event (its entities and variable values) back from Amazon Fraud Detector — the effectful lookup call made from a deployed Lambda or Task. Events are stored by SendEvent or by predictions on an event type with ingestion enabled.

Provide the GetEventHttp implementation layer on the Function effect, bind the event type in the init phase, then call the returned client at runtime. The binding grants frauddetector:GetEvent on the event type and injects its eventTypeName automatically.

// init
const getEvent = yield* FraudDetector.GetEvent(eventType);
return {
fetch: Effect.gen(function* () {
// runtime
const { event } = yield* getEvent({ eventId: "order-123" });
return HttpServerResponse.json({ variables: event?.eventVariables });
}),
};
// on the Function effect:
// .pipe(Effect.provide(FraudDetector.GetEventHttp))