UNAVI Docs unavi.xyz
Build · Scripting API

Overview

The scripting API is a set of wired:* WIT (WebAssembly Interface Types) packages, one per area. A script calls into the host through them. The pages in this section are generated from the packages themselves.

PackageCovers
wired:coreMath types, ids, errors, permissions, and the conventions every package follows
wired:scriptThe lifecycle a script exports, and what it can ask the host about itself
wired:sceneDocuments, prims, and their properties
wired:inputPointers, buttons, and input aimed at prims
wired:eventMessages between scripts
wired:physicsRaycasts and rigid bodies
wired:portalOpening, pairing, and traveling through portals
wired:agentThe local user's camera and body
wired:peerDocument authors and holders
wired:shadingShader graphs
wired:preludeEvery interface above, in one world

The prelude

wired:prelude pulls in the whole API with one line. A script's WIT world includes wired:prelude/script and nothing else.

package example:wired-input;

world guest {
  include wired:prelude/script;
}

In Rust, wired-guest generates the bindings for this world.