Answer · TypeScript · WebSocket
TypeScript WebSocket client
Answer: mirror the Node ws reconnect answer with typed message unions (ping | snapshot | delta | error). Builder (€99/mo) required for /v1/stream.
Sketch#
type Msg =
| { type: 'ping' }
| { type: 'snapshot'; part: number; final: boolean; events: unknown[]; markets: unknown[] }
| { type: 'delta'; changes: unknown[] };
// npm i ws @types/ws
Full reconnect logic: Node answer.
Trial CTA#
Builder (€99/mo) for WebSocket and closing history. 3-day trial; card required, charged after day 3 unless cancelled. Free REST: signup. Related: answers hub, docs.
See also: Deno client, Bun client.
Questions people ask#
Is there an official SDK?#
No required SDK — plain WebSocket + JSON.
Can Deno/Bun clients work?#
Yes if they speak WebSocket and set the API key header or query.
Is this educational content for adults?#
Yes (18+).