Options
All
  • Public
  • Public/Protected
  • All
Menu

The SubsessionClient provides methods that define subsession functionalities, such as create subsession, join subsession, and leave subsession.

Index

Functions

  • Asks the host to join the subsession to help, host can decline or postpone the request for help.

    • Only a user (not the host) can call this method.

    Returns ExecutedResult

    Executed promise.

  • assignUserToSubsession(userId: number, targetSubsessionId: string): ExecutedResult
  • Assigns an unassigned participant to a subsession. Only available to the host.

    Parameters

    • userId: number

      User ID.

    • targetSubsessionId: string

      Subsession ID.

    Returns ExecutedResult

    Executed promise.

  • Broadcasts content in the main session and all subsessions. Only available to the host.

    Parameters

    • content: string

      Content to broadcast.

    Returns ExecutedResult

    Executed promise.

  • Closes all the subsession. Only available to the host.

    Returns ExecutedResult

    Executed promise

  • Creates subsessions.

    Parameters

    • data: string | number | string[]

      Accepts the following parameters:

      • number : the number of subsessions to create. The SDK will create the specified number of subsessions, automatically named.
      • string : the name of the subsession. The SDK will create a subsession with the specified name.
      • Array<string>: a list of named subsessions. The specified subsession will be created.
    • Optional pattern: SubsessionAllocationPattern

      How to assign users to subsessions:

      • SubsessionAllocationPattern.Automatically: Distribute users evenly to each subsession.
      • SubsessionAllocationPattern.Manually: The users will be assigned manually later. This is the default.

    Returns Promise<Subsession[] | Error>

    Promise<Array<Subsession> | Error>

    • Subsession List: success
    • Error
      • INVALID_OPERATION (Subsession has started!)
      • INVALID_PARAMETERS (Exceed maximum size): maximum_size = 50; if support big subsessions plan, up to 100
  • getCurrentSubsession(): { subsessionId: string; subsessionName: string; userStatus: SubsessionUserStatus }
  • Gets the current subsession information.

    Returns { subsessionId: string; subsessionName: string; userStatus: SubsessionUserStatus }

    • subsessionId: string

      Subsession ID.

    • subsessionName: string

      Subsession name.

    • userStatus: SubsessionUserStatus

      User status.

  • Gets the list of subsessions. If you are the host, will get all the subsessions. If you are the participant, will get the assigned subsession.

    Returns Subsession2[]

  • Gets the unassigned list of users.

    Returns Participant[]

  • isSubsessionEnabled(): boolean
  • Determines whether the subsession is enabled.

    Returns boolean

  • Joins a subsession.

    • Join only after the subsession is open.

    Parameters

    • subsessionId: string

      Subsession ID.

    Returns ExecutedResult

    Executed promise.

  • Leaves the subsession.

    • If the user is not allowed to leave the subsession, they cannot return to the main session.

    Returns ExecutedResult

    Executed promise.

  • Move a participant back to the main session

    Parameters

    • userId: number

      User ID.

    Returns ExecutedResult

    Executed promise

  • moveUserToSubsession(userId: number, targetSubsessionId: string): ExecutedResult
  • Moves a participant from one subsession to the specified subsession. Only available to the host.

    Parameters

    • userId: number

      User ID.

    • targetSubsessionId: string

      Subsession ID.

    Returns ExecutedResult

    Executed promise.

  • Opens the created subsessions.

    Parameters

    • subsessions: Subsession[]

      Subsession list required. Must include subsession ID and name.

    • Optional options: SubsessionOption

      Subsession option; Default options =

      {
      isAutoJoinSubsession: false,
      isBackToMainSessionEnabled: true,
      isTimerEnabled: false,
      timerDuration: 1800,
      isTimerAutoEnabled: false,
      waitSeconds: 60,
      }

    Returns ExecutedResult

    Executed promise.

  • Postpones the request for help.

    Parameters

    • userId: number

      User ID of the user who requested help.

    Returns ExecutedResult

    Executed promise.

  • Starts broadcast voice to subsessions

    Returns ExecutedResult

    Executed promise

  • Stops broadcast voice to subsessions

    Returns ExecutedResult

    Executed promise