All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
NostrDriver signals over Nostr relays you pass in, signing events with a built-in BIP-340 Schnorr implementation, so it needs no server or library of your own.protocol is raw: send() passes strings and binary data straight to it with no chunking or acknowledgments, and on an unreliable channel drops a message while the buffer is backed up. channel:message events for it have raw: true and data as the payload itself.channel:message events have a type field ("text", "json", "blob", or "bytes") that tells what data resolves to.Room, Peer, and their events take a metadata type parameter, as in new Room<{ name: string }>(), and Addon takes an event map type parameter. The new PeerInfo type describes a peer's id and metadata.on() and once() return a function that removes the handler and accept a signal option that removes it when aborted.HANDLER_ERROR events on their room or peer, or as error events on their driver, instead of becoming uncaught exceptions.webrtc room option passes RTCPeerConnection and MediaStream classes to use instead of the globals, so a peer can run in Node.js with @roamhq/wrtc. Without MediaStream, a peer handles data only.on(), once(), off(), and emit() take a single event name instead of an array. Subscribe to each event separately, or use a general event such as connection, channel, stream, or track. Each call is a separate subscription, and handlers run in a microtask in emit order.connectionTimeout is in milliseconds, like the other time options, and defaults to 15000. Multiply existing values by 1000.protocol, send() works only on ordered, reliable channels, and fails on channels with maxRetransmits or maxPacketLifeTime.MemoryDriver no longer takes a delay option.ChannelEvent is a union of ChannelStateEvent, ChannelMessageEvent, and ChannelErrorEvent, so data and error are no longer optional on the events that carry them.room.send() without to sends only to peers whose channel is open. With to, it fails before sending if a target is unknown or has no open channel. Send failures are PeerixErrors with the DATACHANNEL_ERROR code. send() also fails with Info cannot be serialized to JSON when info can't be serialized, rejects a function or symbol message, and reads binary data and JSON objects at call time, as RTCDataChannel.send does.join() resolves with the local peer when the room is already joined. Joins and leaves run in call order, and concurrent calls share one subscription. A room announces itself once per join, after both of its namespaces are subscribed. Peers that join at the same time no longer stall until the connection timeout: only one side of each pair starts the connection, so the verify callback may be called more than once for the same peer.SIGNALING_ERROR events while joined.track:remove, stream:remove, and channel:close for its remote streams and channels before connection:closed.room.attach() and room.detach() do nothing for an addon that is already attached or not attached. Room.emit(), Peer.emit(), and the internal signal event are no longer part of the public API.Encryption key not found. connectionTimeout: 0 disables the connection timeout instead of closing every peer immediately, a peer whose ICE state moves to completed counts as connected, and concurrent signals from one peer, or a join and leave racing with verification, no longer create duplicate or stale peers that leak their RTCPeerConnection. leave() closes every peer even if unsubscribing fails.share() and peers still connecting, and a track shared under a second label is no longer sent twice. Re-sharing, unsharing, and ended tracks update the remote side, peer.unshare() no longer stops tracks shared with the whole room, and ended listeners are no longer leaked. share() rejects an invalid stream with MEDIASTREAM_ERROR.AbortSignals, and closed channels fail transfers at once with a clear reason instead of hanging, and a message nobody listens for is discarded instead of stalling its sender. A transfer on a slow link fails only once the channel buffer stops draining for 10 seconds. Empty messages are delivered, and a superseded incomplete transfer fails instead of resolving with truncated data.room.send(stream, { to }) splits the stream only between the target peers, and a failed or stopped transfer aborts the rest. A broadcast room.send() keeps sending to the other peers when one stalls or fails mid-transfer, and rejects with that failure once every transfer has ended.@roamhq/wrtc work: a data channel that is already open when Peerix receives it reports channel:open instead of never opening, and 65535 reported for unset maxRetransmits or maxPacketLifeTime is treated as reliable instead of rejecting sends as unsupported.DecompressionStream, can connect: signaling messages are compressed only for peers that advertise they can decompress them. Streamed data can be iterated with for await in Safari, and ICE candidates without a usernameFragment are applied instead of dropped.SIGNALING_ERROR events instead of being dropped or rejected unhandled.PeerixError keeps its code, cause, and stack when it wraps another error and always has a string message.SseDriver reopens connections the browser gives up on, times out subscribes that never open, shares one connection per namespace, makes subscriber and publisher optional, sends Headers or array publisher headers, waits for a reconnecting connection in subscribe(), and reports errors as Error instances with the original event as cause.SupabaseDriver delivers messages on a real Supabase backend: it sends { ns, data } objects as the Realtime REST API requires and routes each broadcast only to the namespace of its channel. It waits for the channel join before subscribe() resolves, keeps shared channels until the last handler unsubscribes, ignores payload-less broadcasts, and rejects failed publishes.CentrifugeDriver waits for subscriptions to be ready, can rejoin after leaving, emits the base driver events, is inactive while reconnecting, and rejects a pending subscribe() when its namespace is unsubscribed or the driver is destroyed.MqttDriver and SocketIoDriver reject subscribes cancelled before the acknowledgment, stay inactive when destroyed mid-reconnect, and unsubscribe on destroy(). MqttDriver rejects subscriptions the broker refuses, fails one the broker doesn't acknowledge within 10 seconds, like the other drivers, and goes inactive on every closed connection. SocketIoDriver honors server error acks with ackTimeout.NatsDriver goes inactive when the connection closes or drains, and forwards nats.js v3 status errors.NatsDriver and CentrifugeDriver resubscribe with backoff when the server ends one, and NatsDriver waits for the server to accept it (via flush(), when the client has it) before rooms announce again. SupabaseDriver rejoins a channel the server closed. A namespace that fails to subscribe no longer turns the whole driver inactive: MqttDriver, SocketIoDriver, SupabaseDriver and SseDriver retry it on its own with backoff, and rooms announce themselves again once it is restored.CentrifugeDriver, MqttDriver, SocketIoDriver, SseDriver, and SupabaseDriver keep receiving on a namespace that is unsubscribed and subscribed again while its join is pending. BroadcastChannelDriver ignores foreign messages, BroadcastChannelDriver and MemoryDriver ignore calls after destroy(), and Driver.destroy() delivers inactive before removing handlers.Room class as the top-level entry point for managing a room and its peers.me object returned by the join() method contains the id and metadata of the local peer.id option in the Room constructor instead of passed to join().join() no longer accepts a room name and now returns local peer information ({ id, metadata }).Peer class replaced the previous RemotePeer — it is now a peer connection handler created by Room.remote property on event payloads renamed to peer across all events.Room for local sharing have an undefined peer, allowing consumers to distinguish local from remote updates.connections property renamed to peers.local:join, local:leave, local:share, local:unshare, local:open, local:close). Use the stream and track events without a peer property for local stream sharing instead.local:join and local:leave events emitted when join() / leave() methods are called.local:share and local:unshare events emitted when share() / unshare() methods are called.local:open and local:close events emitted when open() / close() methods are called.managed is true).namespace option in signaling drivers is now a string instead of string[].share() / unshare() no longer return a MediaStream.managed now means the stream is externally managed and will not be stopped or unshared automatically.ReadableStream data in the send() method.info field) when sending messages.toJSON() method on peer classes to serialize peer information.send() now returns an async iterator (for tracking transmission progress) or a Promise (for delivery confirmation).ReadableStream or a Promise — read the stream to track receiving progress, or await the Promise to receive the full message.default label when label is omitted).MqttDriver for signaling over MQTT via WebSockets.CentrifugeDriver for signaling with a Centrifuge backend.ackTimeout option in SocketIoDriver to configure server acknowledgment timeout.iceCandidateDebounce option in Peer to configure ICE candidate debounce interval.dispatch to publish in the Driver interface for consistency with messaging terminology.publish / unpublish to share / unshare in Peer and RemotePeer to avoid confusion with the driver publish() method.SseDriver defaults to a Mercure-compatible endpoint (/.well-known/mercure).active property in drivers defaults to false.prefix option concatenate it directly to the event name without a separator — include a separator in the prefix if desired.SseDriver for signaling via Server-Sent Events (SSE).BigInt.signalingHashing option to namespaceHashing.SocketIoDriver for signaling via Socket.IO.SupabaseDriver for signaling via Supabase Realtime.destroy() method in supported drivers.nats-core instead of nats.ws.