Skip to main content

RELAY JS SDK 3.14.0 Release

· 2 min read
Renae Sowald

We are happy to announce JavaScript SDK 3.14.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

Today we are releasing version 3.14 of the JavaScript SDK. There are several improvements and fixes. Here are the highlights.

Highlights

getAllowedChannels in PubSub and Chat

The new method getAllowedChannels is available to PubSub and Chat namespaces. d8cf078

It returns the channels that the current token allows you to subscribe to as well as the permissions you have for each channel. The return is structured as an object whose keys are the channel names and whose values are the permissions. For example:

{
"channel-1": { "read": true, "write": false },
"channel-2": { "read": true, "write": true },
}

Methods to Manage Metadata

We have added several new methods to manage metadata in a Video room session. d7ce34d

  • roomSession.updateMeta updates the room's metadata only in specified fields. This is different from the existing method setMeta which replaces the whole metadata object.
  • roomSession.deleteMeta deletes specific keys from the metadata of the current room session.
  • roomSession.updateMemberMeta updates a member's metadata only in specified fields. The existing method setMemberMeta replaces the whole metadata object.
  • roomSession.deleteMemberMeta deletes specific keys from the metadata of the desired member.

These four methods work similarly. Let's look at updateMeta as an example.

roomSession.on("room.updated", (e) => {
// We can set an event listener to log changes to the metadata.
console.log(e.room.meta);
});
await roomSession.setMeta({ foo: "bar", baz: true });
// The log will print { foo: "bar", baz: true },
await roomSession.updateMeta({ baz: false, t: 10 });
// After the call to `updateMeta` our log will print { foo: "bar", baz: false, t: 10 }.

Note that for any of these methods, you must specify the room.set_meta permission when creating the Video Room Token.

Other Improvements

  • Updated RoomSession.getRecordings and RoomSession.getPlaybacks to return stateful objects and deprecated RoomSession.recordings in favour of the getter methods. eb1c3fe
  • Changed handling of the auto managed rootElement to avoid mutating its styles. 24e956a
  • Reviewed socket closed event handling to improve connection retries. 7bdd7ab

Fixes

  • When destroying the client, added a short delay to allow all of the sagas to complete their tasks.. 7b19610