Skip to main content

RELAY JS SDK 3.3.0 Release

· 3 min read
Daniele Di Sarli

We are happy to announce JavaScript SDK 3.3.0.

Upgrading is straightforward with our release process, which adheres to Semantic Versioning. Minor versions are guaranteed to not have breaking changes, so you can upgrade with confidence.

SignalWire Release Card

We are excited to announce the latest version of our JavaScript SDK! This release mainly focuses on a number of improvements on the side of API usability.

Highlights

A new way to join rooms

To simplify our API we have introduced a new way to join rooms. The most important entry point for the API is now the RoomSession object, which is flexible enough to support all the use cases that were covered by the old createRoomObject and joinRoom. Take a look down below to know how to update your code.

Deprecations

setMicrophoneVolume and setSpeakerVolume have been deprecated

To make our API more consistent, we have renamed the methods setMicrophoneVolume and setSpeakerVolume to, respectively, setInputVolume and setOutputVolume. Please update your code to use the new names, as the deprecated methods will be removed in a future version of the SDK.

Before (deprecated):

roomSession.setMicrophoneVolume({memberId: id, volume: -10});
roomSession.setSpeakerVolume({memberId: id, volume: -10});
member.setMicrophoneVolume({volume: -10});
member.setSpeakerVolume({volume: -10});

After:

roomSession.setInputVolume({memberId: id, volume: -10});
roomSession.setOutputVolume({memberId: id, volume: -10});
member.setInputVolume({volume: -10});
member.setOutputVolume({volume: -10});

createRoomObject and joinRoom have been deprecated

#313 5c35910

The functions createRoomObject and joinRoom have been deprecated. Their functionality has been replaced by the new RoomSession class. Please update your code to use the RoomSession class, as the deprecated methods will be removed in a future version of the SDK.

Before (deprecated):

SignalWire.Video.createRoomObject({
token: "...",
rootElementId: "stream",
video: true,
}).then(roomObject => {
roomObject.on('room.started', (e) => { console.log(e) })
roomObject.join()
}

// or:

SignalWire.Video.joinRoom({
token: "...",
rootElementId: "stream",
video: true,
}).then(roomObject => {
// here, handlers were attached *after* joining
roomObject.on('room.started', (e) => { console.log(e) })
}

After:

const roomSession = new SignalWire.Video.RoomSession({
token: "...",
rootElement: document.getElementById("stream"), // NOTE: you should now pass an HTMLElement
video: true,
})

roomSession.on('room.started', (e) => { console.log(e) })

roomSession.join()

createScreenShareObject has been deprecated

#318 cc5fd62

We have deprecated the createScreenShareObject in favor of the new startScreenShare. The new method is fully compatible: you can update your code by replacing roomSession.createScreenShareObject() invocations with roomSession.startScreenShare().

Breaking changes

Timestamp properties now are Date objects

#305 cec54bd

To make our API easier to use, we have converted the timestamp properties within the SDK to Date object. This breaking change only affects you if you are using the Recording features.

Assume rec is a RoomSessionRecording object of which you use the fields startedAt and endedAt. It may look like this:

myFunction(rec.startedAt)
myFunction(rec.endedAt)

If you upgrade to this version of the SDK, make sure to convert them back to a number to make the rest of your code compatible:

myFunction(+rec.startedAt)
myFunction(+rec.endedAt)

Fixes

We have included some minor bug fixes.