Skip to content

Password-protect a room

Step 1: allow the matchmaker to identify the "password" field.

Define the "password" field inside the filterBy() method.

  .define("battle", BattleRoom)

Step 2: make the room unlisted

If a password was provided for create() or joinOrCreate(), set the room listing as private:

export class BattleRoom extends Room {

  onCreate(options) {
    if (options.password) {


Back to top