Releases: signalwire/signalwire-js
@signalwire/realtime-api v3.4.0
Version 3.4.0 of the Realtime SDK is here! We have added several methods, improved event handling, and fixed some bugs. Here are the highlights.
Highlights
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 methodsetMeta
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 methodsetMemberMeta
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
andRoomSession.getPlaybacks
to return stateful objects and deprecatedRoomSession.recordings
in favour of the getter methods. eb1c3fe - Exposed
client.disconnect()
methods on all of the client objects in Video, Chat, PubSub, Task, Voice, and Messaging. 7b19610 - Reviewed socket closed event handling to improve connection retries. 7bdd7ab
Fixes
@signalwire/js v3.14.0
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 methodsetMeta
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 methodsetMemberMeta
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
andRoomSession.getPlaybacks
to return stateful objects and deprecatedRoomSession.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
@signalwire/realtime-api v3.3.1
@signalwire/realtime-api v3.3.0
Today we are releasing version 3.3 of the Realtime SDK. It consists of a couple of improvements and fixes.
Highlights
Video Playback
We have exposed methods to seek
a specific video position during playback. d308daf
These include:
playback.seek(timecode)
seeks the current playback time to the specified absolute position.
const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
await playback.seek(30_000); // 30th second
playback.forward(offset)
seeks the current playback time forward by the specified offset.
const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
await playback.forward(5000); // 5 seconds
playback.rewind(offset)
seeks the current playback time backward by the specified offset.
const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
await playback.rewind(5000); // 5 seconds
Note that the boolean property seekable
has been added to RoomSessionPlayback
to support these methods.
Improvements
- Removed the option to pass
volume
from methods of Voice.Playlist typings. 9eb9851
Fixes
- Fixed issue with missing
member.update
events. 8ec914b
@signalwire/js v3.13.0
Version 3.13 of the JavaScript SDK is out! We have added a couple of improvements. Here are the highlights.
Highlights
RoomSession event room.left
- We have added a new event
room.left
which allows users to listen for when a RoomSession's creator leaves the RoomSession. 20f61a7
For example:
room.on("room.left", () => {
console.log("You have left the room.")
});
Video Playback
We have exposed methods to seek
a specific video position during playback. d308daf
These include:
playback.seek(timecode)
seeks the current playback time to the specified absolute position.
const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
await playback.seek(30_000); // 30th second
playback.forward(offset)
seeks the current playback time forward by the specified offset.
const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
await playback.forward(5000); // 5 seconds
playback.rewind(offset)
seeks the current playback time backward by the specified offset.
const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
await playback.rewind(5000); // 5 seconds
Note that the boolean property seekable
has been added to RoomSessionPlayback
to support these methods.
Improvements
- Enabled
pingSupported
by default for all WebRTC Connections to check for disconnected participants. 4300716
Fixes
- Patch to address occasional screen share hangups. bbc21e4
@signalwire/realtime-api v3.2.0
@signalwire/js v3.12.1
This is a maintenance release that contains a couple of minor fixes.
Fixes
@signalwire/realtime-api v3.0.1
@signalwire/js v3.11.1
This is a maintenance release that contains a couple of minor fixes.
Fixes
@signalwire/realtime-api v3.0.0
This release marks the beginning of the RELAY Realtime SDK with the integration of Voice and Messaging RELAY with our existing Realtime SDK for Video and Chat.
Highlights
Voice
You can now instantiate a Voice Client, subscribe to events, and make and answer calls. For example:
import { Voice } from '@signalwire/realtime-api';
const client = new Voice.Client({
project: '<project-id>',
token: '<project-token>',
contexts: '<context>'
});
client.on('call.received', async (call) => {
console.log('Got call', call.id, call.from, call.to, call.direction);
});
try {
const call = await client.dialPhone({
to: 'to number',
from: 'from number',
timeout: 30,
})
console.log('Dial resolved!', call.id)
} catch (error) {
console.error('Connect Error', error)
};
With Voice
, you can also
- record audio
- play audio
- listen for digits or speech using
prompt()
Messaging
You can use the same structure to instantiate a Messaging Client, subscribe to events, and send and receive messages.
import { Messaging } from '@signalwire/realtime-api';
const client = new Messaging.Client({
project: '<project-id>',
token: '<project-token>',
contexts: '<context>'
});
client.on('message.received', (message) => {
console.log('message.received', message)
})
try {
const response = await client.send({
from: '+1xxx',
to: '+1yyy',
body: 'Hello World!',
})
console.log('>> send response', response)
} catch (error) {
console.log('>> send error', error)
}