command()
Signature#
client.command<M extends CommandName>( method: M, parameters: CommandParameters[M], options?: RequestOptions,): Promise<CommandResponses[M]>;// For mutation methods, options is required and must be MutationOptions.command() is the typed transport behind the six convenience methods. It sends one JSON object to POST /v1/commands with the exact case-sensitive method. Parameters contain the method-specific fields only; do not include method or credentials in the parameters object.
Supported methods#
| Method | Convenience helper | Request options |
|---|---|---|
| getGameList | getGameList() | Optional RequestOptions |
| getGameDemo | getGameDemo() | Optional RequestOptions |
| createPlayer | createPlayer() | Required MutationOptions |
| getGame | getGame() | Required MutationOptions |
| addFreeRounds | addFreeRounds() | Required MutationOptions |
| deleteFreeRounds | deleteFreeRounds() | Required MutationOptions |
Read example#
const catalogue = await client.command('getGameList', { currency: 'USD', list_type: 2,});Mutation example#
const player = await client.command( 'createPlayer', { user_username: 'player-1001', currency: 'USD' }, { idempotencyKey: 'persisted-create-player-operation-001' },);Persist this operation key and exact request before dispatch. Creating an identity does not fund a player or session.
Validation and returns#
The SDK validates supported fields, basic bounds, required mutation keys and configuration. Server-side scope, entitlement and provider rules still apply. Success returns the complete command envelope; errors throw typed exceptions.
Read and demo commands reject idempotencyKey. Unsupported compatibility commands getFreeRounds and deleteAllFreeRounds are not exposed by the SDK. See response types and error handling.