Skip to documentation
/

Quickstart

Show samples as

Install the package

Installation guide

Use 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.

package.json
.json
{  "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"  }}
Download aggregator-network-sdk-0.1.1.tgz
.sh
npm install ./aggregator-network-sdk-0.1.1.tgznpm install --save-dev typescript@5.9.3 @types/node@24.10.1

Create a src folder for the TypeScript files and save this configuration at the project root.

tsconfig.json
.json
{  "compilerOptions": {    "target": "ES2022",    "module": "NodeNext",    "moduleResolution": "NodeNext",    "rootDir": "src",    "outDir": "dist",    "strict": true,    "skipLibCheck": true  },  "include": ["src/**/*.ts"]}

Configure the client

Client configuration

Create 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.

.env
.sh
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
.gitignore
.text
.envnode_modules/dist/

Save the following client as src/client.ts.

src/client.ts
.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

NameTypeRequiredDescription
apiKeystringCommandsYour workspace's scoped Game API key. Not required for the public provider directory.
baseUrlstringNoHTTPS origin of the gateway; defaults to https://aggregatornetwork.com.
timeoutMsnumberNoRequest timeout, including response-body reading. Defaults to 15,000 milliseconds.

Read the catalogue

Catalogue reference

Request the games enabled for your workspace and currency. The SDK returns the full response envelope; a successful response has numeric error: 0.

src/catalogue.ts
.ts
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');
Example response
.ts
// 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:

Run catalogue
.sh
npm run buildnpm run catalogue

A 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 reference

Select 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.

src/demo.ts
.ts
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);
Example response
.ts
// 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.

Run demo
.sh
npm run buildnpm run demo

Handle errors

Errors and recovery

Catch 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.

src/errors.ts
.ts
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.

Run error-handling example
.sh
npm run buildnpm run errors

Error handling reference

ErrorMeaningWhat to check
AggregatorValidationErrorInvalid local inputReview parameter bounds, runtime and operation keys before dispatch.
AggregatorApiErrorGateway or provider rejectionInspect safe status, code and request ID; follow the validation guide.
AggregatorTransportErrorNetwork, timeout, cancellation or invalid responseCheck 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.

PathWhat you can evaluateAccess and limits
View player lobbyA public player website previewNot an authenticated API or wallet integration test.
Try the browser simulatorIllustrative requests and responsesRuns locally in the browser; sends no request to the game API and does not measure API latency or availability.
Explore providersPublic provider discovery and catalogue informationPublic discovery needs no Game API key; a listing does not establish your workspace's game or currency access.
Test an authenticated demoTrial play for an eligible game using its returned temporary URLRequires 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 walkthroughDiscuss your platform, wallet responsibilities and launch scopeAn 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#

Open API setup

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:

bash example
.sh
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.

  1. Reserve starting funds, persist the launch request and its idempotency key, then send a numeric balance.
  2. Verify settlement callbacks against exact body bytes and apply each serial_number once.
  3. 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#

All endpoints · OpenAPI JSON

Diagnose a request#

Request Logs · Callback Deliveries. Share request ID, method, currency and timestamp, never credentials or session URLs.

Was this page helpful?