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
2. WebSocket “live query” channel (richer, still contained): • Single socket; multiplex by
- 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.2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Made an issue here:
https://github.com/get-convex/convex-helpers/issues/789
GitHub
AsyncAPI Spec Generation (and a “Standard Specs” generator that...
Summary convex-helpers already generates an OpenAPI 3 spec from a Convex deployment, which is great for typed HTTP clients in other languages. I’m proposing a sibling AsyncAPI spec generator, and a...