Pokémon Showdown persists nearly all user-controllable settings through a single model calledDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/smogon/pokemon-showdown-client/llms.txt
Use this file to discover all available pages before exploring further.
PSPrefs. Unlike the server-side Config object, preferences are stored entirely in the browser’s localStorage under the key showdown_prefs and are shared across every room and server session automatically. Understanding PSPrefs is essential for any client feature that reads user intent — from theming to battle animations to chat formatting.
Architecture: PSPrefs extends PSStreamModel
PSPrefs is defined in play.pokemonshowdown.com/src/client-main.ts and inherits from PSStreamModel<string | null> (defined in client-core.ts). The stream model pattern means:
- Every call to
PS.prefs.set(key, value)internally callsthis.update(key), which broadcasts the changed key to all active subscribers. - Subscribers that attach after the initial load will receive any buffered updates from the backlog before the backlog is cleared.
- Passing
nullas the value toset()resets the preference to its compiled-in default.
PS object as PS.prefs.
Storage Engine
On startup, the constructor checks forwindow.localStorage. If available, it reads and parses showdown_prefs (a JSON blob) and calls load(). The storageEngine field reflects what was found:
| Value | Meaning |
|---|---|
'localStorage' | Standard browser localStorage is available and in use |
'iframeLocalStorage' | Fallback for environments where direct localStorage is blocked |
'' | No storage available; preferences exist only in memory for the current session |
Complete Preference Reference
Theme & Display
theme — 'light' | 'dark' | 'system' (default: 'light')
theme — 'light' | 'dark' | 'system' (default: 'light')
'system' reads the OS preference via window.matchMedia('(prefers-color-scheme: dark)'). If the browser does not support the media query, 'system' is silently demoted to 'light' at load time via fixPrefs().onepanel — boolean | 'vertical' (default: false)
onepanel — boolean | 'vertical' (default: false)
false = two side-by-side panels. true = single panel. 'vertical' = stacked vertical layout, used automatically on narrow screens (under 800 px client width).afd — boolean | 'sprites' (default: undefined)
afd — boolean | 'sprites' (default: undefined)
true enables full AFD text and sprites; 'sprites' enables only AFD sprites; false permanently disables it. undefined (the compiled default) defers to the server’s Config.server.afd flag. Controlled via the /afd chat command.Graphics & Animation
nogif — boolean | null (default: null)
nogif — boolean | null (default: null)
null = auto-detect Chrome 64 and enable the workaround only if needed. true = always disable GIFs. false = always enable GIFs.noanim — boolean | null (default: null)
noanim — boolean | null (default: null)
null = animations enabled. true = disable all animations.bwgfx — boolean | null (default: null)
bwgfx — boolean | null (default: null)
null = use animated sprites. true = use BW sprites.nopastgens — boolean | null (default: null)
nopastgens — boolean | null (default: null)
null = show all generations.Chat Preferences
inchatpm — boolean | null (default: null)
inchatpm — boolean | null (default: null)
noselfhighlight — boolean | null (default: null)
noselfhighlight — boolean | null (default: null)
temporarynotifications — boolean | null (default: null)
temporarynotifications — boolean | null (default: null)
null (the default), desktop notifications remain open until dismissed manually. When true, a setTimeout closes each notification after 5000 ms.leavePopupRoom — boolean | null (default: null)
leavePopupRoom — boolean | null (default: null)
refreshprompt — boolean | null (default: null)
refreshprompt — boolean | null (default: null)
chatformatting — Record<string, boolean>
chatformatting — Record<string, boolean>
nounlink — boolean | null (default: null)
nounlink — boolean | null (default: null)
timestamps — object (default: {})
timestamps — object (default: {})
'minutes', 'seconds', or undefined (hidden).showjoins — object | null (default: null)
showjoins — object | null (default: null)
serverid then roomid. Uses 1 and 0 instead of true/false for compact JSON storage.ignore — object | null (default: null)
ignore — object | null (default: null)
1 to indicate ignored and 0 to un-ignore while keeping the entry. Managed via /ignore, /unignore, and /ignorelist commands.highlights — object | null (default: null)
highlights — object | null (default: null)
/highlight command family.tournaments — 'hide' | 'notify' | null (default: null)
tournaments — 'hide' | 'notify' | null (default: null)
null = notify only when you are in the room. 'notify' = notify for all tournaments. 'hide' = suppress all tournament UI.autojoin — object | string | null (default: null)
autojoin — object | string | null (default: null)
Battle Preferences
ignorenicks — boolean | null (default: null)
ignorenicks — boolean | null (default: null)
ignorespects — boolean | null (default: null)
ignorespects — boolean | null (default: null)
ignoreopp — boolean | null (default: null)
ignoreopp — boolean | null (default: null)
autotimer — boolean | null (default: null)
autotimer — boolean | null (default: null)
autohardcore — boolean | null (default: null)
autohardcore — boolean | null (default: null)
spectatefromstart — boolean | null (default: null)
spectatefromstart — boolean | null (default: null)
rightpanelbattles — boolean | null (default: null)
rightpanelbattles — boolean | null (default: null)
disallowspectators — boolean | null (default: null)
disallowspectators — boolean | null (default: null)
starredformats — object | null (default: null)
starredformats — object | null (default: null)
/star and /unstar commands.showbattles — boolean (default: true)
showbattles — boolean (default: true)
true rather than null.showdebug — boolean | null (default: null)
showdebug — boolean | null (default: null)
/showdebug command; disabled via /hidedebug.Audio Preferences
mute — boolean (default: false)
mute — boolean (default: false)
effectvolume — number (default: 50)
effectvolume — number (default: 50)
musicvolume — number (default: 50)
musicvolume — number (default: 50)
notifvolume — number (default: 50)
notifvolume — number (default: 50)
Account & Server Settings
avatar — string | null (default: null)
avatar — string | null (default: null)
/avatar command.serversettings — object (default: {})
serversettings — object (default: {})
uploadprivacy — boolean (default: false)
uploadprivacy — boolean (default: false)
logtimes — object | null (default: null)
logtimes — object | null (default: null)
Reading a Preference
Access any preference directly as a property on the singletonPS.prefs:
Setting a Preference
UsePS.prefs.set(key, value) to change a preference. This writes to storage, updates the in-memory property, broadcasts the changed key to all subscribers, and saves to localStorage — all in one call.
Subscribing to Preference Changes
BecausePSPrefs extends PSStreamModel<string | null>, you can reactively listen for changes using subscribe(). The listener receives the key of the preference that changed, or null if the entire preference object was reloaded.
subscribeAndRun() to fire the listener immediately with the current state, which is useful for initializing UI components:
localStorage.