Constructors

Properties

Methods

#checkAuthenticated #createConnection #emitMessageCursor #emmitAction #emmitBinaryAction #getConnectionConfigForAnonymousUser #getConnectionConfigForExamples #sendHttpAttachments #teardown #uploadIcon #uploadsToThisNode acceptFriendInvite addCalendarEvent addChannelSendPermissionListMember addChatToFavourites addFriend addMemberToChat addMembersToThread addReactionOnMessage addRoleToMember addSpaceRole addUserEncryptionInfo assignUserSpacesLicense cancelAttachmentDownload cancelSendingMessage changeUserEmail changeUserHostKey changeUserNickname changeUserPassword changeUserPhoneNumber changeUserTimezone closePcAndFireEvent connect createChannelMeeting createChat createDirectMeeting createMessagesSynchronizer createRoom createRoomFromEvent createSpace createSpaceCategory createSpaceChannel createSpaceThread deleteChat deleteMessage deleteSpace deleteSpaceCategory deleteSpaceChannel deleteSpaceRole deleteSpaceThread disconnect downloadAttachment editMessage ensureUsernameAvailable generateNewSpaceInvite getAttachmentsSize getChannelPreview getChatCursor getChatsSyncSummary getContacts getExamplesFreeUser getFirstAndLastMessage getMessageAttachment getMessagesCount getMessagesDifference getOwnerSpacesUsers getPublicChannels getRolePermissions getRoom getSendingAttachmentsHandler getStorageSections getSystemConfig getUnreadMessagesCount getUserCalendar getUserChats getUserEncryptionInfo getUserInfo getUserPmiSettings getUserSpaces joinSpaceByInviteCode leaveSpace listAttachments listRecords loadActiveRooms loadChat loadMeetingsHistory loadMessages loadMessagesWithMentions logout markMessageRead markMessageUnread moveSpaceChannel muteChannel muteChat muteSpace muteThread off on rejectFriendInvite removeCalendarEvent removeChannelSendPermissionListMember removeChatFromFavourites removeFriend removeMeetingFromHistory removeMeetingRecord removeMemberFromChat removeMemberFromThread removeReactionOnMessage removeRecords removeRoleFromMember removeStorageAttachments removeUser renameChat resetPassword resolveServerUrl revokeFriendInvite revokeSpaceInvite revokeUserSpacesLicense roomAvailable roomExists searchChatMessages searchMessageAttachments sendMessage server signUp state unmuteChannel unmuteChat unmuteSpace unmuteThread updateActivityStatus updateBrandingLogo updateBrandingLogoRequest updateCalendarEvent updateChannelAssignedNode updateChannelAutoRecordJoinMode updateChannelNotificationSettings updateChannelRecordingMode updateChannelSendPolicy updateChatConfiguration updateChatHiding updateChatIcon updateChatIconRequest updateChatNotificationSettings updateChatReceivePolicy updateContactVolume updateCustomDomain updatePresenceStatus updateSpaceAssignedNode updateSpaceAutoRecordJoinMode updateSpaceCategory updateSpaceChannel updateSpaceIcon updateSpaceIconRequest updateSpaceNickname updateSpaceNotificationSettings updateSpaceOverview updateSpaceRecordingMode updateSpaceRole updateSpaceThread updateThreadNotificationSettings updateUserIcon updateUserIconRequest updateUserPmiSettings user fromUTF8ArrayToStr generateAttachmentId strToUTF8Array

Constructors

Properties

#_server: string
#_state: State = State.NEW
#_url: string
#_user: {
    authToken: string;
    email: string;
    nickname: string;
    pmi: string;
    username: string;
    webRTCMetricsServerDescription?: RTCMetricsServerDescription;
}

Type declaration

  • authToken: string
  • email: string
  • nickname: string
  • pmi: string
  • username: string
  • Optional webRTCMetricsServerDescription?: RTCMetricsServerDescription
#attachmentDownloadCancels: Set<string> = ...
#attachmentDownloadsInFlight: Map<string, number> = ...
#attachmentSendScheduler: AttachmentSendScheduler = ...
#attachmentsTransferManager: AttachmentsTransferManager = ...
#binaryChunkSize: number
#connection: Connection
#logger: default = ...
#loggerPrefix: PrefixFunction
#notifier: Notifier<EventUnion, NotifyUnion> = ...
#publicUploadAddress: PublicUploadAddress = ...
#resetPasswordId: string = ''
#rooms: {
    [key: string]: RoomExtended;
} = {}

Type declaration

#signUpId: string = ''
#transferPingOptions: {
    failedProbesThreshold?: number;
    pingInterval?: number;
} = {}

Type declaration

  • Optional failedProbesThreshold?: number
  • Optional pingInterval?: number
#uploadingAttachmentState: MessageWithUploadingAttachmentState = {}

Methods

  • Returns void

  • Returns void

  • Emit the journal seq carried by a live message event as a separate SfuEvent.MESSAGE_CURSOR.

    The payloads of the live events themselves are left untouched: subscribers of SfuEvent.MESSAGE keep receiving a Message, and an event answering an own action still goes to the pending promise rather than to the subscribers. The cursor is taken before that branching, so a change made by this very client moves the cursor just like a change made by anybody else.

    Parameters

    • raw: any

      the event as it came from the server, the cursor is read from its top level

    • sourceEvent: SfuEvent
    • entity: SyncEntity

      entity the change belongs to, taken from the message itself for SFU_MESSAGE and SEND_MESSAGE_SYNC and from the top level of the event for the rest

    • messageId: string
    • Optional watermark: boolean

      the cursor covers every record up to it rather than one change of its own, see MessageCursorEvent.watermark

    Returns void

  • Parameters

    • action: InternalApi
    • data: object
    • resolve: Function
    • reject: Function

    Returns string

  • Parameters

    • data: any

    Returns void

  • Parameters

    • url: string
    • Optional timeout: number

    Returns {
        appName: InternalApi;
        custom: {
            nickname: string;
            password: string;
            username: string;
        };
        timeout: number;
        url: string;
    }

    • appName: InternalApi
    • custom: {
          nickname: string;
          password: string;
          username: string;
      }
      • nickname: string
      • password: string
      • username: string
    • timeout: number
    • url: string
  • Parameters

    • url: string
    • Optional timeout: number

    Returns {
        appName: InternalApi;
        custom: {
            nickname: string;
            password: string;
            username: string;
        };
        timeout: number;
        url: string;
    }

    • appName: InternalApi
    • custom: {
          nickname: string;
          password: string;
          username: string;
      }
      • nickname: string
      • password: string
      • username: string
    • timeout: number
    • url: string
  • Parameters

    • closeTransfers: boolean

    Returns Promise<void>

  • Parameters

    • uploadUrl: string
    • Optional icon: File

    Returns Promise<string>

  • Parameters

    • msg: {
          httpAttachments?: boolean;
          uploadToThisNode?: boolean;
      }
      • Optional httpAttachments?: boolean
      • Optional uploadToThisNode?: boolean

    Returns boolean

  • Add calendar event

    Parameters

    • event: {
          accessCode?: string;
          allowJoinAtAnyTime: boolean;
          description: string;
          end: number;
          ownerVideo: boolean;
          participantVideo: boolean;
          recurring: boolean;
          start: number;
          title: string;
          useLocalAutoRecord: boolean;
          useMuteAudioOnJoin: boolean;
          usePMI: boolean;
          waitingRoom: boolean;
      }
      • Optional accessCode?: string
      • allowJoinAtAnyTime: boolean
      • description: string
      • end: number
      • ownerVideo: boolean
      • participantVideo: boolean
      • recurring: boolean
      • start: number
      • title: string
      • useLocalAutoRecord: boolean
      • useMuteAudioOnJoin: boolean
      • usePMI: boolean

        if true then user PMI settings will be updated and user will receive SfuEvent.UPDATE_USER_PMI_SETTINGS with UserPmiSettings

      • waitingRoom: boolean

    Returns Promise<CalendarEvent>

  • Parameters

    • channel: {
          id: string;
          member: string;
      }
      • id: string
      • member: string

    Returns Promise<UserSpecificChatInfo>

    Deprecated

  • Add space role

    For space owner/user that has permission to manage roles

    Space members will receive SpaceEvent.NEW_SPACE_ROLE with NewSpaceRoleAdded

    On the client side, a new role must be added to the participants listed in the NewSpaceRoleAdded.members

    Parameters

    • role: {
          color: string;
          members: string[];
          name: string;
          permissions: string[];
          spaceId: string;
      }
      • color: string
      • members: string[]
      • name: string
      • permissions: string[]
      • spaceId: string

    Returns Promise<SfuSpaceRole>

  • After adding:

    User's contacts will see Contact.encryptionEnabled and Contact.publicKey. The remaining information is not used on the server and is only stored; it can be requested using getUserEncryptionInfo.

    verificationHash, salt, and iv are optional; the client chooses the private key encryption method.

    salt - Cryptographic Salt

    iv - Initialization Vector for Encryption

    Parameters

    • info: {
          iv?: string;
          privateKey: string;
          publicKey: string;
          salt?: string;
          verificationHash?: string;
      }
      • Optional iv?: string
      • privateKey: string
      • publicKey: string
      • Optional salt?: string
      • Optional verificationHash?: string

    Returns Promise<UserEncryptionInfo>

  • Parameters

    • options: {
          userId: string;
      }
      • userId: string

    Returns Promise<void>

  • The download's promise rejects with DOWNLOADING_ATTACHMENT_CANCELLED; best effort, a no-op when idle.

    Parameters

    • attachment: {
          attachmentId: string;
          messageId: string;
      }
      • attachmentId: string
      • messageId: string

    Returns void

  • Cancels a pending HTTP send with its uploaded bodies; refused once delivered or on the legacy upload. editAttachmentIds limit it to the edit holding those files; an abandoned cancel is refused with SENDING_FINALIZING_ERROR while the uploaded message is being delivered.

    Parameters

    Returns Promise<AttachmentCancelAck>

  • Change user email

    Parameters

    • email: string

    Returns Promise<void>

  • Parameters

    • hostKey: string

    Returns Promise<void>

  • Change user email

    Users will receive SfuEvent.CONTACT_UPDATED with changed nickname

    Parameters

    • nickname: string

    Returns Promise<void>

  • Parameters

    • currentPassword: string
    • newPassword: string

    Returns Promise<void>

  • Parameters

    • phoneNumber: string

    Returns Promise<void>

  • Parameters

    • timezone: string

    Returns Promise<void>

  • Parameters

    Returns void

  • Connects the user to the server.

    The user can connect using either a username and password or an authToken.

    Once the connection is successful, the state will change to State.AUTHENTICATED. After that, the sfu-sdk will emit the event SfuEvent.CONNECTED.

    Parameters

    • options: {
          authToken?: string;
          binaryChunkSize?: number;
          details?: ConnectionDetails;
          device?: string;
          failedProbesThreshold?: number;
          issuerAccessToken?: string;
          nickname?: string;
          password?: string;
          pingInterval?: number;
          timeout?: number;
          url: string;
          username?: string;
      }
      • Optional authToken?: string

        The authentication token for direct login (optional if username and password are provided).

      • Optional binaryChunkSize?: number
      • Optional details?: ConnectionDetails
      • Optional device?: string
      • Optional failedProbesThreshold?: number
      • Optional issuerAccessToken?: string

        An access token from the authority the server trusts, for the primary login; requires username, ignored unless the server issues tokens.

        After successfully connection user contacts will receive an SfuEvent.USER_PRESENCE_STATUS_UPDATED with UserPresenceStatusUpdated

      • Optional nickname?: string
      • Optional password?: string

        The user's password (optional if authToken is provided).

      • Optional pingInterval?: number
      • Optional timeout?: number
      • url: string
      • Optional username?: string

        The user's username (optional if authToken is provided).

    Returns Promise<{
        authToken: string;
        email: string;
        nickname: string;
        pmi: string;
        username: string;
    }>

  • Create channel meeting

    Room.id() will be equal channelId

    Parameters

    • options: {
          channelId: string;
          spaceId: string;
      }
      • channelId: string
      • spaceId: string

    Returns Promise<RoomExtended>

    RoomExtended with () that equal ConferenceType.CHANNEL

  • Create chat

    Parameters

    • chat: {
          allowedToAddExternalUser?: boolean;
          channel?: boolean;
          channelSendPolicy?: ChannelSendPolicy;
          encryptedAttachmentsSecretKey?: string;
          encryptedChatPasswords?: UserChatEncryptedPassword[];
          encryptedPrivateKey?: string;
          favourite?: boolean;
          id?: string;
          isEncryptionEnabled?: boolean;
          members?: string[];
          name?: string;
          publicKey?: string;
          sendPermissionList?: string[];
          type?: ChatType;
      }
      • Optional allowedToAddExternalUser?: boolean
      • Optional channel?: boolean
      • Optional channelSendPolicy?: ChannelSendPolicy
      • Optional encryptedAttachmentsSecretKey?: string

        encrypted key for encrypting attachments.

      • Optional encryptedChatPasswords?: UserChatEncryptedPassword[]

        an array of chat passwords for each member encrypted with the member's public keys, which must be decrypted using the user's private key.

      • Optional encryptedPrivateKey?: string

        the private key of the chat, encrypted with a chat password, used to decrypt messages

      • Optional favourite?: boolean
      • Optional id?: string
      • Optional isEncryptionEnabled?: boolean

        must be true for a Secure Chat

      • Optional members?: string[]

        these members will receive SfuEvent.NEW_CHAT with UserSpecificChatInfo

      • Optional name?: string
      • Optional publicKey?: string

        the public key of the chat used to encrypt messages

      • Optional sendPermissionList?: string[]
      • Optional type?: ChatType

    Returns Promise<UserSpecificChatInfo>

    Deprecated

    Deprecated

    Deprecated

    Deprecated

    Creating a Secure Chat with Encryption:

  • Create channel meeting

    Room.id() will be equal directChatId

    Parameters

    • options: {
          directChatId: string;
      }
      • directChatId: string

    Returns Promise<RoomExtended>

    RoomExtended with () that equal ConferenceType.DIRECT

  • Create a catch up synchronization layer on top of this connection.

    The synchronizer pulls the cursor summary and the difference of the diverging entities on every connect and reconnect, leaving the live stream untouched. Persisting messages and cursors is up to the passed MessagesSyncStore.

    Parameters

    Returns MessagesSynchronizer

  • Create room

    To create with PMI settings, PMI must be specified as the ID.

    To join, you need to use room.join.

    Parameters

    • options: {
          id?: string;
          name?: string;
          pin?: string;
      }
      • Optional id?: string
      • Optional name?: string
      • Optional pin?: string

    Returns Promise<RoomExtended>

    RoomExtended with () that equal ConferenceType.GLOBAL

  • Creating a room based on a calendar event created using addCalendarEvent.

    To join, you need to use room.join()

    Parameters

    • event: {
          accessCode?: string;
          allowJoinAtAnyTime: boolean;
          description: string;
          end: number;
          id: string;
          ownerVideo: boolean;
          participantVideo: boolean;
          recurring: boolean;
          start: number;
          title: string;
          useLocalAutoRecord: boolean;
          useMuteAudioOnJoin: boolean;
          usePMI: boolean;
          waitingRoom: boolean;
      }
      • Optional accessCode?: string
      • allowJoinAtAnyTime: boolean
      • description: string
      • end: number
      • id: string
      • ownerVideo: boolean
      • participantVideo: boolean
      • recurring: boolean
      • start: number
      • title: string
      • useLocalAutoRecord: boolean
      • useMuteAudioOnJoin: boolean
      • usePMI: boolean
      • waitingRoom: boolean

    Returns Promise<RoomExtended>

  • The space is created with the default category Category1, default channel Channel1 and default role "@everyone".

    Parameters

    • space: {
          name: string;
      }
      • name: string

    Returns Promise<SfuSpace>

  • Create space channel

    For space owner/user that has permission to manage channels

    Channel members will receive SpaceEvent.NEW_SPACE_CHANNEL with NewSpaceChannelEvent

    Parameters

    • channel: {
          categoryId?: string;
          isPrivate: boolean;
          members?: string[];
          name: string;
          roles?: string[];
          spaceId: string;
      }
      • Optional categoryId?: string
      • isPrivate: boolean
      • Optional members?: string[]

        used to create a private channel. Array of member ids or empty array.

      • name: string
      • Optional roles?: string[]

        used to create a private channel. Array of role ids or empty array.

      • spaceId: string

    Returns Promise<SfuSpaceChannel>

  • Create space thread

    Thread members will receive SpaceEvent.NEW_SPACE_THREAD with NewSpaceThreadEvent

    Parameters

    • thread: {
          channelId: string;
          isPrivate: boolean;
          name: string;
          spaceId: string;
      }
      • channelId: string
      • isPrivate: boolean
      • name: string
      • spaceId: string

    Returns Promise<SfuSpaceThread>

  • Delete space role

    For space owner/user that has permission to manage roles

    Space members will receive SpaceEvent.SPACE_ROLE_DELETED with SpaceRoleDeleted

    On the client side, should remove this role from channel's access rights and update channel members list

    Parameters

    • options: {
          roleId: string;
          spaceId: string;
      }
      • roleId: string
      • spaceId: string

    Returns Promise<SpaceRoleDeleted>

  • Delete space thread

    For space owner/thread creator

    Thread members will receive SpaceEvent.SPACE_THREAD_DELETED with SpaceThreadDeleted

    Parameters

    • options: {
          channelId: string;
          spaceId: string;
          threadId: string;
      }
      • channelId: string
      • spaceId: string
      • threadId: string

    Returns Promise<void>

  • Ensure username available

    If the username is not taken, the promise will resolve with void.

    If the username is taken, the promise will reject with UserManagementError.USERNAME_ALREADY_IN_USE.

    Parameters

    • options: {
          timeout?: number;
          url: string;
          username: string;
      }
      • Optional timeout?: number
      • url: string
      • username: string

    Returns Promise<void>

  • Generate space invite

    If user has permission to create a space invite - generating invite code with 8 symbols. To create invite link - use 'ws:{serverUrl}:{port}/join-space/inviteCode'

    Parameters

    • options: {
          lifespan: number;
          spaceId: string;
      }
      • lifespan: number
      • spaceId: string

    Returns Promise<SfuSpaceInvite>

  • Get the newest message of every thread of a channel the user belongs to, in a single request.

    Meant for a list of threads: it is filled without loading every thread. A private message is skipped unless the requester is its author or its addressee, and the request leaves delivery statuses as they are.

    Parameters

    • options: {
          channelId: string;
          spaceId: string;
      }
      • channelId: string

        channel whose threads are previewed

      • spaceId: string

        space of the channel

    Returns Promise<ChannelPreviewEvent>

  • Get the current server cursor of every chat, channel and thread of the user in a single request.

    Compare the returned cursors with the ones kept locally to find out which entities changed while the client was away, then pull those with getMessagesDifference.

    Returns Promise<ChatsSyncSummaryEvent>

  • Get user contacts.

    Returns users who are friends or with whom there are mutual space channels or direct chats, incoming and outgoing friend invites, banned users.

    Returns Promise<UserContacts>

  • Parameters

    • options: {
          timeout?: number;
          url: string;
      }
      • Optional timeout?: number
      • url: string

    Returns Promise<ExamplesUser>

  • Get the actual state of every message of an entity changed after the given cursor.

    Messages come deduplicated by id and ordered by their journal seq, apply them by replacing the local copy with the same id. Store MessagesDifferenceEvent.newCursor once the whole response is applied, request the next page with sinceCursor = newCursor while hasMore is set, and fall back to a full loadMessages when resyncRequired is set.

    Delivery status changes are journaled as well, but only those of the messages falling into the cache of the client are sent, so pass the intervals of the locally held history when there are any.

    Parameters

    Returns Promise<MessagesDifferenceEvent>

  • Returns Promise<ChatMap>

    Deprecated

  • Parameters

    • options: {
          id: string;
      }
      • id: string

    Returns RoomExtended

  • Get all user calendar events

    Returns Promise<Calendar>

  • Get user info

    Usually used to display profile info

    Returns Promise<UserInfo>

  • Get user pmi settings

    Used for create meetings

    Returns Promise<UserPmiSettings>

  • Leave space

    Space members will receive SpaceEvent.USER_LEFT_SPACE with UserLeftSpace

    After receiving the event, it is necessary to remove the user from the list of members in the space and channels/threads.

    If channel meetings were started, user will receive MeetingSyncEvent.MEETING_ENDED_SYNC with MeetingEndedSync. If the user was a participant in the meeting, users will receive RoomEvent.EVICTED with EvictedFromRoom.

    Parameters

    • space: {
          id: string;
      }
      • id: string

    Returns Promise<void>

  • List user attachments

    Parameters

    • filter: {
          offset: number;
          pageSize: number;
          sectionType: string;
          sortField?: AttachmentSortField;
          sortOrder?: SortOrder;
          spaceId?: string;
      }
      • offset: number

        starting point for retrieving a subset of attachments

      • pageSize: number

        number of items retrieved and displayed per page

      • sectionType: string
      • Optional sortField?: AttachmentSortField
      • Optional sortOrder?: SortOrder
      • Optional spaceId?: string

    Returns Promise<AttachmentListEvent>

  • Parameters

    • filter: {
          offset: number;
          pageSize: number;
          sectionType: string;
          sortField?: RecordSortField;
          sortOrder?: SortOrder;
          spaceId?: string;
      }
      • offset: number
      • pageSize: number
      • sectionType: string
      • Optional sortField?: RecordSortField
      • Optional sortOrder?: SortOrder
      • Optional spaceId?: string

    Returns Promise<RecordListEvent>

  • Get running rooms

    Returns Promise<RoomInfo[]>

  • Parameters

    • chat: {
          id: string;
      }
      • id: string

    Returns Promise<Chat>

  • Load meetings history

    Used to load the history of global meetings.

    The response returns a MeetingsHistoryEvent with the requested items and the total size.

    Parameters

    • params: {
          boundaries?: {
              dateMark: number;
              lowerLimit: number;
              upperLimit: number;
          };
          pageRequest?: {
              page: number;
              pageSize: number;
          };
          recordedOnly?: boolean;
          timeFrame?: {
              end: number;
              limit?: number;
              start: number;
          };
      }
      • Optional boundaries?: {
            dateMark: number;
            lowerLimit: number;
            upperLimit: number;
        }
        • dateMark: number
        • lowerLimit: number
        • upperLimit: number
      • Optional pageRequest?: {
            page: number;
            pageSize: number;
        }
        • page: number
        • pageSize: number
      • Optional recordedOnly?: boolean

        When true, only meetings that still have a recording are returned. Backs the "Rec" filter of the meetings History list; omit or set false to return the full history.

      • Optional timeFrame?: {
            end: number;
            limit?: number;
            start: number;
        }
        • end: number
        • Optional limit?: number
        • start: number

    Returns Promise<MeetingsHistoryEvent>

  • Load messages for Direct chat | Channel | Thread

    Parameters

    • params: {
          boundaries?: {
              dateMark: number;
              lowerLimit: number;
              upperLimit: number;
          };
          targetEntityId: MessageTargetEntityId;
          targetEntityType: MessageTargetEntityType;
          timeFrame?: {
              end: number;
              limit?: number;
              start: number;
          };
      }
      • Optional boundaries?: {
            dateMark: number;
            lowerLimit: number;
            upperLimit: number;
        }

        to load messages by specifying a particular message using its date, along with the number of messages above and below it. Upper limit includes message with date dateMark.

        • dateMark: number
        • lowerLimit: number
        • upperLimit: number
      • targetEntityId: MessageTargetEntityId
      • targetEntityType: MessageTargetEntityType
      • Optional timeFrame?: {
            end: number;
            limit?: number;
            start: number;
        }

        to load by start date to end date. For load all messages used with start = 0, end = -1.

        • end: number
        • Optional limit?: number
        • start: number

    Returns Promise<Message[]>

  • Parameters

    • params: {
          boundaries?: {
              dateMark: number;
              lowerLimit: number;
              upperLimit: number;
          };
          chatId?: string;
          sortOrder: SortOrder;
          timeFrame?: {
              end: number;
              limit?: number;
              start: number;
          };
          userTag: string;
      }
      • Optional boundaries?: {
            dateMark: number;
            lowerLimit: number;
            upperLimit: number;
        }
        • dateMark: number
        • lowerLimit: number
        • upperLimit: number
      • Optional chatId?: string
      • sortOrder: SortOrder
      • Optional timeFrame?: {
            end: number;
            limit?: number;
            start: number;
        }
        • end: number
        • Optional limit?: number
        • start: number
      • userTag: string

    Returns Promise<LoadMessagesWithMentionsResult>

    Deprecated

  • Logout from app

    Returns Promise<void>

  • Move space channel

    Channel members will receive SpaceEvent.SPACE_CHANNEL_MOVED with SpaceChannelMoved

    Parameters

    • channel: {
          categoryId: string;
          channelId: string;
          spaceId: string;
      }
      • categoryId: string

        Specify the identifier of the category to which you want to move the channel, or an empty string to leave the channel uncategorized.

      • channelId: string
      • spaceId: string

    Returns Promise<SpaceChannelMoved>

  • Mute channel

    Parameters

    • options: {
          channelId: string;
          muteTime?: number;
          mutedIndefinitely?: boolean;
          spaceId: string;
      }
      • channelId: string
      • Optional muteTime?: number

        – the duration for which the sound is muted. The final event will contain MuteSettings.mutedUntil, which is the current time plus the specified duration.

      • Optional mutedIndefinitely?: boolean

        – indicates whether the sound is muted indefinitely.

        Returns ChannelMuted, and other connected devices will also receive this event for synchronization.

      • spaceId: string

    Returns Promise<ChannelMuted>

  • Mute chat

    Parameters

    • options: {
          id: string;
          muteTime?: number;
          mutedIndefinitely?: boolean;
      }
      • id: string
      • Optional muteTime?: number

        – the duration for which the sound is muted. The final event will contain MuteSettings.mutedUntil, which is the current time plus the specified duration.

      • Optional mutedIndefinitely?: boolean

        – indicates whether the sound is muted indefinitely.

        Returns ChatMuted, and other connected devices will also receive this event for synchronization.

    Returns Promise<ChatMuted>

  • Mute space

    Parameters

    • options: {
          muteTime?: number;
          mutedIndefinitely?: boolean;
          spaceId: string;
      }
      • Optional muteTime?: number

        – the duration for which the sound is muted. The final event will contain MuteSettings.mutedUntil, which is the current time plus the specified duration.

      • Optional mutedIndefinitely?: boolean

        – indicates whether the sound is muted indefinitely.

        Returns SpaceMuted, and other connected devices will also receive this event for synchronization.

      • spaceId: string

    Returns Promise<SpaceMuted>

  • Mute thread

    Parameters

    • options: {
          channelId: string;
          muteTime?: number;
          mutedIndefinitely?: boolean;
          spaceId: string;
          threadId: string;
      }
      • channelId: string
      • Optional muteTime?: number

        – the duration for which the sound is muted. The final event will contain MuteSettings.mutedUntil, which is the current time plus the specified duration.

      • Optional mutedIndefinitely?: boolean

        – indicates whether the sound is muted indefinitely.

        Returns ThreadMuted, and other connected devices will also receive this event for synchronization.

      • spaceId: string
      • threadId: string

    Returns Promise<ThreadMuted>

  • Parameters

    • event: {
          id: string;
      }
      • id: string

    Returns Promise<CalendarEvent>

  • Parameters

    • channel: {
          id: string;
          member: string;
      }
      • id: string
      • member: string

    Returns Promise<UserSpecificChatInfo>

    Deprecated

  • Remove meeting from history

    Used to remove meeting from history. Any user can remove it. This does not affect other users' history in any way.

    Parameters

    • id: string

    Returns Promise<void>

  • Removes the meeting recording (video).

    The right to remove is granted to the following roles: In global meetings – the meeting owner In channel meetings – the space owner In group direct chats – the chat creator In personal direct chats – every participant, but only for themselves: the recording stays available to the other side and leaves the storage once both participants have removed it

    Users will receive MeetingRecordDeleted for global meetings and MessageEdited for others, because it's system message

    Parameters

    • options: {
          meetingHistoryItemId: string;
          meetingId?: string;
          meetingType: ConferenceType;
          recordId: string;
          spaceId?: string;
      }
      • meetingHistoryItemId: string
      • Optional meetingId?: string
      • meetingType: ConferenceType
      • recordId: string
      • Optional spaceId?: string

    Returns Promise<void>

  • Removes the meeting records of the Storage section.

    A record of a meeting in a personal chat is kept by both participants: the call gives up the caller's copy and frees their storage, and the record itself is deleted once nobody keeps it. Any other record is deleted for everyone, and only its owner may do that.

    Parameters

    • records: {
          conferenceType: string;
          historyItemId: string;
          id: string;
          meetingId: string;
          record: string;
          spaceId?: string;
      }[]

    Returns Promise<RemoveRecordsResult>

  • Remove user (internal using)

    Parameters

    • options: {
          id: string;
          timeout?: number;
          url: string;
      }
      • id: string
      • Optional timeout?: number
      • url: string

    Returns Promise<void>

  • Update chat

    Chat members will receive SfuEvent.CHAT_UPDATED with UserSpecificChatInfo

    Parameters

    • chat: {
          id: string;
          name: string;
      }
      • id: string
      • name: string

    Returns Promise<void>

  • Rebuilds a url issued by the server against the connection this client holds, so that it is reachable and loadable from here. See resolveServerUrl in ./server-url for the rules.

    Parameters

    • url: string

    Returns string

  • Removing the space invite

    Parameters

    • options: {
          inviteCode: string;
          spaceId: string;
      }
      • inviteCode: string
      • spaceId: string

    Returns Promise<SfuSpaceInvite>

  • Parameters

    • options: {
          userId: string;
      }
      • userId: string

    Returns Promise<void>

  • Check and get an available room.

    To join, you need to use room.join()

    Parameters

    • options: {
          id: string;
          nickname?: string;
          pin?: string;
      }
      • id: string
      • Optional nickname?: string
      • Optional pin?: string

    Returns Promise<RoomExtended>

  • Checks for the existence of a running room.

    Parameters

    • options: {
          id: string;
          pin?: string;
      }
      • id: string
      • Optional pin?: string

    Returns Promise<void>

  • Parameters

    • params: {
          chatId: string;
          limit?: number;
          searchId?: string;
          searchString: string;
      }
      • chatId: string
      • Optional limit?: number
      • Optional searchId?: string
      • searchString: string

    Returns Promise<Message[]>

    Deprecated

  • Parameters

    • params: {
          attachmentsType?: MessageAttachmentMediaType;
          boundaries?: {
              dateMark: number;
              lowerLimit: number;
              upperLimit: number;
          };
          chatId?: string;
          from?: string;
          searchString?: string;
          sortOrder: SortOrder;
          timeFrame?: {
              end: number;
              limit?: number;
              start: number;
          };
      }
      • Optional attachmentsType?: MessageAttachmentMediaType
      • Optional boundaries?: {
            dateMark: number;
            lowerLimit: number;
            upperLimit: number;
        }
        • dateMark: number
        • lowerLimit: number
        • upperLimit: number
      • Optional chatId?: string
      • Optional from?: string
      • Optional searchString?: string
      • sortOrder: SortOrder
      • Optional timeFrame?: {
            end: number;
            limit?: number;
            start: number;
        }
        • end: number
        • Optional limit?: number
        • start: number

    Returns Promise<MessageAttachmentsSearchResult>

    Deprecated

  • Send a message to a Direct chat | Channel | Thread

    Members will receive SfuEvent.MESSAGE with Message

    Parameters

    • msg: {
          attachments?: MessageAttachment[];
          body?: string;
          httpAttachments?: boolean;
          id?: string;
          parentId?: string;
          targetEntityId: MessageTargetEntityId;
          targetEntityType: MessageTargetEntityType;
          to?: string;
          uploadToThisNode?: boolean;
      }
      • Optional attachments?: MessageAttachment[]
      • Optional body?: string
      • Optional httpAttachments?: boolean

        Upload by server-issued links; with a client-supplied id a repeat re-issues them idempotently.

      • Optional id?: string
      • Optional parentId?: string

        to send reply message

      • targetEntityId: MessageTargetEntityId
      • targetEntityType: MessageTargetEntityType
      • Optional to?: string

        to send a private message

      • Optional uploadToThisNode?: boolean

        Ask the links to the node of this connection; set by the SDK itself once a public address failed.

    Returns Promise<MessageStatus>

  • Returns string

  • Sign up for new users

    Works in a separate connection

    Parameters

    • options: {
          email: string;
          password: string;
          timeout?: number;
          url: string;
          username: string;
      }
      • email: string
      • password: string
      • Optional timeout?: number
      • url: string
      • username: string

    Returns Promise<SignUpStatus>

  • Returns State

  • Unmute channel

    SfuSpaceChannel.muteSettings wil be null - that means the channel is not muted.

    Returns ChannelUnmuted, and other connected devices will also receive this event for synchronization.

    Parameters

    • options: {
          channelId: string;
          spaceId: string;
      }
      • channelId: string
      • spaceId: string

    Returns Promise<ChannelUnmuted>

  • Unmute chat

    UserSpecificChatInfo.muteSettings wil be null - that means the chat is not muted.

    Returns ChatUnmuted, and other connected devices will also receive this event for synchronization.

    Parameters

    • options: {
          id: string;
      }
      • id: string

    Returns Promise<ChatUnmuted>

  • Unmute space

    SfuSpace.muteSettings wil be null - that means the space is not muted.

    Returns SpaceUnmuted, and other connected devices will also receive this event for synchronization.

    Parameters

    • options: {
          spaceId: string;
      }
      • spaceId: string

    Returns Promise<SpaceUnmuted>

  • Unmute thread

    SfuSpaceThread.muteSettings wil be null - that means the thread is not muted.

    Returns ThreadUnmuted, and other connected devices will also receive this event for synchronization.

    Parameters

    • options: {
          channelId: string;
          spaceId: string;
          threadId: string;
      }
      • channelId: string
      • spaceId: string
      • threadId: string

    Returns Promise<ThreadUnmuted>

  • Parameters

    • options: {
          disable?: boolean;
          icon?: File;
          remove?: boolean;
      }
      • Optional disable?: boolean
      • Optional icon?: File
      • Optional remove?: boolean

    Returns Promise<string>

  • Parameters

    • options: {
          disable?: boolean;
          name?: string;
          remove?: boolean;
          size?: number;
      }
      • Optional disable?: boolean
      • Optional name?: string
      • Optional remove?: boolean
      • Optional size?: number

    Returns Promise<string>

  • Update calendar event

    Parameters

    • event: {
          accessCode?: string;
          allowJoinAtAnyTime: boolean;
          description: string;
          end: number;
          id: string;
          ownerVideo: boolean;
          participantVideo: boolean;
          recurring: boolean;
          start: number;
          title: string;
          useLocalAutoRecord: boolean;
          useMuteAudioOnJoin: boolean;
          usePMI: boolean;
          waitingRoom: boolean;
      }
      • Optional accessCode?: string
      • allowJoinAtAnyTime: boolean
      • description: string
      • end: number
      • id: string
      • ownerVideo: boolean
      • participantVideo: boolean
      • recurring: boolean
      • start: number
      • title: string
      • useLocalAutoRecord: boolean
      • useMuteAudioOnJoin: boolean
      • usePMI: boolean

        if true then user PMI settings will be updated and user will receive SfuEvent.UPDATE_USER_PMI_SETTINGS with UserPmiSettings

      • waitingRoom: boolean

    Returns Promise<CalendarEvent>

  • Parameters

    • chat: {
          allowedToAddExternalUser?: boolean;
          channelSendPolicy?: ChannelSendPolicy;
          id: string;
          sendPermissionList?: string[];
          type?: ChatType;
      }
      • Optional allowedToAddExternalUser?: boolean
      • Optional channelSendPolicy?: ChannelSendPolicy
      • id: string
      • Optional sendPermissionList?: string[]
      • Optional type?: ChatType

    Returns Promise<UserSpecificChatInfo>

    Deprecated

  • Update chat icon

    Used to update direct chat icon.

    Chat members will receive ChatIconUpdated with ChatIconUpdated.icon as download url.

    Returns download url or null if removed.

    Parameters

    • options: {
          icon?: File;
          id: string;
          remove?: boolean;
      }
      • Optional icon?: File
      • id: string
      • Optional remove?: boolean

    Returns Promise<string>

  • Parameters

    • options: {
          id: string;
          name?: string;
          remove?: boolean;
          size?: number;
      }
      • id: string
      • Optional name?: string
      • Optional remove?: boolean
      • Optional size?: number

    Returns Promise<string>

  • Parameters

    • options: {
          cert?: string;
          domain?: string;
          key?: string;
          remove?: boolean;
      }
      • Optional cert?: string
      • Optional domain?: string
      • Optional key?: string
      • Optional remove?: boolean

    Returns Promise<void>

  • Delete space category

    For space owner/category creator/user that has permission to manage categories

    Space members will receive SpaceEvent.SPACE_CATEGORY_UPDATED with SpaceCategoryUpdated

    Parameters

    • options: {
          categoryId: string;
          name: string;
          spaceId: string;
      }
      • categoryId: string
      • name: string
      • spaceId: string

    Returns Promise<void>

  • Update space icon

    Used to update space icon.

    Space members will receive SpaceOverviewUpdated with SpaceOverviewUpdated.icon as download url.

    Returns download url or null if removed.

    Parameters

    • options: {
          icon?: File;
          id: string;
          remove?: boolean;
      }
      • Optional icon?: File
      • id: string
      • Optional remove?: boolean

    Returns Promise<string>

  • Parameters

    • options: {
          id: string;
          name?: string;
          remove?: boolean;
          size?: number;
      }
      • id: string
      • Optional name?: string
      • Optional remove?: boolean
      • Optional size?: number

    Returns Promise<string>

  • Update nickname in the space Updates a user's nickname in the space.

    A custom nickname, if set, takes precedence over the user's global nickname. If no custom nickname is provided (or an empty string is passed), the user's global nickname must be displayed.

    To remove a previously set the custom nickname and revert to the global one, pass an empty string.

    Parameters

    • options: {
          nickname: string;
          spaceId: string;
          userId?: string;
      }
      • nickname: string
      • spaceId: string
      • Optional userId?: string

        Optional. The ID of the user whose nickname is being updated. If this field is omitted or set to the caller's own ID, the caller's nickname is updated. The space owner can update anyone's nickname by specifying user ID. If a non-owner attempts to update another user's nickname, a SpaceError.UPDATE_NICKNAME_ACCESS_RIGHTS_ERROR is thrown. All space members receive a SpaceEvent.USER_SPACE_NICKNAME_UPDATED event with a UserSpaceNicknameUpdated payload when the nickname is updated.

    Returns Promise<UserSpaceNicknameUpdated>

  • Update space overview

    Space members will receive SpaceEvent.SPACE_OVERVIEW_UPDATED with SpaceOverviewUpdated

    Parameters

    • space: {
          id: string;
          name: string;
      }
      • id: string
      • name: string

    Returns Promise<void>

  • Update space role

    For space owner/user that has permission to manage roles

    Space members will receive SpaceEvent.SPACE_ROLE_UPDATED with SpaceRoleUpdated

    On the client side, a new role must be added to the participants listed in the SpaceRoleUpdated.membersForAddRole and must be removed from participants listed in the SpaceRoleUpdated.membersForDeleteRole

    Participants from whom this role will be removed will receive SpaceEvent.SPACE_CHANNEL_DELETED with SpaceChannelDeleted for each channel they were part of because of this role.

    Participants who are assigned this role will receive SpaceEvent.NEW_SPACE_CHANNEL with NewSpaceChannelEvent for each channel that has this role in its access rights.

    Participants who had the role before the update and still have it afterward will receive SpaceEvent.SPACE_CHANNEL_UPDATED with SpaceChannelUpdated for each channel that has this role in its access rights.

    Parameters

    • role: {
          color: string;
          members: string[];
          name: string;
          permissions: string[];
          roleId: string;
          spaceId: string;
      }
      • color: string
      • members: string[]
      • name: string
      • permissions: string[]
      • roleId: string
      • spaceId: string

    Returns Promise<SpaceRoleUpdated>

  • Update space thread

    For space owner/thread creator

    Thread members will receive SpaceEvent.SPACE_THREAD_UPDATED with SpaceThreadUpdated

    Parameters

    • options: {
          channelId: string;
          name: string;
          spaceId: string;
          threadId: string;
      }
      • channelId: string
      • name: string
      • spaceId: string
      • threadId: string

    Returns Promise<void>

  • Update user avatar

    Used to update user avatar.

    User will receive UserInfoChangedEvent and ContactUpdated with self. User's contacts will receive ContactUpdated

    Returns download url or null if removed.

    Parameters

    • options: {
          icon?: File;
          remove?: boolean;
      }
      • Optional icon?: File
      • Optional remove?: boolean

    Returns Promise<string>

  • Parameters

    • options: {
          name?: string;
          remove?: boolean;
          size?: number;
      }
      • Optional name?: string
      • Optional remove?: boolean
      • Optional size?: number

    Returns Promise<string>

  • Update user pmi settings

    Parameters

    • settings: {
          accessCode: string;
          allowJoinAtAnyTime: boolean;
          useAccessCode: boolean;
          useLocalAutoRecord: boolean;
          useMuteAudioOnJoin: boolean;
          useOwnerVideo: boolean;
          useParticipantsVideo: boolean;
          useWaitingRoom: boolean;
      }
      • accessCode: string
      • allowJoinAtAnyTime: boolean
      • useAccessCode: boolean
      • useLocalAutoRecord: boolean
      • useMuteAudioOnJoin: boolean
      • useOwnerVideo: boolean
      • useParticipantsVideo: boolean
      • useWaitingRoom: boolean

    Returns Promise<UserPmiSettings>

  • Returns {
        authToken: string;
        email: string;
        nickname: string;
        pmi: string;
        username: string;
        webRTCMetricsServerDescription?: RTCMetricsServerDescription;
    }

    • authToken: string
    • email: string
    • nickname: string
    • pmi: string
    • username: string
    • Optional webRTCMetricsServerDescription?: RTCMetricsServerDescription
  • Parameters

    • data: Uint8Array

    Returns string

  • This method is recommended for using to generate attachment id before sending. Sending and downloading attachments may not work with other generating options.

    Returns string

    string of 36 ASCII characters

  • Parameters

    • str: string

    Returns number[]