Skip to content

Releases: signalwire/signalwire-js

@signalwire/realtime-api v3.4.0

17 Aug 14:13
b5cb0b7
Compare
Choose a tag to compare

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 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
  • 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

  • Always connect the lower-level client without waiting for an event listener. 7b19610
  • Removed updateToken method and session.expiring event from the Realtime API Chat and PubSub because they only need to be accessed from the JavaScript API. f421f92

@signalwire/js v3.14.0

17 Aug 14:13
b5cb0b7
Compare
Choose a tag to compare

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

@signalwire/realtime-api v3.3.1

28 Jul 17:27
0e06fb1
Compare
Choose a tag to compare

This is a small maintenance release.

Improvements

  • Improved auto-subscribe logic in Video and PubSub namespaces. 6bc89d8

Fixes

  • Fixed missing export for DeviceBuilder. b2abd7a

@signalwire/realtime-api v3.3.0

14 Jul 21:19
0d2eefb
Compare
Choose a tag to compare

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

14 Jul 20:28
0d2eefb
Compare
Choose a tag to compare

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

27 Jun 16:17
80830d7
Compare
Choose a tag to compare

This is a small release that contains a couple of minor fixes and improvements.

Improvements

  • Expose getRoomSessions() and getRoomSessionById() on the VideoClient to retrieve in-progress RoomSessions. (#580) e8a54a6
  • Expose removeAllMembers() on RoomSession (#581) 14c08b8

@signalwire/js v3.12.1

27 Jun 16:18
80830d7
Compare
Choose a tag to compare

This is a maintenance release that contains a couple of minor fixes.

Fixes

  • Fix issue with missing constructors on react-native. (#574) 4e35e0a
  • Add default width/height for video constraints. (#578) 2bd390d
  • Fix a possible condition where the localVideo overlay shows up after a video mute and video unmute in sequence without any layout changes in between. (#579) 3cd2bab

@signalwire/realtime-api v3.0.1

02 Jun 18:07
eb735ca
Compare
Choose a tag to compare

This is a maintenance release that contains a couple of minor fixes and improvements.

Fixes

  • Fix task.received handler on the Task namespace. (#553) 47ed171

Improvements

  • Add layoutName to the RoomSession interface. (#542) 875b2bb

@signalwire/js v3.11.1

02 Jun 18:07
eb735ca
Compare
Choose a tag to compare

This is a maintenance release that contains a couple of minor fixes.

Fixes

  • Try to force a browser repaint to move the local video overlay to the correct position (#541) 4ad0935
  • Fix issue with local streams when the user joins with a token with join_audio_muted or join_video_muted. Update typings. (#554) 1b95b93

@signalwire/realtime-api v3.0.0

20 May 01:20
ad778c3
Compare
Choose a tag to compare

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)
}

Fixes

  • Fix: expose all the active recordings on the room.joined event (#501) 5c96bf8

Improvements

  • We have introduced the PubSub namespace to keep the minimal PubSub functionality available to users as Chat continues to develop (#533) b6d5bb3