SessionService

The SessionService allows opening and closing sessions. Opening a session is mandatory before interacting with any service.

Accessors

participant

• get participant(): Participant

Provides the local participant object that belongs to the current session.

Returns: Participant

Methods

close

close(): Promise<void>

Closes the current session.

Returns: Promise<void>


isOpen

isOpen(): boolean

Checks whether there is an open session that connects SDK with backend.

Returns: boolean


open

open(info?: ParticipantInfo): Promise<void>

Opens a new session.

Note: The external ID field in this API has been deprecated; now you can provide the external ID only when requesting a client access token. If you provide to this API an external ID that is different from the one in your client access token, it will be rejected.

Parameters:

NameTypeDefault valueDescription
infoParticipantInfo{}The optional information about the local participant.

Returns: Promise<void>


updateParticipantInfo

updateParticipantInfo(participantInfo: ParticipantInfo): Promise<void>

Updates the local participant's name and avatar URL. The method does not allow updating the external ID. This method is supported in SDK 3.10 and later.

Parameters:

NameTypeDescription
participantInfoParticipantInfoThe preferred participant name and avatar URL.

Returns: Promise<void>