Quickstart
Install the package
Installation guideUse Node.js 22 or newer. Create an empty aggregator-quickstart folder, save the package file below inside it, then download the SDK archive into that same folder. Run all following commands from this project folder.
{ "name": "aggregator-quickstart", "private": true, "type": "module", "scripts": { "build": "tsc -p tsconfig.json", "catalogue": "node --env-file=.env dist/catalogue.js", "demo": "node --env-file=.env dist/demo.js", "errors": "node --env-file=.env dist/errors.js" }}npm install ./aggregator-network-sdk-0.1.1.tgznpm install --save-dev typescript@5.9.3 @types/node@24.10.1Create a src folder for the TypeScript files and save this configuration at the project root.
{ "compilerOptions": { "target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext", "rootDir": "src", "outDir": "dist", "strict": true, "skipLibCheck": true }, "include": ["src/**/*.ts"]}Configure the client
Client configurationCreate a scoped Game API key in your workspace and store it in your server environment. Configure your backend egress IP and approved HTTPS return origins in API Setup.
Save .env at the project root and replace the placeholder key. Keep this file out of source control. The demo settings are only required in step four.
AGGREGATOR_API_KEY=REPLACE_WITH_YOUR_GAME_API_KEYAGGREGATOR_CURRENCY=USDAGGREGATOR_DEMO_GAME_ID=REPLACE_WITH_ENTITLED_CATALOGUE_IDAGGREGATOR_HOME_URL=https://operator.example/lobbyAGGREGATOR_CASHIER_URL=https://operator.example/cashier.envnode_modules/dist/Save the following client as src/client.ts.
import { AggregatorClient } from '@aggregator-network/sdk';import type { AggregatorClientOptions } from '@aggregator-network/sdk'; const apiKey = process.env.AGGREGATOR_API_KEY;if (!apiKey) throw new Error('AGGREGATOR_API_KEY is required'); const options: AggregatorClientOptions = { apiKey, baseUrl: 'https://aggregatornetwork.com', timeoutMs: 15_000,}; export const client = new AggregatorClient(options);The TypeScript examples import ./client.js intentionally: NodeNext resolves it to src/client.ts while building, then Node loads the emitted dist/client.js. Compile before running; do not execute these .ts files directly.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
apiKey | string | Commands | Your workspace's scoped Game API key. Not required for the public provider directory. |
baseUrl | string | No | HTTPS origin of the gateway; defaults to https://aggregatornetwork.com. |
timeoutMs | number | No | Request timeout, including response-body reading. Defaults to 15,000 milliseconds. |
Read the catalogue
Catalogue referenceRequest the games enabled for your workspace and currency. The SDK returns the full response envelope; a successful response has numeric error: 0.
import { client } from './client.js';import type { GetGameListParameters } from '@aggregator-network/sdk'; const request: GetGameListParameters = { currency: process.env.AGGREGATOR_CURRENCY ?? 'USD', list_type: 2,}; const catalogue = await client.getGameList(request); // The complete envelope is returned.// Keep s or id_hash exactly as supplied.const games = catalogue.response;console.log('Catalogue loaded:', Object.keys(games).length, 'games');// Contract illustration, not live game data.{ error: 0, response: GameCatalogue} // response is an array or keyed object.// Compact entries expose s.// Detailed entries expose id_hash.// Preserve those identifiers for launch.Run your first catalogue request
Save the catalogue example as src/catalogue.ts, then run:
npm run buildnpm run catalogueA successful call prints the number of games returned. An entitlement or credential failure throws instead; follow step five to inspect a safe error. These commands make real gateway requests.
Launch a demo
Demo referenceSelect a demo-eligible game from the catalogue. Replace the example return URLs with HTTPS origins saved in your workspace; the SDK does not use a mutation idempotency key for demo requests.
import { client } from './client.js'; const gameid = process.env.AGGREGATOR_DEMO_GAME_ID;const homeurl = process.env.AGGREGATOR_HOME_URL;const cashierurl = process.env.AGGREGATOR_CASHIER_URL;if (!gameid || !homeurl || !cashierurl) { throw new Error('Set the demo game and approved return URLs in .env');} const demo = await client.getGameDemo({ gameid, currency: process.env.AGGREGATOR_CURRENCY ?? 'USD', lang: 'en', homeurl, cashierurl,}); // Deliver this URL only to the requesting player.const launchUrl = demo.response;console.log('Demo URL received:', launchUrl.length > 0);// Contract illustration, not a live launch.{ error: 0, response: string, session_id: string} // response is a temporary launch URL.// session_id is a gateway request-ID alias.// It is not a provider settlement join.// Do not write launch URLs to logs.Save this file as src/demo.ts. Set the game identifier and both approved return URLs in .env, then run the command to request a demo URL.
npm run buildnpm run demoHandle errors
Errors and recoveryCatch SDK errors at your server boundary. HTTP failures and nonzero numeric API errors throw; return a safe message to the player and keep sensitive response details out of logs.
import { client } from './client.js';import { AggregatorApiError, AggregatorTransportError,} from '@aggregator-network/sdk'; try { await client.getGameList({ currency: process.env.AGGREGATOR_CURRENCY ?? 'USD', list_type: 2, });} catch (error) { if (error instanceof AggregatorApiError) { // Safe diagnostics; never log keys or game URLs. console.error('Gateway request rejected', { status: error.status, requestId: error.requestId, }); } else if (error instanceof AggregatorTransportError) { console.error('Request interrupted', { reason: error.reason }); } throw error;}Save as src/errors.ts to use this request boundary in the standalone example.
npm run buildnpm run errorsError handling reference
| Error | Meaning | What to check |
|---|---|---|
AggregatorValidationError | Invalid local input | Review parameter bounds, runtime and operation keys before dispatch. |
AggregatorApiError | Gateway or provider rejection | Inspect safe status, code and request ID; follow the validation guide. |
AggregatorTransportError | Network, timeout, cancellation or invalid response | Check outcomeUnknown and reconcile dispatched mutations. |
What next
HTTP quickstart reference
Choose your evaluation path#
Choose the preview or request that matches what you want to learn. These paths do not grant production access or operating approval.
| Path | What you can evaluate | Access and limits |
|---|---|---|
| View player lobby | A public player website preview | Not an authenticated API or wallet integration test. |
| Try the browser simulator | Illustrative requests and responses | Runs locally in the browser; sends no request to the game API and does not measure API latency or availability. |
| Explore providers | Public provider discovery and catalogue information | Public discovery needs no Game API key; a listing does not establish your workspace's game or currency access. |
| Test an authenticated demo | Trial play for an eligible game using its returned temporary URL | Requires a live scoped Game API key, eligible demo activation, game/currency access and approved HTTPS return origins. No player balance or monetary settlement is tested. |
| Request an integration walkthrough | Discuss your platform, wallet responsibilities and launch scope | An enquiry starts a conversation; it does not automatically issue credentials, enable providers or reserve an appointment. |
Before requesting evaluation access, identify your operating markets, desired providers and currencies, existing platform or website needs, and wallet/callback responsibilities. Confirm the available access process with the integration team; do not assume a public simulator supplies a test workspace.
1. Set up your workspace#
Create a Game API key, set method scopes and allow your backend egress IP. Save the exact HTTPS origins of your lobby and cashier. Funded sessions also need an HTTPS wallet callback and a separate signing secret.
Keep the key in your server environment, not your source code:
export AGGREGATOR_API_KEY="YOUR_GAME_API_KEY"In PowerShell, use $env:AGGREGATOR_API_KEY = "YOUR_GAME_API_KEY".
2. Make your first request#
Run the example on your backend. The public provider directory needs no key; your workspace game catalogue does.
Select Game catalogue with a supported currency. Keep the returned s or id_hash for launches, never the numeric id. A successful empty response means no games matched this request. See catalogue fields.
Browser tests need a short-lived key restricted to your current IP. Never paste a production key into the explorer.
3. Test a demo#
Open Launch Demo. Send the exact catalogue identifier and approved return URLs; omit player, balance and Idempotency-Key. Demo activation, key scope and game/currency access still apply.
Open the returned temporary URL only after HTTP success and numeric error: 0.
Basic flow#
Before real-money play, confirm operating approval, production activation, game access and a separate positive GGR balance. Use the production checklist.
- Reserve starting funds, persist the launch request and its idempotency key, then send a numeric
balance. - Verify settlement callbacks against exact body bytes and apply each
serial_numberonce. - Reconcile unknown outcomes before moving funds or replacing an operation.
The game API does not debit your own wallet. Deliver a successful launch URL only to its player.
Documentation contents#
Diagnose a request#
Request Logs · Callback Deliveries. Share request ID, method, currency and timestamp, never credentials or session URLs.