Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Latest release: WednesdayAI v0.6.1 (release notes). Use the version menu for unreleased (next) or older docs.
Access session analytics data from your plugin using the SDK analytics API.
import { createPlugin } from "openclaw/plugin-sdk" export default createPlugin({ name: "my-analytics-plugin", setup(sdk) { sdk.registerCommand({ name: "stats", description: "Show your session statistics", async run({ userId }) { const stats = await sdk.runtime.analytics.getStats({ userId }) return `Messages: ${stats.messageCount}, Tokens: ${stats.totalTokens}` }, }) }, })
runtime.analytics.getStats(opts: { userId: string since?: string // ISO-8601 until?: string }): Promise<AnalyticsStats> runtime.analytics.getGlobalStats(opts?: { since?: string until?: string }): Promise<GlobalAnalyticsStats> runtime.analytics.getSessions(opts: { userId: string limit?: number // default: 10 offset?: number }): Promise<SessionSummary[]>
interface AnalyticsStats { userId: string messageCount: number totalTokens: number avgResponseMs: number activeDays: number period: { since: string; until: string } } interface SessionSummary { sessionId: string userId: string startedAt: string lastActiveAt: string messageCount: number totalTokens: number }
admin