ILiveShareHost interface

Interface for hosting a Live Share session within a client like Teams.

Methods

getClientInfo(string)

Queries the hosts IClientInfo for a given client ID.

getClientRoles(string)
getFluidContainerId()

Returns the container mapping information for the current session.

getFluidTenantInfo()

Returns the Fluid service endpoint and tenant to use for the current session.

getFluidToken(string)

Returns the Fluid access token to use for the current session.

getNtpTime()

Returns the global timestamp for the current session.

registerClientId(string)

Registers the local clients Fluid client ID with the hosts role verification service.

setFluidContainerId(string)

Attempts to save the ID of the Fluid container created to the hosts mapping service.

Method Details

getClientInfo(string)

Queries the hosts IClientInfo for a given client ID.

function getClientInfo(clientId: string): Promise<undefined | IClientInfo>

Parameters

clientId

string

ID of the client to lookup.

Returns

Promise<undefined | IClientInfo>

IUserInfo for the queried client ID, or undefined if the client hasn't yet been registered

getClientRoles(string)

Warning

This API is now deprecated.

Queries the hosts role verification service for the roles associated with a given client ID.

function getClientRoles(clientId: string): Promise<undefined | UserMeetingRole[]>

Parameters

clientId

string

ID of teh client to lookup.

Returns

Promise<undefined | UserMeetingRole[]>

An array of roles assigned to the queried client ID.

getFluidContainerId()

Returns the container mapping information for the current session.

function getFluidContainerId(): Promise<IFluidContainerInfo>

Returns

Remarks

Hosts are required to implement a container mapping service that stores the container ID for the current session.

TODO: add creation protocol details

getFluidTenantInfo()

Returns the Fluid service endpoint and tenant to use for the current session.

function getFluidTenantInfo(): Promise<IFluidTenantInfo>

Returns

Promise<IFluidTenantInfo>

getFluidToken(string)

Returns the Fluid access token to use for the current session.

function getFluidToken(containerId?: string): Promise<string>

Parameters

containerId

string

Optional. ID of the container being joined. This will be undefined when creating a new container.

Returns

Promise<string>

getNtpTime()

Returns the global timestamp for the current session.

function getNtpTime(): Promise<INtpTimeInfo>

Returns

Promise<INtpTimeInfo>

registerClientId(string)

Registers the local clients Fluid client ID with the hosts role verification service.

function registerClientId(clientId: string): Promise<UserMeetingRole[]>

Parameters

clientId

string

Unique ID assigned to the local Fluid client.

Returns

Promise<UserMeetingRole[]>

An array of meeting roles assigned to the local user.

Remarks

Hosts should expect this to be called anytime the Fluid clients underlying socket connects or reconnects.

setFluidContainerId(string)

Attempts to save the ID of the Fluid container created to the hosts mapping service.

function setFluidContainerId(containerId: string): Promise<IFluidContainerInfo>

Parameters

containerId

string

Id of the Fluid container that was created.

Returns

Information indicating the success of mapping assignment.

Remarks

Hosts should return a containerState of "Added" if the mapping was successfully saved, otherwise a state of "Conflict" should be returned to indicate that another client has already saved a container ID for the current session.