API Reference

Nuxt Module Options

Configure the Nuxt wrapper through the supported public module surface.

@onmax/nuxt-phaser exposes one module key: phaser.

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@onmax/nuxt-phaser'],
  phaser: {
    autoImports: true,
    components: true,
    componentPrefix: 'Phaser',
    clientOnly: true,
    debug: false,
    devtools: false,
    defaults: {
      pixelArt: false,
      transparent: false,
      suspendWhenHidden: true,
      assetsBaseUrl: '/',
    },
  },
})

Options

OptionTypeDefaultMeaning
autoImportsbooleantrueAuto-import shared composables and helpers.
componentsbooleantrueGlobally register the wrapped component set.
componentPrefixstring'Phaser'Prefix for registered component names.
clientOnlybooleantrueWrap NuxtPhaserGame in ClientOnly.
debugbooleanfalseEnable the debug warning path by default.
devtoolsbooleanfalseReserved for future Nuxt devtools integration.
defaults.pixelArtbooleanfalseDefault host pixel-art mode.
defaults.transparentbooleanfalseDefault transparent canvas mode.
defaults.suspendWhenHiddenbooleantruePause rendering when the document is hidden.
defaults.assetsBaseUrlstring'/'Default base URL for usePhaserAssetUrl.

The module does not add a separate runtime abstraction beyond those options. Shared host props and scene code still define the real game behavior.

Copyright © 2026