OptionalconnectionConnection timeout in milliseconds. By default, it is set to 15000 ms (15 seconds). Use 0 to disable the timeout.
OptionaldriverSignaling driver instance for message exchange between peers. If omitted, a default in-memory driver is used, which is suitable for testing purposes only.
OptionaliceDebounce time in milliseconds for batching ICE candidates before sending them through signaling to minimize the number of messages. By default, it is set to 50 ms.
OptionaliceAn array of objects, each describing one server which may be used by the ICE agent; these are typically STUN and/or TURN servers. If this isn't specified, the connection attempt will be made with no STUN or TURN server available, which limits the connection to local peers. Empty by default.
OptionaliceICE policy used by created RTCPeerConnection instances. If set to "relay", only relay candidates will be used, otherwise all candidates will be considered.
OptionalidUnique identifier for the room. Uses "default" if omitted.
OptionalnamespaceEnable hashing of namespaces in signaling messages for privacy. Enabled by default.
OptionalsignalingEnable compression for signaling messages to reduce bandwidth usage by about 40%. A message is compressed only for a peer that has shown it can decompress, so the first messages to a peer may be uncompressed. Enabled by default.
OptionalsignalingEncrypt signaling messages between peers with AES-GCM, using keys derived with ECDH from each peer's ID, which is its public key. This hides the messages, including peer metadata and SDP, from the signaling backend and other observers. Peer IDs are not authenticated, so it does not protect against a backend that actively impersonates peers. Enabled by default.
OptionalverifyOptional callback to accept or reject incoming peer connections. It may be called more than once for the same peer.
Options describing the incoming peer connection.
Peer identifier and the metadata it joined with.
Metadata of remote peers comes from the network and is not validated, so
check it in the room's verify callback before relying on its type.
Peer identifier.
Optionalmetadata?: MMetadata the peer joined with.
A boolean or promise indicating whether the incoming connection should be accepted.
OptionalwebrtcWebRTC classes to use instead of the globals, for runtimes such as Node.js that do not provide them. Each class falls back to its global.
Configuration options for creating a Room instance.