Function: findMatch()
ts
function findMatch(url, options?): Promise<MatchFound>;Defined in: client/matchmaking.ts:23
Wait in a matchmaking queue. Resolves with the room to connect to and the players in it once the matchmaker has put a match together.
const { room } = await findMatch("wss://my-game.example/matchmaking/ranked");
const client = new RoomClient(`wss://my-game.example/rooms/${room}`);
Parameters
| Parameter | Type |
|---|---|
url | string | URL |
options? | FindMatchOptions |
Returns
Promise<MatchFound>