HomeGuidesAPI Reference
HubBlogChangelogSupport ForumLog In
API Reference

Node.js SDK - Runtime

Home > rainway-sdk-native > Runtime

Runtime class

Signature:

export declare class Runtime 

Properties

PropertyModifiersTypeDescription
callbacksPartial<RuntimeCallbacks>
peerIdPeerIdGet our own peer id
peersReadonlyMap<PeerId, Peer>A map of connected peers, keyed by their Peer IDs.
setLogLeveltypeof Runtime.setLogLevel
setLogSinktypeof Runtime.setLogSink
versionstringThe current native runtime version as a semver compatible string.

Methods

MethodModifiersDescription
initialize(cfg)staticInitializes rainway with the config and waits for it to connect to instant relay.
instance()staticGet the current runtime instance. Undefined if the runtime has not been initialized.
setLogLevel(lv)staticSets the global Rainway Runtime log level.WARNING: callbacks into JS are very slow, using even Warning level of logs may cause timeouts during network handling.
setLogSink(cb)staticSets the method that receives all log messages from the RainwaySDK.
shutdown()Destroys the Rainway Runtime and all associated resources.
startExportingCaptureStreamToFile(streamId, path)Starts exporting the locally captured audio and video stream to a pair of files in the specified directory.
stopExportingCaptureStreamToFile()Stops exporting the specified guest's audio and video stream.
stopStream(stream)Stop an active stream.
submitAudio(stream, submission)Submit audio to a BYOFB stream: https://docs.rainway.com/docs/byofb
submitFrame(stream, texture)Submit video to a BYOFB stream: https://docs.rainway.com/docs/byofb
version()staticThe current native runtime version as a semver compatible string.