API Reference

Composables

Public composables for game lookup, scene lookup, bridge events, input helpers, and low-frequency registry state.

Core lookups

  • usePhaserGame(instanceId?)
  • usePhaserScene(key?)
  • useActivePhaserScene()
  • usePhaserBridge<Events>(instanceId?)

These composables return injected refs when you call them under the game subtree. They can also resolve by instanceId when the component lives outside the subtree.

State and input helpers

  • usePhaserRegistry<T>(sceneKey?)
  • usePhaserResize()
  • usePhaserPointer()
  • usePhaserKeyboard(keys)
  • usePhaserAssetUrl(manifest?, options?)
  • usePhaserObjectRef<T>()

Event helpers

  • useGameEvent(event, handler, instanceId?)
  • useSceneEvent(event, handler, key?)

Scene and bridge helpers

  • definePhaserScene(definition)
  • createPhaserBridge<Events>()
  • defineAssetManifest(manifest)

createPhaserBridge returns a tiny typed emitter with on, once, off, emit, and clear.

Copyright © 2026