Skip to content
On this page

SWAGAPIOptions (Interface)

The SWAGAPIOptions interface defines configuration options for initializing the SWAG API in HTML5 games.

Fields

FieldTypeDescription
apiKeystringAPI key for authentication.
debugboolean?Enable debug mode.
gameTitlestring?Override the title of the game.
analyticsobject?Analytics configuration.
analytics.gameIdstring?Game ID for analytics.
leaderboardsobject?Leaderboard configuration.
leaderboards.dailyScoreLevelKeystring?Level key for daily scores.
leaderboardScreentrue | object?Enable or configure leaderboard screen.
splashScreentrue | object?Enable or configure splash screen.
splashScreen.showOnLoadboolean?Show splash screen on load.
splashScreen.containerElementIdstring?Container element ID for splash screen.
splashScreen.isBetaboolean?Mark splash screen as beta.
summaryScreenobject?Summary screen configuration.
summaryScreen.containerElementIdstring?Container element ID for summary screen.
toolbartrue | object?Enable or configure toolbar.
toolbar.containerElementIdstring?Container element ID for toolbar.
toolbar.initialToolbarStateToolbarState?Initial state of the toolbar.
toolbar.titleIconstring?Icon for the toolbar title.
toolbar.titleIconDarkstring?Dark mode icon for the toolbar title.

Usage

Used to configure the SWAG API when initializing in a browser game.