API Overview
This page helps you choose the right GWEN API surface quickly.
Core helper APIs (define*)
Use these to declare your game architecture:
defineComponentdefineSystemdefineScenedefinePrefabdefineUIdefineConfig
See Helpers.
Runtime Engine API (api)
Inside systems/scenes/ui/prefabs, you work with api:
- entity lifecycle (
createEntity,destroyEntity) - components (
addComponent,getComponent,query) - plugins/services (
api.services.get('...')) - scenes (
api.scene?.load(...))
See Engine API.
Types and typing model
GWEN ships strongly typed definitions across helpers and runtime.
- schema types (
Types.f32,Types.i32, etc.) - helper inference (
InferComponent) - generated global types after
gwen prepare
See Types.
Plugin extension surfaces
Plugins can expose:
- services (consumed with
api.services.get(...)) - hook contracts
- UI/prefab/scene extension typing metadata
See Plugin Hooks Guide and Plugins.
Typical end-user flow
- Scaffold with
npx @djodjonx/create-gwen-app my-game - Configure plugins in
gwen.config.ts - Build gameplay with
defineComponent+defineSystem - Compose in scenes/prefabs/UI
- Run
pnpm dev/pnpm build