Skip to main content
@firstflow/runtime-server is the optional backend half of FirstFlow. It wraps your existing LLM client so every call’s tokens, cost, latency, and (opt-in) content are recorded to your Supabase, groups calls into conversations and traces, and runs an intent classifier. It writes directly to your database there is no FirstFlow API in the path. You consume it by cloning the repo and building your app inside its workspace (it’s not on npm) see Self-hosting → Quickstart. Your app references it with "@firstflow/runtime-server": "workspace:*".

Wrap and go

That call records one row in firstflow_llm_calls and, because a sessionId is present, two messages in firstflow_conversation_messages.

What it provides

Runtime support

Works in any runtime with Web Crypto: Node 18+, Bun, Deno, Cloudflare Workers, and Vercel Edge. Provider detection is by shape no hard dependency on the OpenAI or Anthropic SDK. Apps that use Anthropic never load openai, and vice versa.

Where data goes

Everything lands in your Supabase: firstflow_llm_calls, firstflow_traces, firstflow_conversations, and firstflow_conversation_messages. See What gets recorded.

Next

Wrap your LLM client

Providers, call metadata, scope, and bring-your-own endpoints.

Traces & spans

Group multi-call operations.

Intent & sentiment

Classify conversations.

Configuration

Keys, persistence, and content capture.