Web SDK - RainwayRuntime

Home > rainway-sdk > RainwayRuntime

RainwayRuntime class

The main entry point to the Rainway SDK runtime.

To initialize: const runtime = await RainwayRuntime.initialize(config);

To connect to a peer by hostname: const peer = runtime.connect(hostname);

For more info, see: https://docs.rainway.com/tutorial/what-is-rainway


export declare class RainwayRuntime 




cancelConnectionAttempt(peerId)Cancel the pending connection attempt to a hostname, if there is one.
connect(peerId)Connect to another peer on the Rainway Network.
dispose()Disconnect, remove listeners and clean up internal state.After calling this, you will need to call RainwayRuntime.initialize from scratch.
getMediaCapabilities(config)Get info about media decoding capabilities.
getPeerId()Get the Peer ID for this Rainway instance.A PeerID identifies a Rainway instance to other instances, and on web is persisted in LocalStorage.
initialize(config)staticInitialize a instance of the Rainway runtime and connect it to the Rainway servers.This should only be called once, and the resulting object is used to manage multiple connections.
setLogSink(logSink)Set a handler for Rainway SDK-related logging.