Welcome to the technical documentation for the JavaScript SDK.

At the outer level, when you import the SignalWire JS library you get access to three different namespaces:

Video gives you access to the classes and methods that let you interface with the backend Video APIs. Chat gives you access to the classes and functions that you need to create a real-time chat application. WebRTC contains several functions that are useful for interacting with the hardware of the user's device.

Don't know where to start? Create an instance of Video.RoomSession to join a room, use the Chat.Client constructor to start a chat application, or take a look at Getting Started with the SignalWire Video API.

Namespaces

Type aliases

VideoPosition

Ƭ VideoPosition: "auto" | `reserved-${number}` | `standard-${number}` | "off-canvas"

Each video layout has a number of positions which members can be assigned to. This type enumerates all the available position names. Note that not all these position names may be available within a given layout.

  • auto: the position of the member in the layout is determined automatically.
  • reserved-n: the n-th reserved position in the layout (e.g. reserved-3).
  • standard-n: the n-th standard position in the layout (e.g. standard-3).
  • off-canvas: the member is hidden outside the layout.

VideoPositions

Ƭ VideoPositions: Record<string, VideoPosition>

An object whose keys represent member IDs, and values are chosen from VideoPosition. Instead of a member ID, in some contexts you can use the special keyword self if you don't know yet the ID of the member which is going to be created.

For example:

{
  "1bf4d4fb-a3e4-4d46-80a8-3ebfdceb2a60": "reserved-1",
  "e0c5be44-d6c7-438f-8cda-f859a1a0b1e7": "auto"
}

Or:

{
  "self": "reserved-1"
}