Sending Events
The Game Client MUST notify Kalamba SDK about in-game events by using the following methods:
Autoplay
The Game Client MUST notify Kalamba SDK that the autoplay state has changed.
type AutoplayPayload = { action: 'start' | 'stop' | 'pause' | 'resume' }
sdk.send('autoplay', { action: 'start' })
Bet
The Game Client MUST notify Kalamba SDK that the in-game bet has changed.
type BetPayload = { base: number; multiplier: number }
sdk.send('bet', { base: 100, multiplier: 20 })
Cashier
The Game Client MUST notify Kalamba SDK that the player wishes to use cashier (deposit) functionality.
The type field describes why the cashier was requested.
type CashierPayload = { type: 'ON_DEMAND' | 'BALANCE_LOW' | 'BALANCE_INSUFFICIENT' }
sdk.send('cashier', { type: 'ON_DEMAND' })
Choice
The Game Client MAY ask the player to make a choice outside of the game UI.
The selected option is delivered back to the game via the choice event (see Reacting to Events).
type ChoicePayload = {
message: string
options: { id: string; label: string }[]
}
sdk.send('choice', {
message: 'Collect or gamble?',
options: [
{ id: 'collect', label: 'Collect' },
{ id: 'gamble', label: 'Gamble' },
],
})
Close
The Game Client MUST notify Kalamba SDK that the player wishes to close the game. This event has no payload.
sdk.send('close')
Error
The Game Client MUST notify Kalamba SDK that the game has encountered some error.
The type field tells the wrapper how the error should be resolved: CLOSE, RELOAD or CONTINUE.
Either a literal message or a translation messageKey MUST be provided.
type ErrorPayload = {
messageCode: string
type: 'CLOSE' | 'RELOAD' | 'CONTINUE'
} & ({ message: string } | { messageKey: string })
sdk.send('error', {
messageCode: 'ASSETS_LOAD_FAILED',
type: 'RELOAD',
message: 'Failed to load game assets',
})
Free Rounds
The Game Client MUST notify Kalamba SDK about the player's decision on a free rounds offer. See Free Rounds for the full lifecycle.
type FreeRoundsPayload = {
action: 'ACCEPT' | 'DECLINE' | 'SKIP'
id: string
}
sdk.send('freeRounds', { action: 'ACCEPT', id: 'free-round-id' })
The Game Client MAY request the wrapper to show the free rounds popup. This event has no payload.
sdk.send('freeRoundsPopup')
Fullscreen
The Game Client MUST notify Kalamba SDK that the player wishes to trigger fullscreen mode. Optionally, a screen orientation lock can be requested.
type FullscreenPayload = { lock?: OrientationLockType }
sdk.send('fullscreen', { lock: 'landscape' })
History
The Game Client MUST notify Kalamba SDK that the player wishes to see game history.
The source field describes where the request originated from.
type HistoryPayload = { source: 'realityCheck' | 'settings' | 'casino' }
sdk.send('history', { source: 'settings' })
Game Loading
The Game Client MUST notify Kalamba SDK that the game has started loading. This event has no payload.
sdk.send('loadStart')
The Game Client MAY notify Kalamba SDK about game loading progress.
progress is a number between 0 and 100.
type LoadProgressPayload = { progress: number }
sdk.send('loadProgress', { progress: 50 })
The Game Client MUST notify Kalamba SDK that the game has finished loading. This event has no payload.
sdk.send('loadEnd')
Open Game and Play
openGame and play are request/response helpers, not plain sends — use the sdk.openGame(...) and sdk.play(...) methods, which resolve with the RGS response.
See Gameplay.
Gameplay Cycle
The Game Client MUST notify Kalamba SDK whether the game is ready and can accept play requests. This event has no payload.
sdk.send('playReady')
The Game Client MUST notify Kalamba SDK that the play animations started playing. The payload is the play contract of the round being animated.
type PlayStartPayload = {
bet: { base: number; multiplier: number } | null
forcedOutcomes?: unknown
[key: string]: any
}
sdk.send('playStart', { bet: { base: 100, multiplier: 20 } })
The Game Client MUST notify Kalamba SDK that the play animations stopped playing.
The payload is the play response received from sdk.play(...).
const response = await sdk.play({ bet: { base: 100, multiplier: 20 } })
// ...animations...
sdk.send('playEnd', response)
The Game Client MUST notify Kalamba SDK that the paid game cycle has been requested.
The payload is the play contract of the paid round, same shape as playStart.
sdk.send('playCycleStart', { bet: { base: 100, multiplier: 20 } })
The Game Client MUST notify Kalamba SDK that full game cycle has completed (including all free spins, gambles, selections) and the final balance was shown.
The payload is the last play response of the cycle, same shape as playEnd.
sdk.send('playCycleEnd', lastPlayResponse)
Translations
The Game Client MAY notify Kalamba SDK about custom translations. The payload is a (possibly nested) record of translation keys to strings.
sdk.send('translations', {
generic_error: 'Something went wrong',
RgsError: {
OUT_OF_MONEY: 'You are out of credits',
},
})
Settings
- The Game Client MUST notify Kalamba SDK about initial in-game settings.
- The Game Client MUST notify Kalamba SDK that the player has changed in-game settings.
type SettingsPayload = {
fastPlay?: boolean
sounds?: boolean
music?: boolean
}
sdk.send('settings', { sounds: true, music: false })
Telemetry
The Game Client MAY notify Kalamba SDK about clicks.
type TelemetryClickPayload = {
location: string
name: string
}
sdk.send('telemetry.click', { location: 'bottomBar', name: 'spinButton' })
The Game Client MAY notify Kalamba SDK that screen orientation has changed. This event has no payload.
sdk.send('telemetry.orientationChange')