The client for Pokémon Showdown
Go to file
Guangcong Luo 5971e5151a
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Preact minor update batch 11
Minor
- Unhide right panel when choosing "Two panels" layout option
- Refactor focusing
  - Correctly focus next room when closing currently active room
  - Correctly focus room when joining new room
- Use strict mode on all compiled files
- Fix router when started on `/` (it previously required starting on a
  non-empty room ID, which wasn't noticeable back when the URL needed
  to be `/preactalpha`)
- Update teambuilder sidebar CSS, to make it easier to add regular text
  - This is mainly for the "Tournaments" button in the main menu,
    which shares the CSS
- Fix new tournament elim tree text in Safari
- Update new tournament elim tree highlighted links to reliably
  link every still-playing game
- Remove latest gen from format name displays everywhere
  - Previously, they would only be removed from the format dropdown,
    but now they're also gone from the Ladder tab, battle tabs, and
    `/rank`
- Support async d3 loading
  - This allows chatrooms to be loaded way before all our dependencies
    are fully downloaded
- Remove "[Gen 9]" from format names everywhere (previously it was only
  removed from the format dropdown)
  - Also add "[Gen 6]" to unlabeled formats in `/rank` (Gen 6 was the
    last time we didn't have format generation as part of format names)

Trivial
- Stricter JSX linting
  - (unfortunately, most of the JSX style enforcement I actually want
    isn't possible in @stylistic)
- Make room.subscribeTo's second parameter optional
- Rearrange and comment loading order
- Rename hiddenInit -> focusNextUpdate (clarity)
- Rename PSMain -> PSView (clarity)
- Fix button spacing in Change Password
- Add `touch-action: manipulation` to <a> tags
- Refactor `nodeSize` in elim tour trees
2025-04-18 05:47:58 +00:00
.github/workflows Update GitHub Actions config 2025-04-12 18:14:30 -07:00
.vscode Preact: Make client usable again 2025-04-03 18:56:51 -07:00
build-tools Teams: Add a back button to the search/view pages 2025-04-12 01:31:28 -05:00
caches Update to ESLint 9 (#2326) 2025-02-25 20:05:32 -08:00
config Add static website for viewing server-side teams 2025-04-09 19:36:58 -05:00
desktop Properly set the encoding to UTF-8 on all HTML pages (#1467) 2020-02-23 00:13:56 -08:00
graphics-src Add PS! Day Background to rotation 2019-10-21 16:13:53 -04:00
lib Ladder: Add GXE filtering for ladders with a max elo above 1500 2024-09-05 15:51:06 -05:00
old-replays Remove old action.php and replays 2023-11-14 11:32:59 +00:00
play.pokemonshowdown.com Preact minor update batch 11 2025-04-18 05:47:58 +00:00
pokemonshowdown.com Preact minor updates batch 9 2025-04-16 05:45:20 +00:00
replay.pokemonshowdown.com Preact minor update batch 11 2025-04-18 05:47:58 +00:00
teams.pokemonshowdown.com Teams: Ensure manage tab properly displays for all users 2025-04-16 20:05:13 -05:00
test Fix optimizer output when new spread has a 0 (#2241) 2024-04-08 07:36:13 -05:00
.babelrc Preact minor update batch 11 2025-04-18 05:47:58 +00:00
.editorconfig Preact minor update batch 11 2025-04-18 05:47:58 +00:00
.gitignore Add static website for viewing server-side teams 2025-04-09 19:36:58 -05:00
build Bring back Replays build script 2025-04-02 21:17:16 +00:00
CODEOWNERS Teams: Add link to teams upload page 2025-04-16 13:14:47 -05:00
composer.json Add Sentry to composer.json 2019-02-27 05:16:17 -05:00
CONTRIBUTING.md Remove SoundManager dependency (#1563) 2020-07-23 12:51:47 -07:00
eslint-ps-standard.mjs Preact minor update batch 11 2025-04-18 05:47:58 +00:00
eslint.config.mjs Add static website for viewing server-side teams 2025-04-09 19:36:58 -05:00
LICENSE Create LICENSE 2017-03-08 12:29:33 -06:00
package-lock.json Preact minor update batch 11 2025-04-18 05:47:58 +00:00
package.json Preact minor update batch 11 2025-04-18 05:47:58 +00:00
pokemonshowdown.psd New logo 2013-04-27 01:51:38 -07:00
README.md Improve testclient-key retrieval 2025-04-13 08:12:44 +00:00
tsconfig.json Add static website for viewing server-side teams 2025-04-09 19:36:58 -05:00
UPGRADING-SOCKJS.md Fix SockJS when using the desktop client (#1360) 2019-09-04 14:54:03 -05:00
WEB-API.md Make the source of replay pages more readable 2023-12-17 04:07:37 +00:00

Pokémon Showdown Client

Navigation: Website | Server repository | Client repository | Dex repository

Introduction

This is a repository for most of the client code for Pokémon Showdown.

This is what runs play.pokemonshowdown.com.

WARNING: You probably want the Pokémon Showdown server, if you're setting up a server.

Browser support

Pokémon Showdown currently supports, in order of preference:

  • Chrome
  • Firefox
  • Opera
  • Safari 5+
  • IE11+
  • Chrome/Firefox/Safari for various mobile devices

Pokémon Showdown is usable, but expect degraded performance and certain features not to work in:

  • Safari 4+
  • IE9+

Pokémon Showdown is mostly developed on Chrome, and Chrome or the desktop client is required for certain features like dragging-and-dropping teams from PS to your computer. However, bugs reported on any supported browser will usually be fixed pretty quickly.

Testing

Client testing now requires a build step! Install the latest Node.js (we require v14 or later) and Git, and run node build (on Windows) or ./build (on other OSes) to build.

You can make and test client changes simply by building after each change, and opening testclient.html. This will allow you to test changes to the client without setting up your own login server.

Test keys

For security reasons, browsers don't let other websites control PS, so they can't screw with your account, but it does make it harder to log in on the test client.

The default hack makes you copy/paste the data instead, but if you're refreshing a lot, just add a config/testclient-key.js file, with the contents:

const POKEMON_SHOWDOWN_TESTCLIENT_KEY = 'sid';

Replace sid with the contents of your actual PS sid cookie. You can quickly grab it from:

https://play.pokemonshowdown.com/testclient-key.php

Make sure to put it in config/ and not play.pokemonshowdown.com/config/.

(This is the only supported method of logging in on the beta Preact testclient.)

Other servers

You can connect to an arbitrary server by navigating to testclient.html?~~host:port. For example, to connect to a server running locally on port 8000, you can navigate to testclient.html?~~localhost:8000.

NOTE: Certain browsers will convert '?' to '%3F' when reading files off of the local filesystem. As a workaround, try using a different browser or serving the files locally first (ie. run npx http-server from the directory this README is in, then navigate in your browser to http://localhost:8080/testclient.html?~~localhost:8000).

Limitations

Even with a test key, the following things will fail in testclient.html:

  • Registering
  • Logging into other accounts (you can still switch to other unregistered accounts and back, though)

Everything else can be tested.

Warning

This repository is not "batteries included". It does NOT include instructions to run a full Pokémon Showdown login server, and we will not provide them. Please do not ask for help on this; you will be turned away.

If you make a mistake hosting a login server, your users' passwords can get stolen, so we do not want anyone to host a login server unless they can figure out how to do it without help.

It also doesn't include several resource files (namely, the /audio/ and /sprites/ directories) for size reasons.

On the other hand, as long as you don't want to run your own login server, this repository contains everything you need to test changes to the client; just see the "Testing" section above.

License

Pokémon Showdown's client is distributed under the terms of the AGPLv3.

The reason is mostly because I don't want low-effort proprietary forks that add bad code that steals everyone's passwords, or something like that.

If you're doing anything else other than forking, especially if you want to some client code files in your own open-source project that you want to release under a more permissive license (like, if you want to make your own multiplayer open-source game client for a different game), please ask at staff@pokemonshowdown.com. I hold all the copyright to the AGPLv3 parts and can relicense them to MIT for you.

WARNING: This is NOT the same license as Pokémon Showdown's server.