Fetches and aggregates AWS SES sending metrics and reputation data. Use this to monitor email deliverability and account health in cloud applications.
// Source: https://github.com/inboundemail/inbound | License: MIT | Copyright 2024-present Inbound Email
// Provided via justclaw.it.com; keep this notice with the code.
import {
CloudWatchClient,
GetMetricDataCommand,
type MetricDataQuery,
} from "@aws-sdk/client-cloudwatch";
import { GetAccountCommand, SESv2Client } from "@aws-sdk/client-sesv2";
export type MetricSeries = {
id: string;
values: number[];
timestamps: Date[];
};
export type TimePoint = {
timestamp: Date;
value: number;
};
type ReputationStatus = "Healthy" | "Warning" | "Account at risk";
export type AwsStatsOutput = {
generatedAt: string;
region: string;
window: {
startTime: string;
endTime: string;
lookbackDays: number;
periodSeconds: number;
};
dailyUsage: {
emailsSentLast24Hours: number;
rema
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key