Client SDK JS
npx @buildinternet/releases get livekit-client-sdk-jsnpx @buildinternet/releases get livekit-client-sdk-jslk.transcription data streams and advertise client protocol 3 - #2093 (@1egoman)AudioContext.setSinkId() when switching the audio output with webAudioMix enabled, so the switch only resolves (and emits ActiveDeviceChanged) once routing succeeds, and routing failures reject instead of becoming unhandled rejections - #2276 (@1egoman)TranscriptionReceived room, participant and track events and the TranscriptionSegment type in favor of a text stream handler for the lk.transcription topic - #2093 (@1egoman)Connected and emitted Reconnected while the engine still reported a pending reconnect until its attempt settled, so events such as RoomMetadataChanged or ActiveSpeakersChanged sent in that window were buffered and never emitted. - #2186 (@ANDROIDHASSAN)TrackInvalidError for a track stopped during a processor restart or setProcessor() - #2280 (@lukasIO)setWrapperSdkInfo so SDKs built on top of livekit-client (e.g. Unity WebGL) report their own SDK and version in ClientInfo, with livekit-client's version in other_sdks - #2265 (@MaxHeimbrock)Stop re-sending the whole keyring to the E2EE worker on each enable acknowledgement, which made the worker re-derive every key once per remote publication and delayed new keys behind that work. On SignalConnected, only post the keys the worker has not received yet. Log the per-frame missing key warning only when the throttled MissingKey error is emitted. - #2250 (@facupedrazzini)
Fix connecting on browsers without Object.hasOwn or WeakRef (Safari before 15.4) - #2258 (@lukasIO)
Report REACT_NATIVE as the SDK in the v1 join request's ClientInfo, matching the sdk=reactnative query param sent on the v0 signal path - #2262 (@MaxHeimbrock)
Guard instanceof Event in the signal connect abort handler so React Native (no global Event) can still time out a hanging signal dial instead of throwing ReferenceError. - #2224 (@ninglinLiu)
performRpc now rejects with the new CONNECTION_CLOSED (1506) error when the local participant disconnects from the room. Previously a pending call stayed pending until its responseTimeout, then rejected with RESPONSE_TIMEOUT. - #2251 (@u9g)
Create the publisher data channels as negotiated (fixed IDs) in single peer connection mode when the server supports it (protocol 18), saving the data channel open round trip. Falls back to in-band channels against older servers. - #2160 (@lukasIO)
Split Room into CoreRoom plus extensions. createRoom(options, [extensions]) from livekit-client/core builds a room with only the extensions an application needs; e2ee, frameMetadata and dataStreams take their options directly. Room.dispose() releases a room for good. Video publishing (camera, screen share, simulcast, SVC, backup codecs) is the video extension; receiving video stays in core. The new livekit-client/core entry (ESM only, experimental) exports CoreRoom and the extensions. simulateParticipants and the legacy chat messages are extensions too; the core entry does not offer legacy chat. - #2141 (@lukasIO)
If the server disconnects the participant while room.connect() is still waiting for the transports (e.g. a DUPLICATE_IDENTITY leave), the connection attempt is now cancelled. Previously it kept waiting until peerConnectionTimeout, then failed over to another region and rejoined with the same token after the room had already emitted Disconnected; room.disconnect() could not stop it because the room already looked disconnected. - #2177 (@tobelesa)
Cancel an incoming data stream when its reader stops early (an aborted signal, a break out of for await, or a read error), so the stream is unregistered and later packets for it are dropped instead of buffering until the trailer arrives. A reader can no longer resume a stream after leaving its iteration early. - #2168 (@1egoman)
Conform placeholder fmtp for codecs without an fmtp line - #2182 (@eleboucher)
add datatrack data channel to sync state info - #2159 (@lukasIO)
Fix data packet decryption after the sender ratchets its key: DataCryptor now retries with the ratcheted key instead of the stored one - #2188 (@ninglinLiu)
Mark data track unpublished after republish fail - #2170 (@1egoman)
Fix an unhandled promise rejection when the signal passed to dataTracks.getDeferred() aborts, even though the caller catches the rejected promise. - #2156 (@Abhishek-B-R)
Stop playing a remote audio track in Chrome once it is detached. - #2234 (@murilo-teleo)
Fix a memory leak where a Room was never garbage collected after the application dropped it. - #2222 (@1egoman)
Keep the H.264 PPS id readable in E2EE keyframes, so that Chrome no longer drops keyframes from encoders such as Intel Quick Sync - #2181 (@lukasIO)
fix(e2ee): keep the encryption state of received tracks per track - #2246 (@lukasIO)
fix(e2ee): track the local encryption state separately from remote participants - #2245 (@lukasIO)
Speed up the emulation prevention step for encrypted H.264 and H.265 frames. writeRbsp now returns the input unchanged when no byte needs escaping, and otherwise copies runs of bytes instead of building a JS array. The output does not change. - #2184 (@lukasIO)
Stop Room.getLocalDevices() without a kind from calling getUserMedia when every device is already listed with a label. - #2232 (@RaphaelFakhri)
Ignore a late participant update for an older session of a remote participant, so it no longer removes or replaces the participant's current session in room.remoteParticipants. - #2229 (@Brian-1812)
Follow a full reconnect that happens during the initial connection (e.g. after the server moves a client off dead UDP) instead of timing out on the closed transports and tearing down the recovered session. The room stays Connecting while a resume, a restart or a browser offline event happens inside connect() and emits no SignalReconnecting, Reconnecting or Reconnected. Also stop polling the transports after the connection timeout, and reject an already-aborted transport wait as cancelled instead of leaving it pending. - #2135 (@rafaelhutter)
Limit each remote participant to 500 concurrently open incoming data streams by default. Headers for new streams beyond the limit are dropped with an error log, so a participant can no longer exhaust a receiver's memory by opening streams it never closes. The limit can be changed with the dataStream.maxOpenStreamsPerParticipant room option. - #2214 (@1egoman)
Fixes an issue where if a data stream runs into a terminal error, any packets delivered afterwards will be treated as if the stream doesn't exist (and not throw a sync error) - #2167 (@1egoman)
Apply the peerConnectionTimeout connect option to the negotiation deadline - #2189 (@ninglinLiu)
Fix the microphone pre-connect buffer never starting when preConnectBuffer is passed via publish options. - #2252 (@1egoman)
fix published type declarations for consumers with skipLibCheck: false or exactOptionalPropertyTypes - #2175 (@lukasIO)
Stop a disconnected SignalClient from logging a spurious "ping timeout triggered" warning 15 s after room.disconnect(). - #2239 (@Brian-1812)
Stop logging error reading from signal stream at error level when the signal socket was closed by the client or replaced; the read failure is now logged at debug level with the ignored close - #2192 (@ninglinLiu)
The debug log for a ratcheted E2EE key no longer includes the ratchet result, so the chain key and the new key material stay out of the console and out of log extensions. - #2213 (@lukasIO)
Keep engine.pendingReconnect accurate across reconnect attempts. A failed attempt no longer clears the handle of the retry it just scheduled (which made pendingReconnect read false while a retry was pending), and the flag now clears as soon as the reconnect timer is cleared. Buffered room events are also flushed when the engine finishes restarting if the room already reports connected. - #2193 (@1egoman)
Emit Reconnected once and keep room metadata and recording changes when a full reconnect fails over to another region - #2165 (@lukasIO)
Fix dynacast never pausing video layers on React Native: save sender encodings before skipping the stats monitor - #2163 (@davidliu)
Wait for the first frame of a screen share before reading its dimensions, so its simulcast layers are announced at the size the capture delivers instead of the requested resolution. - #2217 (@CSantosM)
Ignore signal messages received after the WebSocket is closed on React Native - #2173 (@davidliu)
fix(room): skip a deferred track the server stopped sending - #2225 (@lukasIO)
Keep the mid to track id mapping of the current publisher answer when an answer to an older offer or an answer with an empty mapping arrives in single peer connection mode, so remote tracks whose track event fires later are no longer dropped - #2196 (@ninglinLiu)
If room.disconnect() runs during the signal join, the connection attempt now rejects as cancelled instead of with a TypeError. A stale connection attempt no longer closes the engine of a newer connection or disconnects the room. - #2151 (@lukasIO)
Fix TokenSource caching: a failed fetch no longer leaves the previous response cached under the new options, and participantAttributes is compared by content - #2198 (@ninglinLiu)
Document that RemoteTrackPublication.videoQuality returns the quality requested with setVideoQuality(). It does not show the layer that adaptive stream or network bandwidth selects. - #2220 (@Brian-1812)
Reject WebSocketStream.opened when the socket closes before it opens, so that a failed, timed-out or aborted signal (re)connect on React Native no longer holds the connection lock. - #2179 (@sarankumar1325)
Release the audio contexts and web audio graphs the SDK creates. Previously they accumulated over mute/unmute cycles. They are now collected after room.disconnect(). - #2029 (@lukasIO)
detectSilence tears its context down on the throw path as well as the happy one.createAudioAnalyser disconnects its nodes before it closes the context, and it is now idempotent.releaseEmptyAudioStreamTrack is a new export, and its context closes once the last clone is handed back.webAudioMix is an object without an audioContext, a room now closes the context it created for itself.visibilitychange listener are torn down on disconnect. Previously the listener outlived every room on the page.This also fixes a false AudioSilenceDetected. Silence detection read a zero-filled buffer from a context that never reached running. An autoplay-blocked page therefore reported silence on every track it checked.
Three further behavior changes to be aware of:
room.disconnect({ stopTracks: false }) detaches the track from the audio context, which stops the processor. Call setProcessor again after you republish the track.webAudioMix, every attached element is muted, not only the first one. A second attached element no longer plays the track twice. When the audio context goes away, those elements are unmuted again and their volume is restored.Participant.setAudioContext and LocalAudioTrack.setAudioContext now return a promise. Both are marked @internal, but both appear in the published type declarations.Scale the x-google-start-bitrate hint by connection setup time: the 1 Mbps camera cap now applies to connections that set up within 1.5 s and ramps linearly down to 300 kbps at 3.5 s or slower; screen share stays uncapped. - #2146 (@changt)
Add jitter to reconnect retries in the default reconnect policy, including the first retry and reconnects requested by the server, so clients that disconnect together don't reconnect at the same time. The first retry waits a random 0 to 500 ms, and later retries scale their existing base delays by a random factor between 0.5 and 1.5. - #2124 (@RaphaelFakhri)
Publishing a backup codec now sends correctly sized video layers on that codec's own entry. Before this fix the layers were zero sized, on a field the server ignores. - #2137 (@lukasIO)
When an SEI or AUD NALU precedes the slice, encrypt h264 frames from the correct offset. Those NALUs read as h265 slice types, so detection returned h265 and the unencrypted prefix ended inside the leading NALU. The slice header was encrypted and no error was raised. The frame bytes now take precedence over a caller-supplied codec. The sender cryptor is also seeded with the publish codec for h264 and h265. A fallback to VP8 handling now logs the first bytes of the frame. - #2131 (@lukasIO)
Do not leave half of a surrogate pair when truncating an RpcError message or data to its byte limit - #2126 (@RaphaelFakhri)
Cancel in-flight full reconnects when the engine closes, preventing delayed cleanup, region failover, or join responses from reopening a disconnected session. Honor cancellation before opening a signal transport. - #2095 (@horvatz)
Fix E2EE H.264/H.265 decryption failing for encoders that emit 3-byte Annex B start codes (e.g. Intel Quick Sync on Windows). The sender now rewrites them to 4-byte start codes in the unencrypted header, matching what the receiver's depacketizer reconstructs. - #2144 (@1egoman)
On Chrome, a disconnected microphone now restarts on the OS default input instead of the first enumerated device. If a restart fails after the user stopped the track, the capture device no longer stays live - #2138 (@lukasIO)
fix: lower timeout for validating connection errors and guard against locking - #2148 (@lukasIO)
Error in-flight incoming data streams when the room disconnects instead of leaving readers pending - #2125 (@RaphaelFakhri)
fix safari specific issue where data channel could change after waiting for headroom - #2130 (@1egoman)
Lower the camera x-google-start-bitrate hint further when the browser reports a slow connection (navigator.connection.effectiveType, Chromium only): 300 kbps for 2g and slow-2g, 500 kbps for 3g. The lower of this and the connection setup time cap applies; 4g and browsers without the API keep the setup time cap alone, and screen share stays uncapped. - #2149 (@changt)
Catch the rejection from the publisher's negotiate() when ensuring the PC transport connection, so a failed offer no longer surfaces as an unhandled promise rejection - #2142 (@1egoman)
Catch the rejection from negotiate() when the server requests media sections, so a failed renegotiation no longer surfaces as an unhandled promise rejection - #2108 (@SergeAx)
Add disableIceLite connect option to request full ICE from a server running ICE lite. - #2085 (@subham2006)
Fix Document Picture-in-Picture detection reporting opener-document elements as being in PiP. isElementInPiP compared an element's coordinates (computed within its own document) against the PiP window's viewport without checking which document the element belongs to, so while any Document PiP window was open, every observed video element positioned inside the PiP window's bounds - a tile near the top-left of the page, for example - was treated as in PiP. Because HTMLElementInfo.visible is isPiP || isIntersecting, those elements also counted as visible while scrolled out of view, which affected adaptiveStream subscription and layer selection. Detection now requires the element to live in the PiP window's document, or in a frame nested inside it. - #2106 (@dkelson)
Ignore a duplicated server answer (same offerId) instead of applying it twice and surfacing a NegotiationError. - #2114 (@pblazej)
Wait for the first video frame in waitForDimensions on iPadOS, which reports a desktop user agent - #2110 (@1egoman)
Avoid attaching a new Closing/Restarting event listener for each negotiate call - #2084 (@1egoman)
Wait for first video frame to be received before responding to waitForDimension on ios - #2100 (@1egoman)
fix: wait for ReconnectResponse to arrive before declaring signal rec… - #2082 (@lukasIO)
Disable data streams v2 compression when CompressionStream exists but doesn't support deflate-raw - #2119 (@1egoman)
Retry against other LiveKit Cloud regions when the initial connection is rejected with 403. Cloud signals project-level region pinning with a 403 on the RTC paths, which was previously treated as terminal, so a client that geo-routed to a disallowed region never reached /settings/regions and failed to connect. 401 and the 404 "room does not exist" case remain terminal. - #2097 (@xianshijing-lk)
Fix unhandled RPC timeout rejections when a request fails to publish or takes longer than the ack timeout to send - #2123 (@deepanshupal)
refresh subscribed codecs after publisher answer - #2121 (@lukasIO)
fix: expose participantIdentity on RoomEvent.DataReceived - #2092 (@mariusgassen)
Add subscriberAllowPause connect option to control whether the SFU may pause subscribed video tracks when the subscriber is congested. - #2143 (@1egoman)
Fix track volume losing effect when set to 0 - #2111 (@robintown)
Write the x-google-start-bitrate hint as a single connection-level value, once per publisher connection. - #2102 (@xianshijing-lk)
libwebrtc reads this fmtp parameter per m-section but applies it to the shared Call (WebRtcVideoSendChannel::ApplyChangedParams → SetSdpBitrateParameters), where RtpBitrateConfigurator holds one config for the whole peer connection. Differing per-section values were therefore last-writer-wins on m-section order, so publishing a camera and a screen share together could seed the estimator from either one depending on SDP layout. Every video section now carries the same value: the largest hint among the sections that are currently sending.
Only sending sections count. The list of registered track bitrates is append-only, and an unpublished section keeps its a=msid, so matching a section to a track by msid alone would still pair a stale entry with the section it used to occupy — letting an uncapped screen-share target seed a connection that now carries only a camera, or consuming the one-shot hint on a section that sends nothing, which would leave later publishes with no hint at all. The section's direction distinguishes them: a=recvonly and a=inactive cannot carry local media and are exactly where an unpublished or pre-populated section lands, while a=sendonly, a=sendrecv and an omitted direction all send.
The hint is also written only on the first offer that carries local video, instead of on every offer. libwebrtc retains start_bitrate_bps and re-applies it on network route changes (RtpTransportControllerSend::OnNetworkRouteChanged), so rewriting it later is at best a no-op and at worst restarts a converged bandwidth estimator. A full reconnect builds a new peer connection and seeds the new estimator again.
Targets below 300 kbps now get no hint, matching the Rust SDK: below that, seeding above the real capacity costs more than the ramp it saves.
fix: add code 1000 to onclose handler in WebSocketStream - #2086 (@phaitonican)
fix: don't reset mid track map on publisher answers with empty map - #2089 (@lukasIO)
Support simulcast for svc codecs (vp9/av1) - #2083 (@cnderrauber)
Fix the subscriber silently buffering remote ICE candidates after a reconnect - #2054 (@xianshijing-lk)
triggerIceRestart put the subscriber into restartingIce on every reconnect, but only
setRemoteDescription clears that — and the server re-offers the subscriber only when the
reconnect moved the participant to a different node. After an ordinary signal-only resume no
offer arrives, so the flag stayed set for the lifetime of the transport and every subsequent
remote candidate was queued instead of applied, leaving the subscriber unable to adopt any new
network path the server proposed. The subscriber no longer enters that state: the server does
not send candidates ahead of the offer that introduces them, so queueing them gains nothing.
fix: ensure buffered events are flushed on signal reconnection - #2044 (@lukasIO)
fix: error on datastreams when chunks are missing - #2073 (@lukasIO)
Forward DisconnectReason to the ParticipantDisconnected event - #2055 (@seonghunYang)
fix: enqueue signal requests until queue has been drained - #2061 (@lukasIO)
Add roomOptions.dataStream.maxPayloadByteLength to control max data stream size - #2060 (@1egoman)
Fix supportsAdaptiveStream always returning true by comparing typeof against the 'undefined' string. It now returns false in environments without ResizeObserver or IntersectionObserver. - #2059 (@mrpmohiburrahman)
Treat TokenSource JWTs without exp as expired, and still honor exp when nbf is absent - #2057 (@SashaMIT)
Convert internal exports to be external in examples/demo - #2067 (@1egoman)
Decode text data streams without TextDecoder fatal mode for broader runtime support - #2037 (@JoelTowell)
fix: ensure buffered events are flushed on signal reconnection - #2043 (@lukasIO)
fix: cancel pending onTrack callbacks when subscription fails - #2019 (@lukasIO)
fix: match opus fmtp parameters by exact token and look up the opus codec case-insensitively when munging SDP - #2036 (@lukasIO)
Only run the TrackEvent.TimeSyncUpdate animation frame loop while something is subscribed to the event, and clear the frame handle when a track's monitor is stopped so the loop can be restarted - #2038 (@U-OK)
fix: emit TrackStreamStateChanged again by reading the previous stream state before overwriting it - #2039 (@tomkail)
Apply the resolved degradation preference to the backup codec's sender - #2040 (@xianshijing-lk)
Degradation preference is a property of the sender, not of the track, and a backup codec publishes over its own sender. Previously only the primary sender was configured, so the backup encoder resolved a preference implicitly and could adapt along a different axis than the primary.
fix: recover broken publish paths — act on local ConnectionQuality.Lost, recreate the peer connection when an ICE restart has no remote description, bound how long a transport may stay connecting, and reconnect (instead of disconnecting) on a detected connection state mismatch - #2030 (@lukasIO)
fix: enable Terser mangle.safari10 to fix scoping issues for variables in react-native - #2028 (@davidliu)
fix: ensure dd extension also for recvonly - #2052 (@lukasIO)
fix: emit events that were buffered during resume after declaring the room as reconnected - #2018 (@lukasIO)
Ensure empty error reasons use fallback notation - #1999 (@lukasIO)
Remove stale data track subscriber handles from the packet routing table - #2011 (@ladvoc)
Fix the reliable data channel dying under concurrent / multi-packet writes (#1995). Data-channel sends now use two-watermark flow control (fill up to a high-water mark, resume when drained to a low-water mark) and serialize contended senders through a per-kind lock, which prevents the SCTP send buffer from overflowing while keeping throughput saturated for data tracks. - #2013 (@1egoman)
Keep attached audio elements muted in startAudio() when webAudioMix is enabled, preventing double playback on platforms where element.volume has no effect (e.g. iOS Safari) - #2004 (@sawa-zen)
Add a localAudioTrack.applyConstraints method with a subset of AudioCaptureOptions - #2001 (@lukasIO)
Conform placeholder sections to the canonical fmtp for each shared payload - #1993 (@lukasIO)
Include the NonSharedUint8Array type polyfill in the published declarations. - #1997 (@1egoman)
The type was declared in an ambient .d.ts that was resolved during our own
build but never emitted to dist, so the published .d.ts files referenced a
type consumers could not resolve — surfacing as Cannot find name 'NonSharedUint8Array' under skipLibCheck: false and as Unable to follow symbol for "NonSharedUint8Array" in API Extractor (which broke downstream
packages such as @livekit/components-*). The polyfill is now an exported type
that is imported explicitly wherever it is used, so it ships in dist and the
published types type-check standalone.
Add support for user_data frame metadata trailer type - #1983 (@chenosaurus)
Properly handle maxPayloadLength of 0, upper bound maxMessageSize - #1966 (@1egoman)
Add restrictOwnAudio experimental param to AudioCaptureOptions - #1974 (@1egoman)
chore: add logging around signal connection closing for reconnections - #1980 (@lukasIO)
Enforce a maximum size of the sdp defined maxMessageSize on individual data packets sent via publishData - #1962 (@1egoman)
Add deployment to TokenSourceFetch options - #1971 (@lukasIO)
Skip pre-populated media sections for single peer connections on React Native - #1984 (@davidliu)
Ensure that sortPresets does NOT mutate values passed in via options into Room - #1979 (@1egoman)
fix: rtpMap event leak on multiple negotiations without video tracks - #1961 (@lukasIO)
Ensure clearTimeout(responseTimeoutId) is skipped when timeout isn't set yet - #1958 (@1egoman)
Send initial media sections with v1 signalling for FF - #1963 (@lukasIO)