Skip to content

createClient

createClient<Games>(options): ShoehiveClient<Games>

Defined in: client/client.ts:811

Creates a client. Pass your games as a type argument for typed views and actions:

const client = createClient<[typeof ticTacToe]>({ url: 'ws://localhost:3000/shoehive' });
const table = await client.join(tableId);
await table.act('place', { cell: 4 });

Games extends readonly AnyGame[] = readonly AnyGame[]

ClientOptions

ShoehiveClient<Games>