JavaScript SDK — Matchmaking

Matchmaking — mp.matchmaking

list
await mp.matchmaking.list({ search?, limit? })

Browses public lobbies — no player token needed.

create
await mp.matchmaking.create(playerToken, name, { maxPlayers?, strictFull?, joinByRequests?, hostSwitch?, canLeaveRoom?, realtimeRoom?, password?, rules?, playerData? })

Creates a matchmaking lobby — options map to the wire fields one-to-one.

join
await mp.matchmaking.join(playerToken, matchmakingId, { password?, joinToken?, playerData? })

Direct-joins a lobby, creating the linked room.

leave / players / heartbeat / current
await mp.matchmaking.leave(playerToken)
await mp.matchmaking.players(playerToken)
await mp.matchmaking.heartbeat(playerToken)
await mp.matchmaking.current(playerToken)

Lobby membership lifecycle.

start / stop / remove / kick / password (host)
await mp.matchmaking.start(playerToken)
await mp.matchmaking.stop(playerToken)
await mp.matchmaking.remove(playerToken)
await mp.matchmaking.kick(playerToken, playerId)
await mp.matchmaking.password(playerToken, password)

Host controls — start locks the lobby and spawns the room.

matchmakingRequests
await mp.matchmakingRequests.send(playerToken, matchmakingId, { playerData? })
await mp.matchmakingRequests.respond(playerToken, requestId, 'accept'|'decline')
await mp.matchmakingRequests.status(playerToken, requestId)

Join-request flow for joinByRequests lobbies — players send, hosts answer, requesters poll status.