Skip to content

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 ​

ParameterType
urlstring | URL
options?FindMatchOptions

Returns ​

Promise<MatchFound>

MIT licence. Tickflare is an independent project and is not affiliated with Cloudflare.