Skip to main content

Games Collections

Overview

With SpellSync, 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
PlayDeck✅ Internal
GooglePlay💡 External (Public URL)
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

ss.gamesCollections.open()

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

Open overlay with games from special collection by ID or TAG

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

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

Open an overlay with additional parameters for sharing in games. For example, specify the player's ID or a reward for referral. Parameters are passed in the format { "key": "value" }.

ss.gamesCollections.open({
tag: 'HALLOWEEN_GAMES',
shareParams: {
playerId: ss.player.id,
fromGame: ss.projectId,
fromPlatform: ss.platform.type,
fromUrl: ss.app.url,
},
});

Open games collection events

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

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

Fetch games collection

+1 Request

Fetch all games sorted by newest

ss.gamesCollections.fetch()

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

Fetch games from special collection by ID or TAG

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

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

Fetch with promises

const result = await ss.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
ss.gamesCollections.on('fetch', (result) => {})

/**
* Error if fetch failed
* @type {
* 'not_found' |
* undefined
* }
*/
ss.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.

SpellSync Community Telegram: @spellsync.

For your suggestions e-mail: [email protected]

We Wish you Success!