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.
| Package | Covers |
|---|---|
wired:core | Math types, ids, errors, permissions, and the conventions every package follows |
wired:script | The lifecycle a script exports, and what it can ask the host about itself |
wired:scene | Documents, prims, and their properties |
wired:input | Pointers, buttons, and input aimed at prims |
wired:event | Messages between scripts |
wired:physics | Raycasts and rigid bodies |
wired:portal | Opening, pairing, and traveling through portals |
wired:agent | The local user's camera and body |
wired:peer | Document authors and holders |
wired:shading | Shader graphs |
wired:prelude | Every 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.
wit/world.withsd/example-wired-input
package example:wired-input;
world guest {
include wired:prelude/script;
}
In Rust, wired-guest generates the bindings for this world.