Documentation Index
Fetch the complete documentation index at: https://docs.waniwani.ai/llms.txt
Use this file to discover all available pages before exploring further.
Platform feature. Requires
WANIWANI_API_KEY. Works whether your MCP server is self-hosted or on Managed Hosting. About the Platform.client.track(). The SDK accepts a strongly typed TrackEvent shape and maps it to the canonical Events API V2 envelope before sending.
For the full type-level reference (the TrackEvent shape, the EventType union, all *Properties interfaces), see Event schema. This page is the usage guide.
Recipes
quote.requested / quote.succeeded / quote.failed
link.clicked
purchase.completed
Return value
eventId is stable and safe to log. It is assigned before the envelope leaves the process, so logging it tells you an event was accepted into the buffer, not that it reached the backend. track() returns as soon as the envelope is enqueued, before the network request completes.
Sessions and users
Passmeta: extra._meta from inside a tool handler so the event is linked to the active MCP session. See Sessions. To attach a user identifier, pass externalUserId or call client.identify(). See Identify.
Flushing
The transport flushes on a timer and on batch size. In long-running processes, you typically do not need to callflush() yourself. In serverless functions, call it before the function returns: