Webhook Metrics Cards

Deliveries, success rate, and failures over the window, each with a sparkline.

Deliveries
1,998
Success rate
97.5%
Failures
49
"use client";

import { WebhookMetricsCards } from "@/components/webhook-metrics-cards";

Installation

pnpm dlx shadcn@latest add @repost/webhook-metrics-cards

Installs this item, every component it depends on, and the npm packages listed below.

Usage

This component is presentational: it renders what you pass it and calls back on interaction. In a live dashboard the data comes from useLogsHistogram({ dateFrom, dateTo }) (@repost/portal-react), but any data of the same shape works.

components/webhook-metrics-cards-demo.tsx
"use client";

import { WebhookMetricsCards } from "@/components/webhook-metrics-cards";
import { fixtureHistogramSlots } from "@/fixtures/webhook-fixtures";

export function WebhookMetricsCardsDemo() {
  return <WebhookMetricsCards slots={fixtureHistogramSlots()} />;
}

Props

PropTypeDescription
slotsWebhookHistogramSlot[]Time-bucketed counts.
isLoadingbooleanRenders skeleton values.
failureKeysstring[]Series keys counted as failures.