WebSocket
WebSocket is the default transport. It works everywhere: all browsers, Node.js, React Native, and any environment that supports standard WebSocket connections.| URL | wss://{projectId}.larkdb.net/ws |
| Delivery | Reliable, ordered TCP delivery. Every message arrives, in order. |
| Compatibility | Universal. If your client can make a network connection, it can use WebSocket. |
WebTransport
WebTransport is a modern protocol built on HTTP/3 and QUIC. It’s available in newer browsers and provides meaningful advantages for real-time applications.| URL | https://{projectId}.larkdb.net:{port}/wt (port randomly assigned from 7778-7809 for load balancing) |
| Delivery | QUIC streams for reliable data, plus UDP datagrams for volatile paths. |
| Compatibility | Chrome 97+, Edge 97+, Firefox 114+. Not yet available in Safari, Node.js, or React Native. |
WebTransport advantages
WebTransport has two key advantages over WebSocket: No head-of-line blocking. With WebSocket (TCP), if one packet is lost, every subsequent packet waits until the lost one is retransmitted. A dropped packet carrying a chat message stalls cursor updates, game state, everything. With WebTransport (QUIC), each stream is independent. A lost packet on one stream doesn’t block other streams. UDP datagrams for volatile data. Volatile writes over WebTransport use UDP datagrams, providing unreliable, unordered delivery with zero retransmission overhead. For data like cursor positions where you only care about the latest value, this is ideal. A lost datagram is irrelevant because a newer one is already on the way.These advantages matter most under packet loss, which is common on mobile networks, congested Wi-Fi, and cross-continent connections. On a clean local network, WebSocket and WebTransport perform similarly.
Transport selection
By default, the SDK uses WebSocket. To use WebTransport, set thetransport option explicitly:
'auto' mode, the SDK tries WebTransport first. If the connection fails or doesn’t establish within webtransportTimeout milliseconds, it falls back to WebSocket transparently.
When to prefer WebTransport
Choose WebTransport when:- Your app uses volatile paths for game state, cursors, or other high-frequency data. The UDP datagram support gives you faster, lower-overhead delivery.
- Your users are on modern browsers (Chrome, Edge, or Firefox).
- Your app is latency-sensitive and your users may be on spotty connections where head-of-line blocking hurts.
When WebSocket is fine
WebSocket is the right choice for most applications. It’s mature, universal, and performant. You won’t notice a difference unless you’re pushing high-frequency volatile updates or operating under significant packet loss. Stick with the default WebSocket when:- Your app doesn’t use volatile paths.
- You need to support Safari, Node.js, or React Native.
- Your users are on reliable connections.
- You just want things to work everywhere without thinking about it.
What’s next
Volatile paths
High-frequency data that takes full advantage of WebTransport datagrams.
Connecting
Configure transports, timeouts, and connection lifecycle in the Lark SDK.

