Build · Scripting API
Overview
The scripting API consists of wired:* WIT (WebAssembly Interface Types)
packages that scripts use to interact with the host. Each package page in this
section is generated directly from the corresponding .wit definition.
| Package | Scope |
|---|---|
wired:core | Math types, IDs, errors, permissions, and shared API conventions |
wired:script | Script lifecycle exports and host permission queries |
wired:scene | Documents, prims, and scene properties |
wired:input | Pointers, buttons, keys, and targeted prim input |
wired:event | Local messaging between scripts |
wired:physics | Raycasts and rigid-body queries |
wired:portal | Opening, pairing, and traveling through portals |
wired:agent | Local user camera, avatar pose, and desktop viewport |
wired:peer | Document authors and physics holders |
wired:perception | Nearby portals, remote agents, profiles, document metadata, and trust levels |
wired:shading | Custom shader graphs |
wired:prelude | Combined world bundling every package above |
The prelude
wired:prelude bundles the entire scripting API into a single world so a
script's world.wit only needs to include wired:prelude/script:
wit/world.withsd/example-wired-input
package example:wired-input;
world guest {
include wired:prelude/script;
}
In Rust, the wired-guest crate generates guest bindings for this world.