Quickstart
Every client request carries an API key, a timestamp, a nonce and a signature, and the production API is served at https://aggregator.asteriks.casino.
Sign your requests
Every request to the client API carries your API key and a timestamp, a nonce and a signature made with your secret, as four headers. The aggregator accepts a request only from the IP addresses on your allowlist and only when its timestamp is within 30 seconds of its own clock; the authentication page has the rules. The SDK signs for you.
Build your wallet
The aggregator calls your wallet for every bet, win, rollback and round close, and the wallet webhooks page describes the five operations. The test kit of the SDK checks your wallet against them before go-live; see SDK wallet test kit.
Launch your first game
The sample reads one game that can be launched in euros from the catalogue and launches it in real mode. The sessions page explains the modes, and the errors page the answers you can get.
quickstart.ts
import { AggregatorClient } from '@asteriks-aggregator/sdk/api'
/** The URL that opens the first euro game of the catalogue for a player, or undefined when there is none. */
export async function firstLaunch(apiKey: string, secret: string, playerId: string): Promise<string | undefined> {
const client = new AggregatorClient({ baseUrl: 'https://aggregator.asteriks.casino', apiKey, secret })
const page = await client.listGames({ currency: 'EUR', limit: 1 })
const game = page.items[0]
if (game === undefined) return undefined
const session = await client.createSession({
player_id: playerId,
currency: 'EUR',
game_id: game.id,
language: 'en',
country: 'TR',
device: 'desktop',
return_url: 'https://casino.example.com/lobby',
mode: 'real',
})
return session.game_url
}