getAnalyticsSummary()
Returns analytics metrics for a required
from/to window.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 getSummary() { const client = await wachtClient(); return client.analytics.getAnalyticsSummary({ from: '2026-04-01T00:00:00Z', to: '2026-04-18T23:59:59Z', });}Signature
function getAnalyticsSummary( options: { from: string; to: string },): Promise<AnalyticsStats>AnalyticsSummaryOptions
›from?: string | undefined;
from?: string | undefined;Window start timestamp (ISO-8601).
›to?: string | undefined;
to?: string | undefined;Window end timestamp (ISO-8601).
Return value
›total_users?: number | undefined;
total_users?: number | undefined;Total users in the selected window.
›new_users?: number | undefined;
new_users?: number | undefined;New users in the selected window.
›active_users?: number | undefined;
active_users?: number | undefined;Active users in the selected window.
›sign_in_count?: number | undefined;
sign_in_count?: number | undefined;Sign-in count in the selected window.
Behavior
- Fetches a single resource by identifier or query context.
- Use this result as the source of truth before update, replay, or delete flows.