Promotions
Promotion content consists of platform promo banners, a PWA installation prompt, and a game-of-the-day fallback.
Read showPromoBlock from the Platform configuration first. When it is false, do not render the promo-banner area even if the promo list contains items. PWA and game-of-the-day UI can still follow their own returned content.
Execution context: browser or platform server. A browser sends Content-Type, X-Game-Platform-ID, matching Origin, and credentials: 'include'. A server also sends X-Game-Platform-Api-Key. The API key must never be exposed in the frontend.
Load promotion content
query PromotionContent(
$promosInput: FetchGamePlatformPromosInput!
$pwaInput: FetchGamePlatformPwaPromoInput!
$gameOfDayInput: FetchGameOfTheDayInput!
$lang: Lang
) {
result: FetchGamePlatformPromos(input: $promosInput) {
__typename
... on Problem {
message
}
... on GamePlatformPromoList {
count
items {
id
isActive
name
squareImage(lang: $lang)
horizontalImage(lang: $lang)
promoText(lang: $lang)
showOnlyForUnauthorized
link {
type
url
popup
}
}
}
}
pwaResult: FetchGamePlatformPwaPromo(input: $pwaInput) {
__typename
... on Problem {
message
}
... on GamePlatformPwaPromo {
iconUrl(lang: $lang)
titleText(lang: $lang)
subtitleText(lang: $lang)
}
}
gameOfDayResult: FetchGameOfTheDay(input: $gameOfDayInput) {
__typename
... on Problem {
message
}
... on GameOfTheDay {
title
subtitle
game {
id
name(lang: $lang)
icon(lang: $lang)
platformUrl(lang: $lang)
}
}
}
}
Variables:
{
"lang": "EN",
"promosInput": {
"gamePlatformId": 42
},
"pwaInput": {
"gamePlatformId": 42
},
"gameOfDayInput": {
"gamePlatformId": 42
}
}
Successful response shape:
{
"data": {
"result": {
"__typename": "GamePlatformPromoList",
"count": 1,
"items": [
{
"id": "summer-sale",
"isActive": true,
"name": "Summer sale",
"squareImage": "https://cdn.example.com/promo-square.webp",
"horizontalImage": "https://cdn.example.com/promo-wide.webp",
"promoText": "Get more coins",
"showOnlyForUnauthorized": false,
"link": {
"type": "POPUP",
"url": null,
"popup": "TOP_UP_BALANCE"
}
}
]
},
"pwaResult": {
"__typename": "GamePlatformPwaPromo",
"iconUrl": "https://cdn.example.com/pwa-icon.webp",
"titleText": "Install the app",
"subtitleText": "Play from your home screen"
},
"gameOfDayResult": {
"__typename": "GameOfTheDay",
"title": "Game of the day",
"subtitle": "Try something new",
"game": {
"id": 101,
"name": "Example Game",
"icon": "https://cdn.example.com/game.webp",
"platformUrl": "https://games.example.com/game/example-game"
}
}
}
}
Check every result alias for Problem independently. Choose the square or horizontal image for the current placement. For a URL link, navigate to url; for POPUP, open the interface named by popup: AUTH, TOP_UP_BALANCE, or DISABLE_ADS.
Do not show items with isActive: false. Hide showOnlyForUnauthorized items after the player signs in. Show the PWA prompt only when installation is supported and useful; otherwise use gameOfDayResult as the fallback promotion.