NewWacht Bench is live — AI-assisted development for Wacht

getApiAuditAnalytics()

Loads aggregate audit counts and optional top lists.

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 example() {  const client = await wachtClient();  const appSlug: string = 'appslug';  const options: GetApiAuditAnalyticsOptions = {    include_top_keys: true,    include_top_paths: true,    top_limit: 10,  };  return client.apiKeys.getApiAuditAnalytics(appSlug, options);}

Signature

function getApiAuditAnalytics(  appSlug: string,  options?: GetApiAuditAnalyticsOptions,): Promise<ApiAuditAnalyticsResponse>

GetApiAuditAnalyticsOptions

appSlug?: string | undefined;
API auth app slug.
options.start_date?: string | undefined;
Start timestamp.
options.end_date?: string | undefined;
End timestamp.
options.key_id?: string | number | undefined;
Filter analytics to one key.
options.include_top_keys?: boolean | undefined;
Include top key rollup.
options.include_top_paths?: boolean | undefined;
Include top path rollup.
options.include_blocked_reasons?: boolean | undefined;
Include blocked reason rollup.
options.include_rate_limits?: boolean | undefined;
Include rate-limit breakdown.
options.top_limit?: number | undefined;
Maximum size for top lists.

Return value

result?: ApiAuditAnalyticsResponse | undefined;
Operation result payload.

On this page