One client.
Many routes.
Upload a build once, discover compatible destinations, start distribution through the NextGen gateway, and follow each provider's real status and next action.
Install from the hosted package
npm install https://www.nextgenrungames.com/sdk/nextgenrungames-distribution-sdk-0.1.1.tgz
Requires Node.js 20+. Create a scoped token from your verified NextGen workspace and set it as NEXTGEN_API_TOKEN in your build environment. Keep the token out of the game and browser bundle.
Upload and route in parallel
import { NextGenClient } from '@nextgenrungames/distribution-sdk';
const nextgen = new NextGenClient();
const game = await nextgen.games.uploadBuild('./dist/game.zip', {
title: 'My browser game',
version: '1.0.0',
format: 'html5',
rightsConfirmed: true,
});
const result = await nextgen.distribution.startEverywhere(game.gameId);
console.table(result.jobs.map(job => ({
destination: job.provider_id,
status: job.status,
nextAction: job.next_action,
url: job.url,
})));
Follow every destination's progress
The gateway creates a separate job for each route. Watch them concurrently in a build pipeline:
await Promise.all(result.jobs.map(async (job) => {
for await (const update of nextgen.jobs.watch(job.id, { intervalMs: 5000 })) {
console.log({
destination: update.provider_id,
status: update.status,
nextAction: update.next_action,
recordedUrl: update.url,
});
}
}));
jobs.watch() polls until a verified live result or a state that needs owner action. A queued job means the gateway accepted the work; upload, submission, review, and public release are separate checkpoints. Treat a URL as verified live only when the job is live and has a verification timestamp. One route needing attention does not stop the others.
Repair saved connections
const blockers = await nextgen.distribution.diagnostics();
const repair = await nextgen.distribution.repair();
console.log(repair.connected, repair.requeued, repair.routes);
Selected saved accounts connect automatically when the required credential and target are available. Repair preserves existing game targets, respects pause, and resumes eligible jobs. Provider authentication, API permission and review steps remain visible.
The CLI v1.0.1 exposes the same controls with nextgen dist diagnostics --json and nextgen dist repair --json.
Built around real provider workflows
- Upload builds and queue all compatible destinations through the existing gateway.
- See which provider adapters are available and what formats each accepts.
- Read per-destination status, next action, and recorded public URL.
- Keep portal handoffs, provider review, and verified live status distinct.
Provider runtime SDKs such as Playgama Bridge, CrazyGames SDK, and Poki SDK remain target-specific integrations. The client does not bundle distributor code into every game or promise that a runtime SDK publishes to other portals.