Skip to content

GetEventPredictionMetadata

Source: src/AWS/FraudDetector/GetEventPredictionMetadata.ts

Read the full evaluation details of a past prediction made by a bound Amazon Fraud Detector detector — the variables, rule evaluations, and model scores recorded for the prediction — the effectful audit call made from a deployed Lambda or Task.

Provide the GetEventPredictionMetadataHttp implementation layer on the Function effect, bind the detector in the init phase, then call the returned client at runtime. The binding grants frauddetector:GetEventPredictionMetadata on the detector and injects its detectorId automatically. Find predictionTimestamp values via the ListEventPredictions binding.

// init
const getPredictionMetadata =
yield* FraudDetector.GetEventPredictionMetadata(detector);
return {
fetch: Effect.gen(function* () {
// runtime
const metadata = yield* getPredictionMetadata({
eventId: "order-123",
eventTypeName: "purchase",
detectorVersionId: "1",
predictionTimestamp: "2026-01-01T00:00:00Z",
});
return HttpServerResponse.json({ rules: metadata.rules });
}),
};
// on the Function effect:
// .pipe(Effect.provide(FraudDetector.GetEventPredictionMetadataHttp))