Skip to content

Vonage Video

github-actions edited this page Apr 22, 2025 · 2 revisions

Documentation


Documentation / Vonage Video

Vonage Video SDK for Node.js

GitHub Workflow Status Codecov Latest Release Contributor Covenant License

Vonage

This is the Vonage Video SDK for Node.js for use with Vonage APIs. To use it you will need a Vonage account. Sign up for free at vonage.com.

For full API documentation refer to developer.vonage.com.

Installation

We recommend using this SDK as part of the overall @vonage/server-sdk package. Please see the main package for installation.

You can also use this SDK standalone if you only need access to just the Video API.

With NPM

npm install @vonage/video

With Yarn

yarn add @vonage/video

Usage

If you are using this SDK as part of the Vonage Server SDK, you can access it as the video property off of the client that you instantiate.

const { Auth } = require('@vonage/auth');
const { Vonage } = require('@vonage/server-sdk');

const credentials = new Auth({
  apiKey: API_KEY,
  apiSecret: API_SECRET
});
const options = {};
const vonage = new Vonage(credentials, options);

const session = await vonage.video.createSession();

Standalone

The SDK can be used standalone from the main Vonage Server SDK for Node.js if you only need to use the Video API. All you need to do is require('@vonage/video'), and use the returned object to create your own client.

const { Auth } = require('@vonage/auth');
const { Video } = require('@vonage/video');

const credentials = new Auth({
  applicationId: APP_ID,
  privateKey: PRIVATE_KEY_PATH,
});
const options = {};
const videoClient = new Video(credentials, options);

Where credentials is any option from @vonage/auth, and options is any option from @vonage/server-client

Promises

This SDK uses Promises to return data.

const session = await videoClient.createSession();

Testing

Run:

npm test

Supported APIs

The following is a list of Vonage Video APIs and whether the SDK provides support for them:

API Supported?
Session Creation
Signaling
Force Muting
Archiving
SIP Interconnect
Live Streaming Broadcasts
Experience Composer

Enumerations

ArchiveMode

Defined in: video/lib/types/ArchiveMode.ts:4

Enum representing different archive modes.

Enumeration Members

Enumeration Member Value Description Defined in
ALWAYS "always" Archive mode set to 'always', where archives are continuously recorded. video/lib/types/ArchiveMode.ts:13
MANUAL "manual" Archive mode set to 'manual', where archives are started and stopped manually. video/lib/types/ArchiveMode.ts:8

ArchiveOutputMode

Defined in: video/lib/enums/ArchiveOutputMode.ts:4

Enum representing different output modes for video archives.

Enumeration Members

Enumeration Member Value Description Defined in
COMPOSED "composed" Represents the composed output mode where all streams are mixed into one. video/lib/enums/ArchiveOutputMode.ts:8
INDIVIDUAL "individual" Represents the individual output mode where each stream is recorded separately. video/lib/enums/ArchiveOutputMode.ts:13

AudioRate

Defined in: video/lib/enums/AudioRate.ts:4

Enum representing different audio sample rates.

Enumeration Members

Enumeration Member Value Description Defined in
16KHZ 16000 Represents an audio sample rate of 16 kHz. video/lib/enums/AudioRate.ts:8
8KHZ 8000 Represents an audio sample rate of 8 kHz. video/lib/enums/AudioRate.ts:13

CaptionStatus

Defined in: video/lib/enums/CaptionStatus.ts:4

Enum representing different captioning status.

Enumeration Members

Enumeration Member Value Description Defined in
FAILED "failed" Indicates that captioning has failed. video/lib/enums/CaptionStatus.ts:23
PAUSED "paused" Indicates that captioning has been paused. video/lib/enums/CaptionStatus.ts:18
STARTED "started" Indicates that captioning has started. video/lib/enums/CaptionStatus.ts:8
STOPPED "stopped" Indicates that captioning has stopped. video/lib/enums/CaptionStatus.ts:13

ExperienceComposerResolution

Defined in: video/lib/enums/ExperienceComposerResolution.ts:6

Enum representing different resolutions for an experience composer.

Enumeration Members

Enumeration Member Value Description Defined in
HD_LANDSCAPE "1280x720" High definition landscape resolution. video/lib/enums/ExperienceComposerResolution.ts:20
HD_PORTRAIT "720x1280" High definition portrait resolution. video/lib/enums/ExperienceComposerResolution.ts:25
SD_LANDSCAPE "640x480" Standard definition landscape resolution. video/lib/enums/ExperienceComposerResolution.ts:10
SD_PORTRAIT "480x640" Standard definition portrait resolution. video/lib/enums/ExperienceComposerResolution.ts:15

LayoutType

Defined in: video/lib/enums/LayoutType.ts:4

Enum representing different layout types for live streaming broadcasts.

Enumeration Members

Enumeration Member Value Description Defined in
BEST_FIT "bestFit" Automatically determine the best fit layout. video/lib/enums/LayoutType.ts:8
CUSTOM "custom" Use a custom layout for the broadcast. video/lib/enums/LayoutType.ts:13
HORIZONTAL_PRESENTATION "horizontalPresentation" Horizontal presentation layout. video/lib/enums/LayoutType.ts:18
PIP "pip" Picture-in-picture (PIP) layout. video/lib/enums/LayoutType.ts:23
VERTICAL_PRESENTATION "verticalPresentation" Vertical presentation layout. video/lib/enums/LayoutType.ts:28

MediaMode

Defined in: video/lib/enums/MediaMode.ts:4

Enum representing media modes for a session.

Enumeration Members

Enumeration Member Value Description Defined in
RELAYED "enabled" Relayed mode where media is enabled. video/lib/enums/MediaMode.ts:13
ROUTED "disabled" Routed mode where media is disabled. video/lib/enums/MediaMode.ts:8

Resolution

Defined in: video/lib/enums/Resolution.ts:4

Enum representing different video resolutions for live streaming broadcasts.

Enumeration Members

Enumeration Member Value Description Defined in
FHD_LANDSCAPE "1920x1080" Full HD landscape resolution (1920x1080 pixels). video/lib/enums/Resolution.ts:8
FHD_PORTRAIT "1080x1920" Full HD portrait resolution (1080x1920 pixels). video/lib/enums/Resolution.ts:13
HD_LANDSCAPE "1280x720" HD landscape resolution (1280x720 pixels). video/lib/enums/Resolution.ts:18
HD_PORTRAIT "720x1280" HD portrait resolution (720x1280 pixels). video/lib/enums/Resolution.ts:23
SD_LANDSCAPE "640x480" Standard definition landscape resolution (640x480 pixels). video/lib/enums/Resolution.ts:28
SD_PORTRAIT "480x640" Standard definition portrait resolution (480x640 pixels). video/lib/enums/Resolution.ts:33

StreamMode

Defined in: video/lib/enums/StreamMode.ts:4

Enum representing different stream modes for live streaming broadcasts.

Enumeration Members

Enumeration Member Value Description Defined in
AUTO "auto" Streams are selected automatically based on session rules. video/lib/enums/StreamMode.ts:8
MANUAL "manual" Streams are manually selected for inclusion in the broadcast. video/lib/enums/StreamMode.ts:13

Classes

Video

Defined in: video/lib/video.ts:85

Video Client for managing and interacting with video-related operations in your application. This client allows you to control sessions, streams, archives, broadcasts, and various video-related features.

Usage:

  • Create and manage video sessions with customizable settings.
  • Control video streams, including muting, adding, and removing streams.
  • Initiate SIP calls and establish WebSockets for real-time communication.
  • Enable and disable captions for improved accessibility.
  • Start, stop, and manage video archives and broadcasts.
  • Render experiences and access detailed information about streams and archives.
  • Generate client tokens for secure session connections.
  • Perform various video-related operations with ease.

Remarks

The Video Client is designed to simplify video management tasks within your application. It provides a comprehensive set of methods and options to configure and control video interactions seamlessly.

Examples

Create a standalone Video client

import { Video } from '@vonage/video';

const videoClient = new Video({
 apiKey: VONAGE_API_KEY,
 apiSecret: VONAGE_API_SECRET
});

Create an Video client from the Vonage client

import { Vonage } from '@vonage/server-client';

const vonage = new Vonage({
  apiKey: VONAGE_API_KEY,
  apiSecret: VONAGE_API_SECRET
});

const videoClient = vonage.video;

Extends

Constructors

Constructor
new Video(credentials, options?): Video;

Defined in: server-client/dist/lib/client.d.ts:35

Creates a new instance of the Client.

Parameters
credentials

The authentication credentials or an authentication instance.

AuthParams | AuthInterface

options?

ConfigParams

Optional configuration settings for the client.

Returns

Video

Inherited from

Client.constructor

Properties

auth
protected auth: AuthInterface;

Defined in: server-client/dist/lib/client.d.ts:24

The authentication instance responsible for generating authentication headers and query parameters.

Inherited from

Client.auth

authType
protected authType: AuthenticationType = AuthenticationType.JWT;

Defined in: video/lib/video.ts:86

The type of authentication used for the client's requests.

Overrides

Client.authType

config
protected config: ConfigParams;

Defined in: server-client/dist/lib/client.d.ts:28

Configuration settings for the client, including default hosts for various services and other request settings.

Inherited from

Client.config

transformers
static transformers: object;

Defined in: server-client/dist/lib/client.d.ts:11

Static property containing utility transformers.

camelCaseObjectKeys
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys
kebabCaseObjectKeys: PartialTransformFunction;
omit()
omit: (keys, obj) => TransformedObject;
Parameters
keys

string[]

obj

ObjectToTransform

Returns

TransformedObject

snakeCaseObjectKeys
snakeCaseObjectKeys: PartialTransformFunction;
Inherited from

Client.transformers

Methods

addArchiveStream()
addArchiveStream(
   archiveId, 
   streamId, 
   audio?, 
video?): Promise<void>;

Defined in: video/lib/video.ts:103

Adds a stream to an existing archive, allowing you to include additional streams in the archive recording.

Parameters
archiveId

string

The ID of the archive to which you want to add a stream.

streamId

string

The ID of the stream you want to add to the archive.

audio?

boolean = true

Whether to include audio from the added stream (default: true).

video?

boolean = true

Whether to include video from the added stream (default: true).

Returns

Promise<void>

A promise that resolves when the stream has been successfully added to the archive.

Throws

If an error occurs while adding the stream to the archive.

Example
await videoClient.addArchiveStream(ARCHIVE_ID, STREAM_ID);
addAuthenticationToRequest()
addAuthenticationToRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:43

Adds the appropriate authentication headers or parameters to the request based on the authentication type.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addAuthenticationToRequest

addBasicAuthToRequest()
protected addBasicAuthToRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:71

Adds basic authentication headers to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addBasicAuthToRequest

addJWTToRequest()
protected addJWTToRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:64

Adds a JWT to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addJWTToRequest

addQueryKeySecretToRequest()
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:57

Adds API key and secret to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequest

addQueryKeySecretToRequestBody()
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:50

Adds API key and secret to the request body.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequestBody

addStreamToBroadcast()
addStreamToBroadcast(broadcastId, streamId): Promise<void>;

Defined in: video/lib/video.ts:134

Adds a stream to an existing broadcast, allowing you to include additional streams in the live broadcast.

Parameters
broadcastId

string

The ID of the broadcast to which you want to add a stream.

streamId

string

The ID of the stream you want to add to the broadcast.

Returns

Promise<void>

A promise that resolves when the stream has been successfully added to the broadcast.

Throws

If an error occurs while adding the stream to the broadcast.

Example
await videoClient.addStreamToBroadcast(BROADCAST_ID, STREAM_ID);
connectToWebsocket()
connectToWebsocket(
   sessionId, 
   clientToken, 
config): Promise<WebSocketConnectResponse>;

Defined in: video/lib/video.ts:163

Connects to a WebSocket for a specified session using the provided client token and WebSocket configuration.

Parameters
sessionId

string

The ID of the session to which you want to connect via WebSocket.

clientToken

string

The client token generated for authentication.

config

WebSocketConfig

The WebSocket configuration specifying the URI and optional parameters.

Returns

Promise<WebSocketConnectResponse>

A promise that resolves with WebSocket connection details upon successful connection.

Throws

If an error occurs during the WebSocket connection process.

Example
const result = await videoClient.connectToWebsocket(
  SESSION_ID,
  CLIENT_TOKEN,
  {
    uri: 'wss://example.com',
  },
)

console.log(result.id);
createSession()
createSession(sessionOptions?): Promise<Session>;

Defined in: video/lib/video.ts:229

Creates a new session with the specified options.

Parameters
sessionOptions?

Optional session configuration options.

archiveMode?

ArchiveMode

The archive mode for the session.

location?

string

The location for the session.

mediaMode?

MediaMode

The media mode for the session.

Returns

Promise<Session>

A promise that resolves with details of the newly created session.

Throws

If an error occurs during the session creation process.

Examples

Create a session with default options

const session = await videoClient.createSession({});
console.log(session.sessionId);

Create a session with archive mode set to manual

import { ArchiveMode } from '@vonage/video';

const session = await videoClient.createSession({
  archiveMode: ArchiveMode.MANUAL,
});
console.log(session.sessionId);

Create a session with location set to a specific region

const session = await videoClient.createSession({
  location: 'eu',
});
console.log(session.sessionId);

Create a session with media mode set to routed

import { MediaMode } from '@vonage/video';

const session = await videoClient.createSession({
  mediaMode: MediaMode.ROUTED,
});
console.log(session.sessionId);
deleteArchive()
deleteArchive(archiveId): Promise<void>;

Defined in: video/lib/video.ts:265

Deletes an archive with the specified archive ID.

Parameters
archiveId

string

The ID of the archive to delete.

Returns

Promise<void>

A promise that resolves when the archive is successfully deleted.

Throws

If an error occurs while deleting the archive or if the archive with the given ID does not exist.

Example
await videoClient.deleteArchive(ARCHIVE_ID);
disableCaptions()
disableCaptions(captionId): Promise<void>;

Defined in: video/lib/video.ts:283

Disables captions for a specific caption ID.

Parameters
captionId

string

The ID of the caption to disable.

Returns

Promise<void>

A promise that resolves when the captions are successfully disabled.

Throws

If an error occurs while disabling captions or if the caption with the given ID does not exist.

Example
await videoClient.disableCaptions(CAPTION_ID);
disableForceMute()
disableForceMute(sessionId, excludedStreamIds): Promise<ProjectDetailsResponse>;

Defined in: video/lib/video.ts:303

Disables force mute for a session, allowing audio for all streams.

Parameters
sessionId

string

The ID of the session for which to disable force mute.

excludedStreamIds

string[] = []

An optional array of stream IDs to exclude from the force mute operation.

Returns

Promise<ProjectDetailsResponse>

A promise that resolves when the force mute is successfully disabled for the session.

Throws

If an error occurs while disabling force mute or if the session with the given ID does not exist.

Example
const forceMute = await videoClient.disableForceMute(SESSION_ID);
console.log(forceMute.status);
disconnectClient()
disconnectClient(sessionId, connectionId): Promise<void>;

Defined in: video/lib/video.ts:323

Disconnects a client from a session.

Parameters
sessionId

string

The ID of the session from which to disconnect the client.

connectionId

string

The ID of the client's connection to disconnect.

Returns

Promise<void>

A promise that resolves when the client is successfully disconnected from the session.

Throws

If an error occurs while disconnecting the client or if the session or connection with the given IDs do not exist.

Example
await videoClient.disconnectClient(SESSION_ID, CONNECTION_ID);
disconnectWebsocket()
disconnectWebsocket(callId): Promise<void>;

Defined in: video/lib/video.ts:344

Disconnects a WebSocket connection associated with a call or session.

Parameters
callId

string

The ID of the call or session to which the WebSocket connection is associated.

Returns

Promise<void>

A promise that resolves when the WebSocket connection is successfully disconnected.

Throws

If an error occurs while disconnecting the WebSocket connection or if the call or session with the given ID does not exist.

Example
await videoClient.disconnectWebsocket(CALL_ID);
enableCaptions()
enableCaptions(
   sessionId, 
   clientToken, 
captionOptions?): Promise<EnableCaptionResponse>;

Defined in: video/lib/video.ts:365

Enables captions for a session using the specified client token and caption options.

Parameters
sessionId

string

The ID of the session to enable captions for.

clientToken

string

The client token associated with the session, used for authentication.

captionOptions?

CaptionOptions = {}

Optional caption options to configure caption behavior.

Returns

Promise<EnableCaptionResponse>

A promise that resolves with an EnableCaptionResponse containing information about the enabled captions.

Throws

If an error occurs while enabling captions or if the session with the given ID does not exist.

Example
const result = await videoClient.enableCaptions(SESSION_ID, CLIENT_TOKEN);
console.log(result.captionId);
forceMuteAll()
forceMuteAll(sessionId, excludedStreamIds?): Promise<ProjectDetailsResponse>;

Defined in: video/lib/video.ts:396

Forces muting of all streams in a session, except those specified in the excludedStreamIds array.

Parameters
sessionId

string

The ID of the session in which to force mute streams.

excludedStreamIds?

string[] = []

An optional array of stream IDs to exclude from muting.

Returns

Promise<ProjectDetailsResponse>

A promise that resolves with a ProjectDetailsResponse containing updated session details after muting.

Throws

If an error occurs while muting the streams or if the session with the given ID does not exist.

Example
const forceMute = await videoClient.forceMuteAll(SESSION_ID);
console.log(forceMute.status);
generateClientToken()
generateClientToken(sessionId, tokenOptions?): string;

Defined in: video/lib/video.ts:416

Generates a client token for connecting to a session with the specified options.

Parameters
sessionId

string

The ID of the session to generate the client token for.

tokenOptions?

ClientTokenOptions

Optional token options including role, data, and expiration time.

Returns

string

A client token that can be used for authentication when connecting to a session.

Example
const token = videoClient.generateClientToken(SESSION_ID);
console.log(`The token is ${token}`);
getArchive()
getArchive<T>(archiveId): Promise<T>;

Defined in: video/lib/video.ts:465

Retrieves information about a specific archive by its ID.

Type Parameters
T

T extends SingleArchiveResponseBase = SingleArchiveResponse

Parameters
archiveId

string

The ID of the archive to retrieve.

Returns

Promise<T>

A promise that resolves to the details of the requested archive.

Example
const archive = await videoClient.getArchive(ARCHIVE_ID);
console.log(archive.createdAt);
getBroadcast()
getBroadcast(broadcastId): Promise<BroadcastDetailsResponse>;

Defined in: video/lib/video.ts:485

Retrieves information about a specific broadcast by its ID.

Parameters
broadcastId

string

The ID of the broadcast to retrieve.

Returns

Promise<BroadcastDetailsResponse>

A promise that resolves to the details of the requested broadcast.

const broadcast = await videoClient.getBroadcast(BROADCAST_ID);
console.log(broadcast.createdAt);
getCaptionStatus()
getCaptionStatus(captionId): Promise<CaptionStatusResponse>;

Defined in: video/lib/video.ts:506

Retrieves the status of a caption by its ID.

Parameters
captionId

string

The ID of the caption to retrieve the status for.

Returns

Promise<CaptionStatusResponse>

A promise that resolves to the status of the requested caption.

Example
const captionStatus = await videoClient.getCaptionStatus(CAPTION_ID);
console.log(captionStatus.status);
getConfig()
getConfig(): ConfigParams;

Defined in: server-client/dist/lib/client.d.ts:36

Returns

ConfigParams

Inherited from

Client.getConfig

getExperienceComposerRender()
getExperienceComposerRender(renderId): Promise<ExperienceComposerResponse>;

Defined in: video/lib/video.ts:527

Retrieves the details of an Experience Composer render by its ID.

Parameters
renderId

string

The ID of the Experience Composer render to retrieve.

Returns

Promise<ExperienceComposerResponse>

A promise that resolves to the details of the requested Experience Composer render.

Example
const render = await videoClient.getExperienceComposerRender(RENDER_ID);
console.log(render.createdAt);
getStreamInfo()
getStreamInfo(sessionId, streamId?): Promise<
  | SingleStreamLayoutResponse
| MultiStreamLayoutResponse>;

Defined in: video/lib/video.ts:556

Retrieves information about one or more streams in a session.

Parameters
sessionId

string

The ID of the session to retrieve stream information from.

streamId?

string

Optional. The ID of a specific stream to retrieve information for.

Returns

Promise< | SingleStreamLayoutResponse | MultiStreamLayoutResponse>

A promise that resolves to stream information. If a specific streamId is provided, it resolves to a single stream's information (SingleStreamLayoutResponse), otherwise, it resolves to multiple streams' information (MultiStreamLayoutResponse).

Example
const streamInfo = await videoClient.getStreamInfo(SESSION_ID);

if (streamInfo.items) {
  streamInfo.items.forEach((item) => {
    console.log(item.id);
  });
} else {
 console.log(streamInfo.id);
}
intiateSIPCall()
intiateSIPCall(sessionId, options): Promise<SIPCallResponse>;

Defined in: video/lib/video.ts:614

Initiates a SIP call within a session.

Parameters
sessionId

string

The ID of the session in which to initiate the SIP call.

options

SIPCallOptions

The options for initiating the SIP call.

Returns

Promise<SIPCallResponse>

A promise that resolves to the SIP call response, including the call ID and other details.

Examples

Start a SIP call with default options

const sipCall = await videoClient.intiateSIPCall(SESSION_ID);
console.log(sipCall.id);

Start a SIP call with custom options

const sipCall = await videoClient.intiateSIPCall(
  SESSION_ID,
  {
    uri: 'sip://example.com',
  }
);
console.log(sipCall.id);
listExperienceComposerRenders()
listExperienceComposerRenders(filter): Promise<MultiExperienceComposerResponse>;

Defined in: video/lib/video.ts:647

Lists Experience Composer renders based on the specified filter criteria.

Parameters
filter

ExperienceComposerListFilter

An optional filter to apply when listing Experience Composer renders.

Returns

Promise<MultiExperienceComposerResponse>

A promise that resolves to a list of Experience Composer renders matching the filter criteria.

Example
const renders = await videoClient.listExperienceComposerRenders();
for (const render of renders.items) {
  console.log(render.id);
}
muteAllStreams()
protected muteAllStreams(
   sessionId, 
   active, 
excludedStreamIds): Promise<ProjectDetailsResponse>;

Defined in: video/lib/video.ts:671

Mutes or unmutes all streams in a session, optionally excluding specific stream IDs from muting.

Parameters
sessionId

string

The ID of the session in which to mute or unmute streams.

active

boolean

true to mute all streams, false to unmute all streams.

excludedStreamIds

string[] = []

An optional array of stream IDs to exclude from muting/unmuting.

Returns

Promise<ProjectDetailsResponse>

A promise that resolves to the updated session details.

Example
const forceMute = await videoClient.muteAll(SESSION_ID);
console.log(forceMute.status);
muteStream()
muteStream(sessionId, streamId): Promise<ProjectDetailsResponse>;

Defined in: video/lib/video.ts:699

Mutes or unmutes a specific stream in a session.

Parameters
sessionId

string

The ID of the session containing the stream.

streamId

string

The ID of the stream to mute or unmute.

Returns

Promise<ProjectDetailsResponse>

A promise that resolves to the updated session details.

Example
const forceMute = await videoClient.muteStream(SESSION_ID, STREAM_ID);
console.log(forceMute.status);
parseResponse()
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:168

Parses the response based on its content type.

Type Parameters
T

T

The expected type of the parsed response data.

Parameters
request

VetchOptions

The request options.

response

Response

The raw response from the request.

Returns

Promise<VetchResponse<T>>

  • The parsed response.
Inherited from

Client.parseResponse

playDTMF()
playDTMF(
   sessionId, 
   digits, 
connectionId?): Promise<void>;

Defined in: video/lib/video.ts:722

Sends DTMF (Dual-Tone Multi-Frequency) tones to a specific session or connection.

Parameters
sessionId

string

The ID of the session to send DTMF tones to.

digits

string

The DTMF tones to play.

connectionId?

string

Optional. The ID of the connection within the session to send DTMF tones to.

Returns

Promise<void>

A promise that resolves when the DTMF tones have been played.

Example
await videoClient.playDTMF(SESSION_ID, '1234');
prepareBody()
protected prepareBody(request): undefined | string;

Defined in: server-client/dist/lib/client.d.ts:158

Prepares the body for the request based on the content type.

Parameters
request

VetchOptions

The request options.

Returns

undefined | string

  • The prepared request body as a string or undefined.
Inherited from

Client.prepareBody

prepareRequest()
protected prepareRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:151

Prepares the request with necessary headers, authentication, and query parameters.

Parameters
request

VetchOptions

The initial request options.

Returns

Promise<VetchOptions>

  • The modified request options.
Inherited from

Client.prepareRequest

removeArchiveStream()
removeArchiveStream(archiveId, streamId): Promise<void>;

Defined in: video/lib/video.ts:747

Removes a stream from an archive.

Parameters
archiveId

string

The ID of the archive from which to remove the stream.

streamId

string

The ID of the stream to remove from the archive.

Returns

Promise<void>

A promise that resolves when the stream has been successfully removed from the archive.

Example
await videoClient.removeArchiveStream(ARCHIVE_ID, STREAM_ID);
removeStreamFromBroadcast()
removeStreamFromBroadcast(broadcastId, streamId): Promise<void>;

Defined in: video/lib/video.ts:769

Removes a stream from a broadcast.

Parameters
broadcastId

string

The ID of the broadcast from which to remove the stream.

streamId

string

The ID of the stream to remove from the broadcast.

Returns

Promise<void>

A promise that resolves when the stream has been successfully removed from the broadcast.

Example
await videoClient.removeStreamFromBroadcast(BROADCAST_ID, STREAM_ID);
searchArchives()
searchArchives(filter?): Promise<MultiArchiveResponse>;

Defined in: video/lib/video.ts:801

Searches for archives based on the specified filter criteria.

Parameters
filter?

ArchiveSearchFilter

Optional filter criteria to narrow down the search.

Returns

Promise<MultiArchiveResponse>

A promise that resolves with the search results, including multiple archive items.

Examples
const archives = await videoClient.searchArchives();
for (const archive of archives.items) {
  console.log(archive.id);
}

Search for archives for a session

const archives = await videoClient.searchArchives({
  sessionId: SESSION_ID,
});

for (const archive of archives.items) {
  console.log(archive.id);
}
searchBroadcasts()
searchBroadcasts(filter?): Promise<MultiBroadcastResponse>;

Defined in: video/lib/video.ts:836

Searches for broadcasts based on the specified filter criteria.

Parameters
filter?

BroadcastSearchFilter

Optional filter criteria to narrow down the search.

Returns

Promise<MultiBroadcastResponse>

A promise that resolves with the search results, including multiple broadcast items.

Examples
const broadcasts = await videoClient.searchBroadcasts();
for (const broadcast of broadcasts.items) {
   console.log(broadcast.id);
}

Get braodcasts for a session

const broadcasts = await videoClient.searchBroadcasts({
  sessionId: SESSION_ID,
})
for (const broadcast of broadcasts.items) {
  console.log(broadcast.id);
 }
sendDeleteRequest()
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:78

Sends a DELETE request to the specified URL.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the DELETE request.

Returns

Promise<VetchResponse<T>>

  • The response from the DELETE request.
Inherited from

Client.sendDeleteRequest

sendFormSubmitRequest()
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:86

Sends a POST request with form data to the specified URL.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the POST request.

payload?

Record<string, undefined | string>

Optional payload containing form data to send with the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendFormSubmitRequest

sendGetRequest()
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:94

Sends a GET request to the specified URL with optional query parameters.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the GET request.

queryParams?

Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.

Returns

Promise<VetchResponse<T>>

  • The response from the GET request.
Inherited from

Client.sendGetRequest

sendPatchRequest()
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:104

Sends a PATCH request to the specified URL with an optional payload.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the PATCH request.

payload?

Optional payload to be sent as the body of the PATCH request.

Returns

Promise<VetchResponse<T>>

  • The response from the PATCH request.
Inherited from

Client.sendPatchRequest

sendPostRequest()
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:114

Sends a POST request to the specified URL with an optional payload.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the POST request.

payload?

Optional payload to be sent as the body of the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendPostRequest

sendPutRequest()
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:124

Sends a PUT request to the specified URL with an optional payload.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the PUT request.

payload?

Optional payload to be sent as the body of the PUT request.

Returns

Promise<VetchResponse<T>>

  • The response from the PUT request.
Inherited from

Client.sendPutRequest

sendRequest()
sendRequest<T>(request): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:144

Sends a request adding necessary headers, handling authentication, and parsing the response.

Type Parameters
T

T

Parameters
request

VetchOptions

The options defining the request, including URL, method, headers, and data.

Returns

Promise<VetchResponse<T>>

  • The parsed response from the request.
Inherited from

Client.sendRequest

sendRequestWithData()
sendRequestWithData<T>(
   method, 
   url, 
payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:135

Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.

Type Parameters
T

T

Parameters
method

The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).

POST | PUT | PATCH

url

string

The URL endpoint for the request.

payload?

Optional payload to be sent as the body of the request, JSON-encoded.

Returns

Promise<VetchResponse<T>>

  • The response from the request.
Inherited from

Client.sendRequestWithData

sendSignal()
sendSignal(
   signal, 
   sessionId, 
connectionId?): Promise<void>;

Defined in: video/lib/video.ts:864

Sends a signal to a session or a specific connection within a session.

Parameters
signal

Signal

The signal to send, including a type and data.

sessionId

string

The ID of the session to which the signal will be sent.

connectionId?

string

Optional. The ID of the connection within the session to which the signal will be sent. If not provided, the signal will be sent to the entire session.

Returns

Promise<void>

A promise that resolves when the signal is successfully sent.

Example
await videoClient.sendSignal(
  {
    type: 'text',
    data: 'Hello world!',
  },
  SESSION_ID,
);

##### setStreamClassLists()

```ts
setStreamClassLists(sessionId, settings): Promise<void>;

Defined in: video/lib/video.ts:898

Sets the stream class lists for one or more streams within a session.

Parameters
sessionId

string

The ID of the session for which stream class lists will be set.

settings

StreamClassList[]

An array of objects specifying the stream ID and corresponding class lists to be set.

Returns

Promise<void>

A promise that resolves when the stream class lists are successfully set.

Example
await videoClient.setStreamClassLists(
  SESSION_ID,
  [
    {
      id: STREAM_ID,
      layoutClassList: ['full'],
    }
  ]
)
startArchive()
startArchive<T>(sessionId, options?): Promise<T>;

Defined in: video/lib/video.ts:921

Starts an archive for a given session with optional configuration.

Type Parameters
T

T extends SingleArchiveResponseBase = SingleArchiveResponse

Parameters
sessionId

string

The ID of the session to archive.

options?

ArchiveOptions

Optional configuration for the archive, such as audio/video settings, layout, and more.

Returns

Promise<T>

A promise that resolves with information about the started archive.

Example
const archive = await videoClient.startArchive(SESSION_ID);
console.log(archive.id);
startBroadcast()
startBroadcast(sessionId, config): Promise<BroadcastDetailsResponse>;

Defined in: video/lib/video.ts:958

Starts a broadcast for a given session with the specified configuration.

Parameters
sessionId

string

The ID of the session to start broadcasting.

config

BroadcastConfig

Configuration for the broadcast, including stream settings, layout, and more.

Returns

Promise<BroadcastDetailsResponse>

A promise that resolves with information about the started broadcast.

Example
const broadcast = await videoClient.startBroadcast(
  SESSION_ID,
  {
    outputs: {
      hls: {
        lowLatency: true,
      }
      rtmp: [{
        serverUrl: 'rtmp://example.com',
      }],
    }
  }
);
startExperienceComposerRender()
startExperienceComposerRender(
   sessionId, 
   token, 
config): Promise<ExperienceComposerResponse>;

Defined in: video/lib/video.ts:989

Starts rendering an experience composer with the provided configuration.

Parameters
sessionId

string

The ID of the session associated with the experience composer.

token

string

The client token for authentication.

config

ExperienceComposerOptions

Configuration options for the experience composer rendering.

Returns

Promise<ExperienceComposerResponse>

A promise that resolves with information about the started experience composer rendering.

Example
const render = await videoClient.startExperienceComposerRender(
  SESSION_ID,
  token,
)

console.log(render.id);
stopArchive()
stopArchive(archiveId): Promise<SingleArchiveResponse>;

Defined in: video/lib/video.ts:1015

Stops an archive with the given archive ID.

Parameters
archiveId

string

The ID of the archive to stop.

Returns

Promise<SingleArchiveResponse>

A promise that resolves with information about the stopped archive.

Example
const archive = await videoClient.stopArchive(ARCHIVE_ID);

console.log(archive.status);
stopBroadcast()
stopBroadcast(broadcastId): Promise<BroadcastDetailsResponse>;

Defined in: video/lib/video.ts:1034

Stops a broadcast with the given broadcast ID.

Parameters
broadcastId

string

The ID of the broadcast to stop.

Returns

Promise<BroadcastDetailsResponse>

A promise that resolves with information about the stopped broadcast.

Example
const broadcast = await videoClient.stopBroadcast(BROADCAST_ID);
console.log(broadcast.status);
stopExperienceComposerRender()
stopExperienceComposerRender(renderId): Promise<void>;

Defined in: video/lib/video.ts:1054

Stops an Experience Composer render with the given render ID.

Parameters
renderId

string

The ID of the Experience Composer render to stop.

Returns

Promise<void>

A promise that resolves when the render is successfully stopped.

Example
await videoClient.stopExperienceComposerRender(RENDER_ID);
updateArchiveLayout()
updateArchiveLayout(archiveId, layout): Promise<void>;

Defined in: video/lib/video.ts:1072

Updates the layout of an archive with the given archive ID.

Parameters
archiveId

string

The ID of the archive to update the layout for.

layout

ArchiveLayout

The new layout configuration to set for the archive.

Returns

Promise<void>

A promise that resolves when the layout is successfully updated.

Example
await videoClient.updateArchiveLayout(
updateBroadcast()
updateBroadcast(config): Promise<void>;

Defined in: video/lib/video.ts:1097

Updates the configuration of a broadcast with the given broadcast ID.

Parameters
config

BroadcastUpdateConfig

The configuration options to update the broadcast.

Returns

Promise<void>

A promise that resolves when the broadcast is successfully updated.

Example
await videoClient.updateBroadcast({
  broadcastId: BROADCAST_ID,
  hasAudio: true,
})

Type Aliases

ArchiveLayout

type ArchiveLayout = object;

Defined in: video/lib/types/ArchiveLayout.ts:6

Represents the layout configuration for an archive.

Properties

screenshareType?
optional screenshareType: string;

Defined in: video/lib/types/ArchiveLayout.ts:22

Optional: The screenshare layout type to use when there is a screen-sharing stream in the archive (only applicable if type is 'bestFit' and screenshareType is set).

stylesheet?
optional stylesheet: string;

Defined in: video/lib/types/ArchiveLayout.ts:15

Optional: The stylesheet used for custom layout (only applicable if type is 'custom').

type
type: LayoutType;

Defined in: video/lib/types/ArchiveLayout.ts:10

The type of layout to be used for the archive.


ArchiveOptions

type ArchiveOptions = 
  | ArchiveOptionsWithMaxBitrate
  | ArchiveOptionsWithMaxBitrate & ArchiveWithTranscription
  | ArchiveOptionsWithMaxBitrate & ArchiveWithoutTranscription
  | ArchiveOptionsWithQuantizationParameter
  | ArchiveOptionsWithQuantizationParameter & ArchiveWithTranscription
  | ArchiveOptionsWithQuantizationParameter & ArchiveWithoutTranscription
  | ArchiveWithTranscription
  | ArchiveWithoutTranscription;

Defined in: video/lib/types/ArchiveOptions.ts:113


ArchiveSearchFilter

type ArchiveSearchFilter = object;

Defined in: video/lib/types/ArchiveSearchFilter.ts:4

Interface representing filters for searching archives.

Properties

count?
optional count: number;

Defined in: video/lib/types/ArchiveSearchFilter.ts:13

The number of archives to retrieve starting at the offset. Default is 50, with a maximum of 1000.

offset?
optional offset: number;

Defined in: video/lib/types/ArchiveSearchFilter.ts:8

The start offset in the list of existing archives.

sessionId?
optional sessionId: string;

Defined in: video/lib/types/ArchiveSearchFilter.ts:18

Retrieve archives for a specific session ID.


BroadcastConfig

type BroadcastConfig = object;

Defined in: video/lib/types/BroadcastConfig.ts:37

Interface representing configuration options for a live streaming broadcast.

Properties

hasAudio?
optional hasAudio: boolean;

Defined in: video/lib/types/BroadcastConfig.ts:62

Whether the broadcast has audio.

hasVideo?
optional hasVideo: boolean;

Defined in: video/lib/types/BroadcastConfig.ts:67

Whether the broadcast has video.

layout?
optional layout: LayoutType;

Defined in: video/lib/types/BroadcastConfig.ts:57

The layout type for the broadcast.

maxBitrate?
optional maxBitrate: number;

Defined in: video/lib/types/BroadcastConfig.ts:52

The maximum bitrate for the stream.

maxDuration?
optional maxDuration: number;

Defined in: video/lib/types/BroadcastConfig.ts:47

The maximum duration for the broadcast, in seconds. The broadcast will automatically stop when the maximum duration is reached.

multiBroadcastTag?
optional multiBroadcastTag: string;

Defined in: video/lib/types/BroadcastConfig.ts:41

The unique tag for simultaneous broadcasts (if one was set).

outputs
outputs: BroadcastOutputs;

Defined in: video/lib/types/BroadcastConfig.ts:72

Configuration options for different types of broadcast streams (HLS and RTMP).

resolution?
optional resolution: Resolution;

Defined in: video/lib/types/BroadcastConfig.ts:82

The resolution of the broadcast.

streamMode?
optional streamMode: StreamMode;

Defined in: video/lib/types/BroadcastConfig.ts:77

The stream mode for the broadcast.


BroadcastDetailsResponse

type BroadcastDetailsResponse = object;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:17

Represents the response containing details about a live streaming broadcast.

Properties

applicationId
applicationId: string;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:36

The Vonage Application UUID.

broadcastUrls
broadcastUrls: object;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:61

An object containing details about the HLS and RTMP broadcasts.

hls?
optional hls: string;

The URL for the HLS broadcast.

rtmp
rtmp: RTMPStream[];

An array of RTMP streams.

createdAt
createdAt: number;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:41

The time the broadcast started, expressed in milliseconds since the Unix epoch (January 1, 1970, 00:00:00 UTC).

hasAudio
hasAudio: boolean;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:96

Indicates whether the broadcast has audio.

hasVideo
hasVideo: boolean;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:91

Indicates whether the broadcast has video.

id
id: string;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:21

The unique ID for the broadcast.

maxBitrate?
optional maxBitrate: number;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:56

The maximum bitrate for the stream.

maxDuration?
optional maxDuration: number;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:51

The maximum duration for the broadcast (if one was set), in seconds.

multiBroadcasTag?
optional multiBroadcasTag: string;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:31

The unique tag for simultaneous broadcasts (if one was set).

resolution?
optional resolution: Resolution;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:86

The resolution of the broadcast, if set.

sessionId
sessionId: string;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:26

The Vonage Video session ID associated with the broadcast.

settings?
optional settings: object;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:76

An object containing settings for HLS.

hls?
optional hls: HlsSettings;

HLS settings.

streamMode
streamMode: StreamMode;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:101

The stream mode for the broadcast.

updatedAt
updatedAt: number;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:46

The timestamp when the broadcast was last updated, expressed in milliseconds since the Unix epoch.


BroadcastOutputs

type BroadcastOutputs = object;

Defined in: video/lib/types/BroadcastConfig.ts:22

Interface representing configuration options for different types of broadcast streams (HLS and RTMP).

Properties

hls?
optional hls: HLSConfig;

Defined in: video/lib/types/BroadcastConfig.ts:26

Configuration options for HLS streaming.

rtmp
rtmp: RTMPStream[];

Defined in: video/lib/types/BroadcastConfig.ts:31

Configuration options for RTMP streaming.


BroadcastSearchFilter

type BroadcastSearchFilter = object;

Defined in: video/lib/types/BroadcastSearchFilter.ts:4

Interface representing a filter for searching broadcasts.

Properties

count?
optional count: number;

Defined in: video/lib/types/BroadcastSearchFilter.ts:13

The maximum number of items to return.

offset?
optional offset: number;

Defined in: video/lib/types/BroadcastSearchFilter.ts:8

The offset for paginating the results.

sessionId?
optional sessionId: string;

Defined in: video/lib/types/BroadcastSearchFilter.ts:18

The session ID to filter broadcasts by.


BroadcastUpdateConfig

type BroadcastUpdateConfig = object;

Defined in: video/lib/types/BroadcastUpdateConfig.ts:4

Interface representing the configuration for updating a broadcast.

Properties

addStream?
optional addStream: string;

Defined in: video/lib/types/BroadcastUpdateConfig.ts:23

The ID of a stream to add to the broadcast.

broadcastId
broadcastId: string;

Defined in: video/lib/types/BroadcastUpdateConfig.ts:8

The ID of the broadcast to update.

hasAudio?
optional hasAudio: boolean;

Defined in: video/lib/types/BroadcastUpdateConfig.ts:13

Whether to include audio in the broadcast.

hasVideo?
optional hasVideo: boolean;

Defined in: video/lib/types/BroadcastUpdateConfig.ts:18

Whether to include video in the broadcast.

removeStream?
optional removeStream: string;

Defined in: video/lib/types/BroadcastUpdateConfig.ts:28

The ID of a stream to remove from the broadcast.


CaptionOptions

type CaptionOptions = object;

Defined in: video/lib/types/CaptionOptions.ts:4

Interface representing options for captions.

Properties

languageCode?
optional languageCode: "en-us";

Defined in: video/lib/types/CaptionOptions.ts:8

The language code for captions (e.g., "en-us").

maxDuration?
optional maxDuration: number;

Defined in: video/lib/types/CaptionOptions.ts:13

The maximum duration for captions.

partialCaptions?
optional partialCaptions: "true" | "false";

Defined in: video/lib/types/CaptionOptions.ts:18

Whether to generate partial captions.

statusCallbackUrl?
optional statusCallbackUrl: string;

Defined in: video/lib/types/CaptionOptions.ts:23

The URL for the status callback of captions.


CaptionStatusResponse

type CaptionStatusResponse = object;

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:6

Represents a response containing the status of captions for a live streaming broadcast.

Properties

applicationId
applicationId: string;

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:15

The Vonage Application UUID.

captionId
captionId: string;

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:10

The unique ID for the caption.

createdAt
createdAt: number;

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:31

The time when the caption was created, expressed in milliseconds since the Unix epoch (January 1, 1970, 00:00:00 UTC).

duration
duration: number;

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:41

The duration of the caption, in seconds.

languageCode
languageCode: "en-us";

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:46

The language code of the captions (e.g., "en-us" for English, US).

provider
provider: "aws-transcribe";

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:51

The caption provider (e.g., "aws-transcribe").

reason?
optional reason: string;

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:56

An optional reason for the caption status.

sessionId
sessionId: string;

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:20

The Vonage Video session ID associated with the broadcast.

status
status: CaptionStatus;

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:25

The status of the captions.

updatedAt
updatedAt: number;

Defined in: video/lib/types/Response/CaptionStatusResponse.ts:36

The timestamp when the caption was last updated, expressed in milliseconds since the Unix epoch.


ClientTokenClaims

type ClientTokenClaims = object;

Defined in: video/lib/types/ClientTokenClaims.ts:4

Interface representing claims for a client token.

Properties

acl
acl: object;

Defined in: video/lib/types/ClientTokenClaims.ts:48

Access control list (ACL) for paths.

paths
paths: object;

Paths and associated objects in the ACL.

Index Signature
[key: string]: object
connection_data?
optional connection_data: string;

Defined in: video/lib/types/ClientTokenClaims.ts:38

Connection data associated with the token (optional).

data?
optional data: string;

Defined in: video/lib/types/ClientTokenClaims.ts:28

Additional data for the token (optional).

exp?
optional exp: number;

Defined in: video/lib/types/ClientTokenClaims.ts:33

The expiration time of the token (optional).

initial_layout_class_list
initial_layout_class_list: string;

Defined in: video/lib/types/ClientTokenClaims.ts:23

The initial layout class list.

role
role: string;

Defined in: video/lib/types/ClientTokenClaims.ts:18

The role of the token.

scope
scope: string;

Defined in: video/lib/types/ClientTokenClaims.ts:8

The scope of the token.

session_id
session_id: string;

Defined in: video/lib/types/ClientTokenClaims.ts:13

The session ID associated with the token.

sub
sub: string;

Defined in: video/lib/types/ClientTokenClaims.ts:43

The subject of the token.


ClientTokenOptions

type ClientTokenOptions = object;

Defined in: video/lib/types/ClientTokenOptions.ts:4

Interface representing options for generating a client token.

Properties

data?
optional data: string;

Defined in: video/lib/types/ClientTokenOptions.ts:13

Additional data for the client token (optional).

expireTime?
optional expireTime: number;

Defined in: video/lib/types/ClientTokenOptions.ts:18

The expiration time of the client token in seconds (optional).

initialLayoutClassList?
optional initialLayoutClassList: string[];

Defined in: video/lib/types/ClientTokenOptions.ts:23

An array of initial layout class list for the client token (optional).

role?
optional role: string;

Defined in: video/lib/types/ClientTokenOptions.ts:8

The role associated with the client token (optional).


CreateSessionResponse

type CreateSessionResponse = object;

Defined in: video/lib/types/Response/CreateSessionResponse.ts:4

Represents a response containing the details of a created session.

Properties

create_dt
create_dt: string;

Defined in: video/lib/types/Response/CreateSessionResponse.ts:18

The creation date and time of the session in string format.

media_server_url
media_server_url: string;

Defined in: video/lib/types/Response/CreateSessionResponse.ts:23

The URL of the media server associated with the session.

project_id
project_id: string;

Defined in: video/lib/types/Response/CreateSessionResponse.ts:13

The project ID associated with the session.

session_id
session_id: string;

Defined in: video/lib/types/Response/CreateSessionResponse.ts:8

The unique session ID.


EnableCaptionResponse

type EnableCaptionResponse = object;

Defined in: video/lib/types/Response/EnableCaptionResponse.ts:4

Represents a response indicating the ID of the enabled caption.

Properties

captionsId
captionsId: string;

Defined in: video/lib/types/Response/EnableCaptionResponse.ts:8

The unique ID of the enabled caption.


ExperienceComposerListFilter

type ExperienceComposerListFilter = object;

Defined in: video/lib/types/ExperienceComposerListFilter.ts:4

Interface representing filters for listing Experience Composer items.

Properties

count?
optional count: number;

Defined in: video/lib/types/ExperienceComposerListFilter.ts:13

The maximum number of items to retrieve (optional).

offset?
optional offset: number;

Defined in: video/lib/types/ExperienceComposerListFilter.ts:8

The offset for paginating through the list (optional).


ExperienceComposerOptions

type ExperienceComposerOptions = object;

Defined in: video/lib/types/ExperienceComposerOptions.ts:6

Interface representing options for creating an Experience Composer.

Properties

maxDuration?
optional maxDuration: number;

Defined in: video/lib/types/ExperienceComposerOptions.ts:25

The maximum duration for the Experience Composer (optional).

properties?
optional properties: object;

Defined in: video/lib/types/ExperienceComposerOptions.ts:15

Optional properties for the Experience Composer.

name?
optional name: string;

The name of the Experience Composer.

resolution?
optional resolution: ExperienceComposerResolution;

Defined in: video/lib/types/ExperienceComposerOptions.ts:30

The resolution of the Experience Composer (optional).

statusCallbackUrl?
optional statusCallbackUrl: string;

Defined in: video/lib/types/ExperienceComposerOptions.ts:35

The callback URL for status updates (optional).

url
url: string;

Defined in: video/lib/types/ExperienceComposerOptions.ts:10

The URL of the Experience Composer.


ExperienceComposerResponse

type ExperienceComposerResponse = object;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:6

Represents a response from the Experience Composer.

Properties

applicationId
applicationId: string;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:20

The application ID associated with the response.

createdAt
createdAt: number;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:25

The timestamp when the response was created (milliseconds since the Unix epoch).

id
id: string;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:10

The unique ID of the response.

reason?
optional reason: string;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:55

An optional reason for the status, if available.

resolution
resolution: ExperienceComposerResolution;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:40

The resolution used by the Experience Composer.

sessionId
sessionId: string;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:15

The session ID associated with the response.

status
status: "starting" | "started" | "stopped" | "failed";

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:45

The status of the response, which can be one of: "starting", "started", "stopped", "failed".

streamId
streamId: string;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:50

The stream ID associated with the response.

updatedAt
updatedAt: number;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:30

The timestamp when the response was last updated (milliseconds since the Unix epoch).

url
url: string;

Defined in: video/lib/types/Response/ExperienceComposerResponse.ts:35

The URL associated with the response.


HLSConfig

type HLSConfig = object;

Defined in: video/lib/types/BroadcastConfig.ts:7

Interface representing configuration options for HLS streaming.

Properties

dvr?
optional dvr: boolean;

Defined in: video/lib/types/BroadcastConfig.ts:16

Whether to enable DVR functionality (rewinding, pausing, and resuming) in players that support it.

lowLatency?
optional lowLatency: boolean;

Defined in: video/lib/types/BroadcastConfig.ts:11

Whether to enable low-latency mode for the HLS stream.


HlsSettings

type HlsSettings = object;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:7

Represents HLS settings for a live streaming broadcast.

Properties

lowLatency?
optional lowLatency: boolean;

Defined in: video/lib/types/Response/BroadcastDetailsResponse.ts:11

Whether to enable low-latency mode for the HLS stream.


InitiateSIPCallRequest

type InitiateSIPCallRequest = SIPCallOptions & object;

Defined in: video/lib/types/Request/InitiateSIPCallRequest.ts:6

Represents the request to initiate a SIP call with additional session information.

Type declaration

sessionId
sessionId: string;

The session ID of the Vonage Video session to associate with the SIP call.


MultiArchiveResponse

type MultiArchiveResponse = object;

Defined in: video/lib/types/Response/MultiArchiveResponse.ts:6

Represents a response containing multiple archive items.

Properties

count
count: number;

Defined in: video/lib/types/Response/MultiArchiveResponse.ts:10

The count of archive items in the response.

items
items: SingleArchiveResponse[];

Defined in: video/lib/types/Response/MultiArchiveResponse.ts:15

An array of SingleArchiveResponse objects representing individual archive items.


MultiBroadcastResponse

type MultiBroadcastResponse = object;

Defined in: video/lib/types/Response/MultiBroadcastResponse.ts:6

Represents a response containing multiple broadcast details items.

Properties

count
count: number;

Defined in: video/lib/types/Response/MultiBroadcastResponse.ts:10

The count of broadcast details items in the response.

items
items: BroadcastDetailsResponse[];

Defined in: video/lib/types/Response/MultiBroadcastResponse.ts:15

An array of BroadcastDetailsResponse objects representing individual broadcast details items.


MultiExperienceComposerResponse

type MultiExperienceComposerResponse = object;

Defined in: video/lib/types/Response/MultiExperienceComposerResponse.ts:6

Represents a response containing multiple ExperienceComposerResponse items.

Properties

count
count: number;

Defined in: video/lib/types/Response/MultiExperienceComposerResponse.ts:10

The count of ExperienceComposerResponse items in the response.

items
items: ExperienceComposerResponse[];

Defined in: video/lib/types/Response/MultiExperienceComposerResponse.ts:15

An array of ExperienceComposerResponse objects representing individual items.


MultiStreamLayoutResponse

type MultiStreamLayoutResponse = object;

Defined in: video/lib/types/Response/MultiStreamLayoutResponse.ts:6

Represents a response containing multiple SingleStreamLayoutResponse items.

Properties

count
count: number;

Defined in: video/lib/types/Response/MultiStreamLayoutResponse.ts:10

The count of SingleStreamLayoutResponse items in the response.

items
items: SingleStreamLayoutResponse[];

Defined in: video/lib/types/Response/MultiStreamLayoutResponse.ts:15

An array of SingleStreamLayoutResponse objects representing individual items.


ProjectDetailsResponse

type ProjectDetailsResponse = object;

Defined in: video/lib/types/Response/ProjectDetailsResponse.ts:4

Represents the details of a project.

Properties

createdAt
createdAt: number;

Defined in: video/lib/types/Response/ProjectDetailsResponse.ts:33

The timestamp when the project was created, expressed in milliseconds since the Unix epoch.

environment
environment: string;

Defined in: video/lib/types/Response/ProjectDetailsResponse.ts:28

The environment of the project.

id
id: string;

Defined in: video/lib/types/Response/ProjectDetailsResponse.ts:8

The unique identifier of the project.

name
name: string;

Defined in: video/lib/types/Response/ProjectDetailsResponse.ts:23

The name of the project.

secret
secret: string;

Defined in: video/lib/types/Response/ProjectDetailsResponse.ts:13

The secret associated with the project.

status
status: string;

Defined in: video/lib/types/Response/ProjectDetailsResponse.ts:18

The status of the project.


RTMPStream

type RTMPStream = object;

Defined in: video/lib/types/RTMPStream.ts:4

Interface representing an RTMP stream configuration.

Properties

id?
optional id: string;

Defined in: video/lib/types/RTMPStream.ts:8

Optional unique identifier for the RTMP stream.

serverUrl
serverUrl: string;

Defined in: video/lib/types/RTMPStream.ts:13

The RTMP server URL to which the stream will be sent.

streamName
streamName: string;

Defined in: video/lib/types/RTMPStream.ts:18

The name of the stream on the RTMP server.


Session

type Session = object;

Defined in: video/lib/types/Session.ts:4

Interface representing a session configuration.

Properties

archiveMode
archiveMode: string;

Defined in: video/lib/types/Session.ts:23

The archive mode for the session (e.g., "MANUAL" or "ALWAYS").

location
location: string;

Defined in: video/lib/types/Session.ts:13

The location of the session.

mediaMode
mediaMode: string;

Defined in: video/lib/types/Session.ts:18

The media mode for the session (e.g., "ROUTED" or "RELAYED").

sessionId
sessionId: string;

Defined in: video/lib/types/Session.ts:8

The unique identifier for the session.


Signal

type Signal = object;

Defined in: video/lib/types/Singal.ts:4

Represents a signal containing type and data properties.

Properties

data
data: string;

Defined in: video/lib/types/Singal.ts:13

The data associated with the signal, which can be any string data related to the signal.

type
type: string;

Defined in: video/lib/types/Singal.ts:8

The type of the signal, which can be a custom string identifying the signal type.


SingleArchiveResponse

type SingleArchiveResponse = 
  | SingleArchiveResponseWithMaxBitrate & SingleArchiveResponseWithoutTranscription
  | SingleArchiveResponseWithMaxBitrate & SingleArchiveResponseWithTranscription
  | SingleArchiveResponseWithQuantizationParameter & SingleArchiveResponseWithoutTranscription
  | SingleArchiveResponseWithQuantizationParameter & SingleArchiveResponseWithTranscription
  | SingleArchiveResponseWithTranscription;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:145

Represents the details of a single archive, supporting mutually exclusive parameters.


SingleArchiveResponseBase

type SingleArchiveResponseBase = object;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:4

Represents the details of a single archive.

Properties

createdAt
createdAt: number;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:8

The timestamp when the archive was created, expressed in milliseconds since the Unix epoch.

duration
duration: number;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:13

The duration of the archive in seconds.

hasAudio
hasAudio: boolean;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:18

Indicates whether the archive has audio.

hasVideo
hasVideo: boolean;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:23

Indicates whether the archive has video.

id
id: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:28

The unique identifier of the archive.

name
name: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:33

The name of the archive.

outputMode
outputMode: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:38

The output mode of the archive.

projectId
projectId: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:43

The unique identifier of the project to which the archive belongs.

reason
reason: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:48

The reason for the archive status.

resolution
resolution: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:53

The resolution of the archive.

sessionId
sessionId: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:58

The unique identifier of the session associated with the archive.

size
size: number;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:63

The size of the archive in bytes.

status
status: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:68

The status of the archive.

streamMode
streamMode: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:73

The stream mode of the archive.

streams?
optional streams: string[];

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:83

An array of stream identifiers associated with the archive.

url?
optional url: string;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:78

The URL of the archive.


SingleArchiveResponseWithMaxBitrate

type SingleArchiveResponseWithMaxBitrate = SingleArchiveResponseBase & object & Omit<SingleArchiveResponseBase, "quantizationParameter">;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:125

Represents an archive with a maximum bitrate.

Type declaration

maxBitrate
maxBitrate: number;

The maximum video bitrate for the archive, in bits per second.


SingleArchiveResponseWithoutTranscription

type SingleArchiveResponseWithoutTranscription = SingleArchiveResponseBase & object & Omit<SingleArchiveResponseBase, "transcriptionProperties">;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:115

Represents an archive without transcription properties.

Type declaration

hasTranscription?
optional hasTranscription: false;

Transcription is disabled on the archive


SingleArchiveResponseWithQuantizationParameter

type SingleArchiveResponseWithQuantizationParameter = SingleArchiveResponseBase & object & Omit<SingleArchiveResponseBase, "maxBitrate">;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:135

Represents an archive with a quantization parameter.

Type declaration

quantizationParameter
quantizationParameter: number;

The quantization level for the archive quality.


SingleArchiveResponseWithTranscription

type SingleArchiveResponseWithTranscription = SingleArchiveResponseBase & object;

Defined in: video/lib/types/Response/SingleArchiveResponse.ts:89

Represents an archive with transcription properties.

Type declaration

hasTranscription
hasTranscription: true;

Post-processing will include transcription

transcriptionProperties
transcriptionProperties: object;

Additional options when transcription is enabled

transcriptionProperties.hasSummary?
optional transcriptionProperties.hasSummary: boolean;

True if the transcription should have a summary.

transcriptionProperties.primaryLanguageCode?
optional transcriptionProperties.primaryLanguageCode: string;

The primary language spoken in the archive to be transcribed, in BCP-47 format. Example: en-US, es-ES, or pt-BR.


SingleStreamLayoutResponse

type SingleStreamLayoutResponse = object;

Defined in: video/lib/types/Response/SingleStreamLayoutResponse.ts:4

Represents the details of a single stream layout.

Properties

id
id: string;

Defined in: video/lib/types/Response/SingleStreamLayoutResponse.ts:8

The unique identifier of the stream layout.

layoutClassList
layoutClassList: string[];

Defined in: video/lib/types/Response/SingleStreamLayoutResponse.ts:23

An array of CSS class names associated with the layout.

name
name: string;

Defined in: video/lib/types/Response/SingleStreamLayoutResponse.ts:18

The name of the stream layout.

videoType
videoType: string;

Defined in: video/lib/types/Response/SingleStreamLayoutResponse.ts:13

The type of video associated with the stream layout.


SIPCallOptions

type SIPCallOptions = object;

Defined in: video/lib/types/SIPCallOptions.ts:56

Interface representing options for initiating a SIP call.

Properties

sip
sip: SIPCallSIPConfig;

Defined in: video/lib/types/SIPCallOptions.ts:65

Configuration options for the SIP call.

token
token: string;

Defined in: video/lib/types/SIPCallOptions.ts:60

The authentication token for the SIP call.


SIPCallResponse

type SIPCallResponse = object;

Defined in: video/lib/types/Response/SIPCallResponse.ts:4

Represents the response for a SIP call initiation.

Properties

connectionId
connectionId: string;

Defined in: video/lib/types/Response/SIPCallResponse.ts:13

The connection identifier associated with the SIP call.

id
id: string;

Defined in: video/lib/types/Response/SIPCallResponse.ts:8

The unique identifier of the SIP call.

streamId
streamId: string;

Defined in: video/lib/types/Response/SIPCallResponse.ts:18

The stream identifier associated with the SIP call.


SIPCallSIPConfig

type SIPCallSIPConfig = object;

Defined in: video/lib/types/SIPCallOptions.ts:4

Configuration options for a SIP call.

Properties

auth?
optional auth: object;

Defined in: video/lib/types/SIPCallOptions.ts:25

Authentication credentials for the SIP call.

password
password: string;

The password for SIP authentication.

username
username: string;

The username for SIP authentication.

from?
optional from: string;

Defined in: video/lib/types/SIPCallOptions.ts:13

The optional "from" field for the SIP call.

headers?
optional headers: object;

Defined in: video/lib/types/SIPCallOptions.ts:18

Custom headers to be included in the SIP call.

Index Signature
[key: string]: string
observeForceMute?
optional observeForceMute: boolean;

Defined in: video/lib/types/SIPCallOptions.ts:50

Indicates whether to observe and force mute for the SIP call.

secure?
optional secure: boolean;

Defined in: video/lib/types/SIPCallOptions.ts:40

Indicates whether the SIP call should be secure.

uri
uri: string;

Defined in: video/lib/types/SIPCallOptions.ts:8

The SIP URI to initiate the call.

video?
optional video: boolean;

Defined in: video/lib/types/SIPCallOptions.ts:45

Indicates whether video is enabled for the SIP call.


StreamClassList

type StreamClassList = object;

Defined in: video/lib/types/StreamClassList.ts:4

Represents a stream with associated layout class list.

Properties

id
id: string;

Defined in: video/lib/types/StreamClassList.ts:8

The ID of the stream.

layoutClassList
layoutClassList: string[];

Defined in: video/lib/types/StreamClassList.ts:13

An array of layout class names associated with the stream.


VideoClassParameters

type VideoClassParameters = AuthParams & VetchOptions & object;

Defined in: video/lib/parameters/VideoClassParameters.ts:8

Parameters required to initialize the Video class.

Type declaration

applicationId
applicationId: string;

The unique identifier for the application.

auth?
optional auth: AuthInterface;

Optional authentication interface to use for custom authentication.

privateKey
privateKey: string;

The private key used for authentication.


VideoResponse<T>

type VideoResponse<T> = VetchResponse<T>;

Defined in: video/lib/types/VideoResponse.ts:6

Represents a video response that wraps a Vetch response.

Type Parameters

T

T


WebSocketConfig

type WebSocketConfig = object;

Defined in: video/lib/types/WebSocketConfig.ts:6

Configuration options for establishing a WebSocket connection.

Properties

audioRate?
optional audioRate: AudioRate;

Defined in: video/lib/types/WebSocketConfig.ts:27

The audio rate to be used for the WebSocket connection.

headers?
optional headers: object;

Defined in: video/lib/types/WebSocketConfig.ts:20

Optional headers to include in the WebSocket request.

Index Signature
[key: string]: string
streams?
optional streams: string[];

Defined in: video/lib/types/WebSocketConfig.ts:15

An array of stream IDs to associate with the WebSocket connection.

uri
uri: string;

Defined in: video/lib/types/WebSocketConfig.ts:10

The URI to connect to the WebSocket server.


WebSocketConnectResponse

type WebSocketConnectResponse = object;

Defined in: video/lib/types/Response/WebSocketConnectResponse.ts:4

Represents the response for a WebSocket connection.

Properties

connectionId
connectionId: string;

Defined in: video/lib/types/Response/WebSocketConnectResponse.ts:13

The connection identifier associated with the WebSocket connection.

id
id: string;

Defined in: video/lib/types/Response/WebSocketConnectResponse.ts:8

The unique identifier of the WebSocket connection.

Clone this wiki locally