Authentication

Authentication

Colyseus authenticates clients on two surfaces: room joins (via an onAuth hook) and HTTP routes (via middleware). The official @colyseus/auth module powers both surfaces and pairs with @colyseus/database for a zero-config user store, automatic route mounting, and revocation-aware sessions.

Fastest setup: add a GameDatabase to defineServer and @colyseus/auth wires itself: user store, register/login routes, ban gating, and revocation-aware JWTs, all from one option. → Database → Authentication

Common scenarios


Next Steps