API Reference

Complete props reference for the GamePlayer component.

Core Configuration

PropTypeRequiredDescription
romIdstringYesUnique identifier for this ROM (used for saving)
romUrlstringYesURL to the ROM file
systemstringYesConsole key (NES, SNES, GBA, PS1, etc.)
titlestringYesDisplay name for the game
romFileNamestringNoOriginal filename (important for Arcade/MAME)
corestringNoOverride automatic core selection (e.g., 'gpsp' vs 'mgba')
biosUrlstring | objectNoBIOS URL or config with location option
shaderstringNoInitial shader (e.g., 'crt/crt-lottes')
systemColorstringNoHex color for UI accents (e.g., '#FF3333')

Save System

PropTypeDescription
onSaveState(slot: number, blob: Blob, screenshot?: string) => PromiseSave state to your backend
onLoadState(slot: number) => Promise<Blob | null>Load state from your backend
onAutoSave(blob: Blob, screenshot?: string) => PromisePeriodic auto-save callback
onGetSaveSlots() => Promise<SaveSlot[]>Fetch available save slots
onDeleteSaveState(slot: number) => PromiseDelete a save slot
autoSaveIntervalnumberAuto-save interval in ms (default: 60000)
initialSaveStateBlobPre-load a save state on boot
maxSlotsnumberLimit available slots (for tiered access)
currentTierstringUser tier label (shown in upgrade prompt)
onUpgrade() => voidCalled when user clicks upgrade button

Lifecycle Events

PropTypeDescription
onReady() => voidEmulator core fully loaded
onError(error: Error) => voidFatal error (WASM crash, etc.)
onExit() => voidUser clicked Exit button
onSessionStart() => voidGame loop started
onSessionEnd() => voidGame session ended
onScreenshotCaptured(image: string | Blob) => voidScreenshot taken by user
onShaderChange(shader: string, requiresRestart: boolean) => voidUser changed shader preset

RetroAchievements

PropTypeDescription
retroAchievementsConfig{ username, token, hardcore? }Enable RA integration
raUserRACredentials | nullLogged-in user data
raGameRAGameExtended | nullCurrent game RA data
raAchievementsRAAchievement[]Achievement list
raUnlockedAchievementsSet<number>IDs of unlocked achievements
raIsLoadingbooleanRA data loading state
raErrorstring | nullRA error message
onRALogin(user, pass) => Promise<boolean>Login handler
onRALogout() => voidLogout handler
onRAHardcoreChange(enabled: boolean) => voidHardcore toggle handler

Cheats

PropTypeDescription
cheatsCheat[]Available cheats: { id, code, description }
onToggleCheat(id: number, active: boolean) => voidCalled when user toggles a cheat

BIOS Selection

PropTypeDescription
availableBios{ id, name, description? }[]List of available BIOS options
currentBiosIdstringCurrently selected BIOS ID
onSelectBios(biosId: string) => voidBIOS selection handler

Styling

PropTypeDescription
classNamestringAdditional CSS classes for container
styleReact.CSSPropertiesInline styles for container

Internationalization

PropTypeDescription
initialLanguage'en' | 'es' | 'fr'Initial language (default: 'en')
translationsRecursivePartial<KoinTranslations>Partial translation overrides for custom text

Exported i18n Utilities

en, es, fr — Built-in translation objects

KoinTranslations — TypeScript interface for translations

useKoinTranslation() — React hook to access translations

KoinI18nProvider — Context provider for custom components