Portal Types
SnapTarget
The list of possible snap targets.
"ground"
means that the dragged bot should snap to the ground plane. This option is overriden by "grid"."grid"
means that the dragged bot should snap to grid tiles."face"
means that the dragged bot should snap to other bot faces."bots"
means that the dragged bot will snap to other bots.
SnapPoint
SnapAxis
Defines an interface that represents a snap axis. That is, a ray in 3D space with an associated snap distance.
Members
direction Vector3
The 3D direction that the axis ray travels along.
interface Vector3 {
x: number;
y: number;
z: number;
}distance number
The distance from the ray line that the snap point should take effect at.
origin Vector3
The 3D position that the ray starts at.
interface Vector3 {
x: number;
y: number;
z: number;
}
AddDropSnapAction
Defines a base interface for actions that can add drop snap points.
Members
botId? string
The ID of the bot that, when it is a drop target, the snap points should be enabled. If null, then the targets apply globally during the drag operation.
type string
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AddDropSnapPointsAction
An event that is used to add some snap points for a drag operation.
Members
botId? string
The ID of the bot that, when it is a drop target, the snap points should be enabled. If null, then the targets apply globally during the drag operation.
targets SnapTarget[]
The list of snap targets that should be used.
type "add_drop_snap_targets"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AnalyticsRecordEventAction
An action that is used to record an event for analytics.
Members
metadata any
The metadata for the event.
name string
The name of the event.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "analytics_record_event"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
BufferFormAddressGLTFAction
Defines an event that requests the pre-caching of a GLTF mesh.
Members
address string
The address that should be buffered.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "buffer_form_address_gltf"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
CalculateRayFromCameraAction
Defines an event that calculates a ray for the given portal from the given viewport coordinates.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
portal CameraPortal
The portal that the ray should be calculated for.
taskId (string | number)
The ID of the async task.
type "calculate_camera_ray"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
CalculateScreenCoordinatesFromViewportCoordinatesAction
Defines an event that calculates the 2D screen coordinates from the given 2D viewport coordinates.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
portal CameraPortal
The portal that the ray should be calculated for.
taskId (string | number)
The ID of the async task.
type "calculate_screen_coordinates_from_viewport_coordinates"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
CalculateViewportCoordinatesFromPositionAction
Defines an event that calculates the 2D viewport coordinates from the given 3D position.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
portal CameraPortal
The portal that the ray should be calculated for.
taskId (string | number)
The ID of the async task.
type "calculate_viewport_coordinates_from_position"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
CalculateViewportCoordinatesFromScreenCoordinatesAction
Defines an event that calculates the 2D viewport coordinates from the given 2D screen coordinates.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
portal CameraPortal
The portal that the ray should be calculated for.
taskId (string | number)
The ID of the async task.
type "calculate_viewport_coordinates_from_screen_coordinates"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
CameraPortal
The portals that contain a camera that can be raycasted from.
A CameraPortal can be one of the following values:
"grid"
"miniGrid"
"map"
"miniMap"
ConfigureWakeLockAction
An event that is used to enable/disable wake lock.
Members
enabled boolean
Whether the wake lock should be enabled.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "configure_wake_lock"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
DefineGlobalBotAction
Defines an event that defines a global variable that points to the given bot.
Members
botId string
The ID of the bot that should be defined.
name string
The name of the global variable that should reference the bot.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "define_global_bot"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
GetAverageFrameRateAction
Defines an event that retrieves the current average frame rate.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "get_average_frame_rate"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
GetRoomOptionsResult
The possible results for a "get room options" request.
A GetRoomOptionsResult can be one of the following values:
GetRoomRemoteOptionsFailure
Defines an interface that represents a failed "get room remote options" request.
Members
errorCode string
The error code that describes why the request failed.
errorMessage string
The error message that describes why the request failed.
remoteId string
The ID of the remote that the options were attempted to be retrieved from.
roomName string
The name of the room that the options were attempted to be retrieved from.
success false
GetRoomRemoteOptionsResult
The possible results for a "get room remote options" request.
A GetRoomRemoteOptionsResult can be one of the following values:
GetRoomRemoteOptionsSuccess
Defines an interface that represents a successful "get room remote options" request.
Members
options RoomRemoteOptions
The options that were retrieved.
remoteId string
The ID of the remote that the options were retrieved from.
roomName string
The name of the room that the options were retrieved from.
success true
GetRoomTrackOptionsFailure
Defines an interface that represents a failed "get room track options" request.
Members
address string
The address of the track that the options were attempted to be retrieved from.
errorCode string
The error code that describes why the request failed.
errorMessage string
The error message that describes why the request failed.
roomName string
The name of the room that the options were attempted to be retrieved from.
success false
GetRoomTrackOptionsResult
The possible results for a "get room track options" request.
A GetRoomTrackOptionsResult can be one of the following values:
GetRoomTrackOptionsSuccess
Defines an interface that represents a successful "get room track options" request.
Members
address string
The address of the track that the options were retrieved from.
options RoomTrackOptions
The options that were retrieved.
roomName string
The name of the room that the options were retrieved from.
success true
GetWakeLockConfigurationAction
An event that is used to retrieve the current wake lock configuration.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "get_wake_lock_configuration"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
HideTooltipAction
An event that is used to hide tooltip messages.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
tooltipIds number[]
The IDs of the tooltips that should be hidden. If null, then all tooltips will be hidden.
type "hide_tooltip"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
HtmlAppMethodCallAction
Defines an event that represents a method call that was dispatched from HTML in a portal.
Members
appId string
The ID of the app.
args any[]
The arguments that the method was called with.
methodName string
The name of the method.
nodeId string
The ID of the node that the method was called on.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "html_app_method_call"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
JoinRoomResult
The possible results for a "join room" request.
A JoinRoomResult can be one of the following values:
LeaveRoomResult
The possible results for a "leave room" request.
A LeaveRoomResult can be one of the following values:
OpenCircleWipeAction
An event that is used to show or hide the circle wipe.
Members
open boolean
Whether the circle wipe should be visible.
options OpenCircleWipeOptions
The options for the circle wipe.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "show_circle_wipe"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
RaycastFromCameraAction
Defines an event that performs a raycast from the camera in the given portal.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
portal CameraPortal
The portal that the raycast should be performed in.
taskId (string | number)
The ID of the async task.
type "raycast_from_camera"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
RaycastInPortalAction
Defines an event that performs a raycast for the given ray in the given portal.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
portal CameraPortal
The portal that the raycast should be performed in.
taskId (string | number)
The ID of the async task.
type "raycast_in_portal"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
RaycastResult
Defines an interface that represents the result of a raycast operation.
Members
botIntersections BotIntersection[]
The list of intersections.
ray RaycastRay
The ray that the operation sent.
RegisterCustomAppAction
Defines an event that registers a custom portal.
Members
appId string
The ID of the app.
botId string
The ID of the bot that should be used to configure the portal.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "register_custom_app"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
RegisterHtmlAppAction
Defines an event that requests that a HTML app be created.
Members
appId string
The ID of the app.
instanceId string
The ID of the app instance. Used to distinguish between multiple instances of the same app.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "register_html_app"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
RoomJoinOptions
Defines a set of options that the local usr can specify when joining a room.
Members
adaptiveStream (boolean | object)
Whether to enable adaptive streaming. Alternatively accepts an object with properties from this page: https://docs.livekit.io/client-sdk-js/modules.html#AdaptiveStreamSettings
audio boolean
Whether to stream audio.
audioCaptureDefaults object
The defaults that should be used for recording audio. Should be an object. See https://docs.livekit.io/client-sdk-js/interfaces/AudioCaptureOptions.html for a full list of properties.
dynacast boolean
Whether to enable dynacast. See https://docs.livekit.io/client-sdk-js/interfaces/RoomOptions.html#dynacast for more info.
publishDefaults object
The defaults that should be used for uploading audio/video content. See https://docs.livekit.io/client-sdk-js/interfaces/TrackPublishDefaults.html for a full list of properties.
screen boolean
Whether to stream the screen.
video boolean
Whether to stream video.
videoCaptureDefaults object
The defaults that should be used for recording video. Should be an object. See https://docs.livekit.io/client-sdk-js/interfaces/VideoCaptureOptions.html for a full list of properties.
RoomRemoteOptions
Defines an interface that contains options for a remote room user.
Members
audio boolean
Whether the remote user has enabled their microphone audio.
audioLevel number
The audio level that is being transmitted by the user. Between 0 and 1 with 1 being the loudest and 0 being the quietest.
connectionQuality ("unknown" | "excellent" | "good" | "poor" | "lost")
Gets the connection quality of the remote user.
screen boolean
Whether the remote user has enabled their screen share.
video boolean
Whether the remote user has enabled their camera video.
SerializableMutationRecord
Defines a mutation record that can be serialized and sent over a web worker pipe.
Members
addedNodes NodeReference[]
attributeName string
attributeNamespace string
listenerDelta? number
The number of event listeners that were added (positive number) or removed (negative number).
listenerName? string
The name of the event listener.
nextSibling NodeReference
oldValue string
previousSibling NodeReference
removedNodes NodeReference[]
target NodeReference
type ("attributes" | "characterData" | "childList" | "event_listener")
SetRoomOptionsResult
The possible results for a "set room options" request.
A SetRoomOptionsResult can be one of the following values:
SetRoomTrackOptions
Defines an interface that represents the set of options that can be set on a room video/audio track.
Members
muted? boolean
Whether to mute the track locally. This will prevent the track from streaming from the server to this device.
videoQuality? TrackVideoQuality
The video quality that the track should stream at.
SetRoomTrackOptionsFailure
Defines an interface that represents a failed "set room track options" request.
Members
address string
The address of the track that the options were attempted to be set on.
errorCode string
The error code that describes why the request failed.
errorMessage string
The error message that describes why the request failed.
roomName string
The name of the room that the options were attempted to be set on.
success false
SetRoomTrackOptionsResult
The possible results for a "set room track options" request.
A SetRoomTrackOptionsResult can be one of the following values:
SetRoomTrackOptionsSuccess
ShowToastAction
An event that is used to show a toast message to the user.
Members
duration number
The duration for the message in miliseconds.
message (string | number | boolean | object | any[])
The message that should be shown.
type "show_toast"
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
ShowTooltipAction
An event that is used to show a tooltip message to the user.
Members
duration number
The number of miliseconds that the tip should be shown for.
message (string | number | boolean | object | any[])
The message that should be shown.
pixelX number
The X coodinate of the pixel position that the tip should be shown at. If null, then the current pointer position should be used or the center of the screen if on mobile.
pixelY number
The Y coordinate of the pixel position that the tip should be shown at. If null, then the current pointer position should be used or the center of the screen if on mobile.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "show_tooltip"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
SnapGrid
Defines an interface that represents a snap grid. That is, a 2D plane that is segmented into discrete sections.
Members
bounds? object
The bounds that the snap grid has. If not specified, then default bounds are used.
portalBotId? string
The ID of the bot that defines the portal that this grid should use. If not specifed, then the config bot is used.
portalTag? string
The tag that contains the portal dimension. If a portalBotId is specified, then this defaults to formAddress. If a portalBotId is not specified, then this defaults to gridPortal.
position? object
The 3D position of the grid. If not specified, then 0,0,0 is used.
priority? number
The priority that the snap grid has. Higher numbers mean higher priority.
rotation? object
The 3D rotation of the grid. If not specified, then the identity rotation is used.
showGrid? boolean
Whether to visualize the grid when dragging bots around. Defaults to false.
type? ("grid" | "sphere")
The type of grid that this snap grid should be. Defaults to the type of grid that the portal bot uses.
- "grid" indicates that the snap target should be a flat grid.
- "sphere" indicates that the snap target should be a sphere.
SnapGridTarget
Defines an interface that contains options for a snap grid for
os.addDropGrid(...targets)
.Members
bounds? object
The bounds of the grid. Defaults to 10 x 10.
portalTag? string
The tag that the portal uses to determine which dimension to show. Defaults to formAddress.
position? object
The 3D position that the grid should appear at.
priority? number
The priority that this grid should be evaluated in over other grids. Higher priorities will be evaluated before lower priorities.
rotation? object
The 3D rotation that the grid should appear at.
showGrid? boolean
Whether to visualize the grid while a bot is being dragged. Defaults to false.
type? ("grid" | "sphere")
The type of grid that this snap grid should be. Defaults to the type of grid that the portal bot uses.
- "grid" indicates that the snap target should be a flat grid.
- "sphere" indicates that the snap target should be a sphere.
UnregisterCustomAppAction
Defines an event that unregisters a custom app.
Members
appId string
The ID of the app.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "unregister_custom_app"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
UnregisterHtmlAppAction
Defines an event that requests that a HTML app be deleted.
Members
appId string
The ID of the app.
instanceId string
The ID of the app instance. Used to distinguish between multiple instances of the same app.
type "unregister_html_app"
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
UpdateHtmlAppAction
Defines an event that notifies that a custom app has recieved a HTML update.
Members
[UNMAPPABLE] true
appId string
The ID of the app.
type "update_html_app"
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
updates SerializableMutationRecord[]
The array of mutation rectords that represent the changes to the HTML.