Skip to content

API Reference

Awaken3D is built from four small TypeScript packages under the @awaken/* scope. This section documents their public types and functions for people who script the engine, embed it, or contribute to it.

Who this is for

Most makers never touch these APIs directly - the Editor, Scripting API, and import pipeline wrap everything you normally need. Read the API Reference when you are:

  • Writing advanced scripts that reach past the ScriptApi surface (querying the ECS World, adding components at runtime).
  • Embedding the runtime in your own page or a custom player.
  • Contributing to the engine - extending components, importers, or the renderer.

If you just want to make a game, start with Core Concepts and the Scripting Overview instead.

The four packages

PackageResponsibilityDepends on
@awaken/coreThe engine foundation: math, the entity–component World (ECS), transforms, scene serialization, and the pure skeletal-animation core. No rendering, no DOM.(nothing)
@awaken/renderThe WebGPU Renderer, render settings and the post-effect stack, cameras, lights, shadows, primitives, materials, and GPU device setup.@awaken/core
@awaken/assetsAsset storage, the shared import IR, every model/engine importer, and the persistence formats (binary .awaken project + shipped scene JSON).@awaken/core, @awaken/render
@awaken/runtimePlay-mode systems: physics (Rapier), the script host, the play/scene lifecycle, input, audio, and in-game UI.@awaken/core, Rapier (WASM)

Dependency direction

The packages form a strict one-way graph - core knows nothing about the others, and nothing depends on the editor app.

Notably, @awaken/runtime does not depend on @awaken/render - the play loop, physics, and scripts run headless (they are unit-tested with no GPU). The editor and player apps wire rendering and runtime together at the top.

Consumed as raw TypeScript

Each package is an ESM workspace ("type": "module") whose entry point is ./src/index.ts - the raw TypeScript source, not a compiled dist/. There is no per-package build step: the editor and player import @awaken/core and friends directly, and the bundler (Vite) type-strips and tree-shakes them as part of the app build. Cross-package references use workspace:*.

This means:

  • The types you see in these pages are exactly what you import - no .d.ts drift.
  • All four packages report version: "0.0.0" in package.json; @awaken/core also exports a VERSION = "0.0.0" constant. Awaken3D is pre-1.0, so treat these APIs as unstable.
  • Everything is exported through the package's index.ts barrel, so import { World, Renderer, AssetStore, Runtime } from "@awaken/…" always works.

In this section

  • @awaken/core - math, entity, component, World, transform, serialize, animation.
  • @awaken/render - Renderer, render settings + effects, camera, light, shadow, material, device.
  • @awaken/assets - AssetStore, the import IR, persistence, quantization, importers.
  • @awaken/runtime - Runtime/System, physics, scripts, play controller, scenes, input, audio, UI, animation.
  • Data Formats & Versions - the three on-the-wire formats and how they relate.
  • Component Reference - every registered component, its fields, types, and defaults.

See also

Awaken — browser-native WebGPU game engine.