Web SDK reference¶
The web SDK, sona-renderer.js 1.1.0, is one ES module: SonaRenderer draws live avatars in your own canvas with
WebGPU, or WebGL2 where WebGPU is missing. This reference is generated from the declarations that ship with it,
sona-renderer.d.ts, and the packages' index.d.ts. Where an example draws something, the web SDK draws it on the
page beside the code, with the same values.
| Part | What it covers |
|---|---|
| SonaRenderer | SonaRenderer is what the module exports: it makes scenes on your canvas, connections for engines that draw for themselves, and headless renderers, and holds the custom-item helpers. |
| SonaScene | A scene is many avatars in one canvas and one WebGPU or WebGL2 context, from SonaRenderer.create(). |
| SonaAvatar | One avatar in a scene, from scene.add(). |
| SonaCamera | The scene's camera, scene.camera: the console's framings, an orbit, a free camera, eased moves and pointer controls. |
| Options and results | The options create() and add() take, and what the scene reports. |
| Errors | Every error the SDK raises is a SonaError: code says what went wrong, fix what to do. |
| Custom items | Items of your own (.sonaitem files, custom items), per scene as scene.items, worn by id with avatar.wear(). |
| Connection and headless | SonaRenderer.connect() gives avatars as .glb files with their clips, for engines that draw them themselves; SonaRenderer.headless() makes pictures with no canvas on the page. |
| The avatar editor element | <sona-avatar-editor>, the player-facing avatar creator as one element. |
| Face tracking | SonaTrack: webcam face tracking, MediaPipe's face landmarker in, an avatar's face and head out. |
| Packages | @360sona/three, @360sona/babylon and @360sona/react, on the same connection and scenes. |
The reference by area¶
- SonaRenderer
- SonaScene
- SonaAvatar
- SonaCamera
- Options and results
- Errors
- Custom items
- Connection and headless
- The avatar editor element
- Face tracking
- Packages
This page as Markdown · All the docs as one file (llms-full.txt)