Skip to main content

Games Collections

Overview

With GamePush, you can show the list of games to the player. An overlay will open with a list of games available on the current site.

For the game to be visible on the platform, you need:

  1. Go to the game settings and mark all sites on which the game has already been published. This can be done in the "Published on Platforms" field in the "Public zone" section.

  1. On sites that do not support internal urls - add a public url to the game. This can be done in the "Public game URL" field in the "Project Settings" section.

Some platforms allow the exchange of links only within the platform. Below is a table of link types.

PlatformLink Type
Yandex.Games✅ Internal
VK Games✅ Internal
VK Play✅ Internal
OK Games✅ Internal
Kongregate✅ Internal
CrazyGames💡 External (Public URL)
GameMonetize💡 External (Public URL)
GameDestribution❌ Forbidden
GamePix❌ Forbidden
WG Playground❌ Forbidden
POKI❌ Forbidden
SmartMarket❌ No sharing mechanism, can't get game url (waiting for feature)
info

💡 External (Public URL) - the game will be shown only if the Public URL is filled in the game.

tip

You can create custom games collections in Games Dashboard.

Open games collection

+1 Request

Open overlay with all games sorted by newest

gp.gamesCollections.open();

// Or by tag "ALL"
gp.gamesCollections.open({ tag: 'ALL' });

Open overlay with games from special collection by ID or TAG

// By custom TAG
gp.gamesCollections.open({ tag: 'HALLOWEEN_GAMES' });

// By ID
gp.gamesCollections.open({ id: 547 });

Open games collection events

// Overlay opened
gp.gamesCollections.on('open', () => {});

// Overlay closed
gp.gamesCollections.on('close', () => {});

Fetch games collection

+1 Request

Fetch all games sorted by newest

gp.gamesCollections.fetch();

// Or by tag "ALL"
gp.gamesCollections.fetch({ tag: 'ALL' });

Fetch games from special collection by ID or TAG

// By custom TAG
gp.gamesCollections.fetch({ tag: 'HALLOWEEN_GAMES' });

// By ID
gp.gamesCollections.fetch({ id: 547 });

Fetch with promises

const result = await gp.gamesCollections.fetch();

// Response result
const {
// Collection ID
id,
// Collection Tag
tag,
// Collection name
name,
// Collection description
description,
// Games in collection
games,
} = result;

Fetch games collection events

// Fetch success
gp.gamesCollections.on('fetch', (result) => {});

/**
* Error if fetch failed
* @type {
* 'not_found' |
* undefined
* }
*/
gp.gamesCollections.on('error:fetch', (error) => {});

Collection fields

/**
* Collection ID
* @type {number}
*/
collection.id;

/**
* Optional tag for help in selecting
* You can use it instead of ID
* @type {string}
*/
collection.tag;

/**
* Name translated into current language
* @type {string}
*/
collection.name;

/**
* Description translated into current language
* @type {string}
*/
collection.description;

/**
* List of games in collections (sorted)
* @type {GamePreview[]}
*/
collection.games;

Game fields

/**
* Game ID
* @type {number}
*/
game.id;

/**
* Name translated into current language
* @type {string}
*/
game.name;

/**
* Description translated into current language
* @type {string}
*/
game.description;

/**
* Icon src 256x256
* @type {string}
*/
game.icon;

/**
* URL on platform or public URL
* @type {string}
*/
game.url;

Stay in Touch

Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.

GamePush Community Telegram: @gs_community.

For your suggestions e-mail: [email protected]

We Wish you Success!