@raindrop-ai/tanstack-ai adds Raindrop to TanStack AI chat() via a ChatMiddleware. It captures each chat invocation as a Raindrop event plus an OTel trace, and uses TanStack threadId to keep multi-turn chats grouped together.
Install
Quick start
Configuration
createRaindropTanstackAI() accepts the public options exported by the package:
For multi-project organizations, create one client per project and pass each
project’s slug as
projectId. Omit projectId to use the organization’s
default project.
Per-call overrides go on TanStack AI’s context object:
eventId / event_id override the generated event ID for that request. When convoId is omitted, the middleware falls back to TanStack AI’s threadId.
What gets captured
- One Raindrop event per
chat()call - One trace per
chat()call - Message content and system prompts when
captureContentis left on - Tool calls and tool results
- Per-call metadata from
context.properties
Known limitations
- TanStack AI does not expose a public attachment channel on the
chat()capture path yet, so attachments are not captured here. - Capture currently ships through the partial-event route, so the event is emitted first and finalized by patching the partial record.