GüntherG
Convex Community4mo ago
2 replies
Günther

Realtime Support for Non-Supported Languages

We’re building an AR glasses app in Unity/C# against an existing Convex backend. The new OpenAPI generation is great for typed HTTP access, but it doesn’t expose Convex’s hallmark reactivity, so our app can’t “stay live.” I’m proposing a modest, incremental addition: a realtime subscribe/watch endpoint documented with AsyncAPI. This unlocks non-JS platforms (Unity, Unreal, IoT) with minimal surface area.

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.
Was this page helpful?