Realtime Support for Non-Supported Languages
Why this matters
- OpenAPI (beta) gives us type-safe HTTP calls from languages Convex doesn’t officially support, but those calls are not reactive / not real-time.
- Convex’s core value is automatic realtime via reactive queries, no cache gymnastics, which today is only available through the first-party TS client. Bringing a small slice of that to standard protocols would let other runtimes participate.
The ask (scoped & incremental)
Add a lightweight, documented streaming interface for “watching” query function results, with two implementation paths (either one would unblock us):
1. SSE “watch” endpoint (smallest viable):
• GET
/api/stream/run/{functionIdentifier}?params=...• Emits: init (full snapshot), then patch events (JSON Patch or Convex-native op log), plus error and heartbeat.
• Reuses existing auth and function identifiers from /api/run/.... Works through proxies/CDNs and is simple for C#.
• Document the stream using AsyncAPI v3 (protocol:
sse). AsyncAPI is the standard companion to OpenAPI for evented APIs and fits this use case. 2. WebSocket “live query” channel (richer, still contained):
• Single socket; multiplex by
functionIdentifier.• Messages:
subscribe, ack, init, patch, error, complete, with resumeToken for reconnects.• Document with AsyncAPI (protocol:
ws). There’s .NET/Unity-friendly codegen and SDK options in the AsyncAPI ecosystem.