NewWacht Bench is live — AI-assisted development for Wacht

getWebhookStats()

Returns a compact webhook stats summary for one app slug from the stats endpoint.

Usage

The following example shows a basic usage of the backend client from @wacht/nextjs/server.

import { wachtClient } from '@wacht/nextjs/server';export async function getWebhookStats(appSlug: string) {  const client = await wachtClient();  return client.webhooks.getWebhookStats(appSlug);}

Signature

function getWebhookStats(  appSlug: string,): Promise<WebhookStats>

Parameters

appSlug?: string | undefined;
Webhook app slug to scope stats.

Return value

total_deliveries?: number | undefined;
Total delivery attempts tracked for the app.
success_rate?: number | undefined;
Current success rate percentage for the app.
active_endpoints?: number | undefined;
Number of currently active endpoints under the app.
failed_deliveries_24h?: number | undefined;
Failed deliveries counted in the last 24 hours.

Behavior

  • Fetches a single resource by identifier or query context.
  • Use this result as the source of truth before update, replay, or delete flows.

Examples

Load app stats

import { wachtClient } from '@wacht/nextjs/server';export async function loadWebhookStats(appSlug: string) {  const client = await wachtClient();  return client.webhooks.getWebhookStats(appSlug);}

On this page