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.4.0.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.1.0 exposes distribution controls and public CC0 search with nextgen assets search --provider freesound --q footsteps. Public asset search needs no gateway token.
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.
Search the public CC0 library from JavaScript
NextGenAssetsClient reads published assets without an API token. It is separate from the authenticated upload and distribution client.
import { NextGenAssetsClient } from '@nextgenrungames/distribution-sdk';
const assets = new NextGenAssetsClient();
const page = await assets.assets.search({ q: 'low poly forest', limit: 12 });
for (const asset of page.records) {
console.log(asset.title, asset.license, asset.downloadUrl, asset.sha256);
}
const found = await assets.sources.openverseImages({ q: 'pixel art', limit: 12 });
console.log(found.records.map(image => [image.title, image.creator, image.sourcePageUrl]));
const models = await assets.sources.polyHavenAssets({ q: 'forest', type: 'Texture', limit: 12 });
const sounds = await assets.sources.freesoundSounds({ q: 'footsteps', limit: 12 });
console.log(models.records[0]?.largePreviewUrl, sounds.records[0]?.previewUrl);
Use assets.searchFiles({ pack, q, limit, offset }) for a bounded file page, assets.get(packId, assetId) for full metadata, packs.list() or packs.get(packId) for pack details, and catalog() for the catalog snapshot. Source search includes Openverse images, Poly Haven models/textures/HDRIs, and Freesound sounds. Freesound remains disabled until written approval covers commercial public search and API/MCP exposure and a server key is configured. Verify each original source page before reuse.
Connect an MCP client to public assets
Add this public, read-only endpoint to an MCP client that supports remote HTTP servers. No token is required:
https://www.nextgenrungames.com/free-assets/mcp
Available tools: assets_search, asset_files_search, asset_get, asset_pack_get, openverse_images_search, polyhaven_assets_search, and freesound_sounds_search. Results include license and provenance details, previews, direct download URLs, and hashes where applicable. Freesound search requires written approval for commercial public search and API/MCP exposure and a server key.
Connect to your private workspace
The authenticated gateway MCP is https://www.nextgenrungames.com/mcp. Sign in and use Connect agent to create a scoped token and copy its local configuration. Keep that token in your agent environment; it is separate from the public CC0 endpoint. Private mailbox, vault, and browser tools run through the local agent bridge.