Global

Members

# constant clearFileSystemCache

Clears the FileSystemCache instance for the specified user and room. Disposes of the instance and removes it from the cache.

Example
// Clear cache when user leaves room
clearFileSystemCache('user123', 'meeting-room');

# constant getFileSystemCache

Retrieves a FileSystemCache instance for the specified user and room. Creates a new instance if one does not already exist.

Example
const cache = getFileSystemCache({
  userId: 'user123',
  roomName: 'meeting-room',
  isRoomOwner: true,
  client: muzieClient
});

Methods

# abortableSleep(ms, signalopt) → {Promise.<void>}

Sleep that can be aborted via an AbortSignal.

Parameters:
Name Type Attributes Description
ms number

Milliseconds to sleep

signal AbortSignal <optional>

Optional AbortSignal to cancel the sleep

With name 'AbortError' if signal is aborted

DOMException

Resolves when sleep completes, rejects with AbortError if cancelled

Promise.<void>
Example
const controller = new AbortController();

// Cancel after 1 second
setTimeout(() => controller.abort(), 1000);

try {
  await abortableSleep(5000, controller.signal);
  console.log('Sleep completed');
} catch (err) {
  if (err.name === 'AbortError') {
    console.log('Sleep was cancelled');
  }
}

# async fileModified(options)

Notify the server that a file has been modified

Parameters:
Name Type Description
options Object
roomRegion string
token string
fileId string

# async fileUploaded(options)

Notify the server that a file has been uploaded

Parameters:
Name Type Description
options Object
roomName string
roomRegion string
token string
fileName string
location string

# async getModifyUrl(options)

Get a signed URL for uploading and modifying file

Parameters:
Name Type Description
options Object
roomRegion string
token string
fileId string

# getRelayToken() → {Promise.<{token: string, url: string, certHashes: Array.<{algorithm: string, valueHex: string}>, expiresAt: number}>}

Mint a semantic-relay JWT from the signaling server.

Two paths, mirroring the signaling server's /relay-token:

  • Authenticated: pass { roomRegion, roomName, userId, roomToken }. The roomToken proves caller's app identity; the signed userId claim matches what you supplied.
  • Guest: pass { roomRegion, roomName, joinToken, joinUserId, password? }. The signaling server DB-verifies the joinToken matches the room, then issues a relay JWT whose userId is a server-namespaced guest:<uuid> regardless of the supplied joinUserId.

On any non-2xx response or transport failure.

Error
Promise.<{token: string, url: string, certHashes: Array.<{algorithm: string, valueHex: string}>, expiresAt: number}>

# async getUploadUrl(options)

Get a signed URL for uploading a file

Parameters:
Name Type Description
options Object
roomRegion string
token string
fileName string

# sanitizeUploadFilename(name) → {string}

Sanitize an upload filename so it is safe to use in HTTP headers.

Maps common Unicode look-alikes (narrow no-break space, curly quotes, em/en dash, etc.) to their ASCII equivalents, then strips any remaining code point outside ISO-8859-1 (> U+00FF). Preserves accented Latin-1 characters (é, ñ, ü) since they are valid in Content-Disposition headers without encoding.

Parameters:
Name Type Description
name string

The original filename.

A filename safe for ISO-8859-1 header values. Falls back to 'file' if every character had to be stripped.

string

# waitForHostToStartRoom(options) → {Promise.<Object>}

Wait for a room to become active (host has started the meeting).

This is a standalone utility function for client applications that want to implement their own waiting UI/UX without using the Client.joinRoomWithTokenAndWait() method.

Parameters:
Name Type Attributes Default Description
options Object

Configuration options

roomRegion string

The region of the room server

joinToken string

The join token for the room

joinUserId string

The user ID of the joining user

roomToken string

The application room token

password string <optional>

Optional password for the room

timeout number <optional>
300000

Maximum time to wait in milliseconds (default: 5 minutes)

pollingInterval number <optional>
3000

How often to check in milliseconds (default: 3 seconds)

signal AbortSignal <optional>

AbortSignal to cancel the wait

onStatusChange function <optional>

Callback fired on status changes: (status, detail) => void

  • status: 'waiting' | 'active' | 'timeout' | 'cancelled' | 'error'
  • detail: { roomName, elapsedTime, timeout, error? }

With name 'AbortError' if cancelled

DOMException

If timeout reached or invalid token

Error

Room info object with roomName, active, and optional alias properties

Promise.<Object>
Example
// Basic usage with AbortController
const abortController = new AbortController();

// Cancel button
cancelBtn.onclick = () => abortController.abort();

try {
  const roomInfo = await waitForHostToStartRoom({
    roomRegion: 'us-east-1',
    joinToken: 'abc123',
    joinUserId: 'user1',
    roomToken: appToken,
    timeout: 300000,
    signal: abortController.signal,
    onStatusChange: (status, detail) => {
      if (status === 'waiting') {
        showUI(`Waiting for host... (${detail.roomName})`);
      } else if (status === 'active') {
        showUI('Room is ready!');
      }
    }
  });

  // Room is now active, proceed to join
  const room = await client.joinRoomWithToken({ ... });
} catch (err) {
  if (err.name === 'AbortError') {
    console.log('User cancelled');
  } else {
    console.error('Error:', err.message);
  }
}

Type Definitions

Object

# AudioConstraints

Audio constraints for getUserMedia

Properties:
Name Type Attributes Default Description
echoCancellation boolean <optional>
true

Enable echo cancellation

noiseSuppression boolean <optional>
true

Enable noise suppression

autoGainControl boolean <optional>
true

Enable automatic gain control

deviceId string <optional>

Specific device ID to use

Object

# ClientOptions

Client constructor options

Properties:
Name Type Attributes Default Description
roomToken string

Room token generated by server via /room-token endpoint (required)

enableBandwidthMonitoring boolean <optional>
false

Enable bandwidth monitoring

Object

# ConnectTransportsOptions

Options for connecting media transports

Properties:
Name Type Attributes Default Description
enableAudioInputMonitor boolean <optional>
false

Enable audio level monitoring for visualization

enableAudioMerge boolean <optional>
false

Enable audio stream merging

enableAudioGainControl boolean <optional>
false

Enable audio gain control

Object

# CreateRoomOptions

Options for creating a room

Properties:
Name Type Attributes Default Description
inactivityTimeout number <optional>
60

Time in seconds before closing room if owner is absent

timeoutOnEmptyRoomOnly boolean <optional>
false

Only timeout if room is empty

requireWaitingRoom boolean <optional>
false

Require waiting room approval

Object

# FileMetadata

Properties:
Name Type Attributes Description
fileId string

Unique identifier for the file

userId string

Owner of the file

roomName string <optional>

Room associated with the file

fileName string

Name of the file (without path)

timestamp string

Creation timestamp

modified string

Modified timestamp

s3Path string <optional>

Storage path in S3

location string

Path location in the virtual file system

isFolder boolean

Whether this item is a folder

sharing Array.<Object> <optional>

Array of sharing objects with userId, roomName, and permissions

type string <optional>

File extension

resourceType string <optional>

Category of the resource

contentType string <optional>

MIME type

size number <optional>

File size in bytes

modified string <optional>

Last modified timestamp

Object

# RecordingOptions

Options for starting a recording

Properties:
Name Type Attributes Default Description
autoCompose boolean <optional>
false

Automatically compose grid video when recording stops

transcribe boolean <optional>
false

Enable live transcription during recording

postMeetingSummary boolean <optional>
false

Generate AI summary after meeting ends (requires transcribe)

useContext boolean <optional>
false

Push transcriptions to AI for query access (requires transcribe)

legacy boolean <optional>
false

Use legacy recording system

autoTranscribe boolean <optional>
false

Enable auto-transcription

Object

# Room

Properties:
Name Type Description
created string

Created date/time (ISO timestamp)

id string

Unique room identifier

name string

The name of the room

owner string

The userId of the room owner

users Array.<string>

Array of current userIds in the room

Object

# StreamingOptions

Options for starting streaming

Properties:
Name Type Attributes Default Description
create_mp4 boolean <optional>
false

Create MP4 file from stream. Note: Not supported when using rtmpUrl.

mode 'single' | 'multi' <optional>
'single'

Streaming mode: 'single' focuses on one participant, 'multi' shows multiple participants in a grid.

rtmpUrl string <optional>

Custom RTMP URL for streaming to external platforms (e.g., YouTube, Twitch). If not provided, uses Hiyve cloud infrastructure.

Object

# TreeNode

Properties:
Name Type Attributes Description
id string

Node identifier

name string

Display name

path string

Full path to the node

type string

Either "folder" or "file"

children Object.<string, TreeNode> <optional>

Child nodes (for folders)

fileExtension string <optional>

File extension (for files)

resourceType string <optional>

Resource category (for files)

contentType string <optional>

MIME type (for files)

size number <optional>

File size in bytes (for files)

modified string <optional>

Last modified timestamp (for files)

userId string <optional>

Owner ID (for files)

sharing Array.<Object> <optional>

Array of sharing objects with userId, roomName, and permissions (for files)

synthetic boolean <optional>

Whether this node was generated to fill a path gap

Object

# VideoConstraints

Video constraints for getUserMedia

Properties:
Name Type Attributes Description
deviceId string <optional>

Specific device ID to use

width Object <optional>

Width constraints {ideal, min, max}

height Object <optional>

Height constraints {ideal, min, max}

frameRate Object <optional>

Frame rate constraints {ideal, min, max}

facingMode string <optional>

Camera facing mode: 'user' or 'environment'