Skip to documentation
/

command()

Signature#

typescript example
.ts
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#

MethodConvenience helperRequest options
getGameListgetGameList()Optional RequestOptions
getGameDemogetGameDemo()Optional RequestOptions
createPlayercreatePlayer()Required MutationOptions
getGamegetGame()Required MutationOptions
addFreeRoundsaddFreeRounds()Required MutationOptions
deleteFreeRoundsdeleteFreeRounds()Required MutationOptions

Read example#

typescript example
.ts
const catalogue = await client.command('getGameList', {  currency: 'USD',  list_type: 2,});

Mutation example#

typescript example
.ts
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.

Was this page helpful?