White-label API
The White-label API provides the configuration, content, player features, feedback, and statistics required to build a custom frontend for a GamePush white-label platform. It uses GraphQL but has a different access context from the general Server API.
GraphQL endpointโ
Send GamePush requests to:
https://api.gamepush.com/gs/api/graphql
Use the POST method with a JSON body containing query and, when required, variables. The White-label API and the general Server API use the same GraphQL endpoint but different access headers and operations.
Open the platform in the GamePush control panel. Its numeric ID is the {id} segment in the page URL: panel/platforms/{id}. Open the API section to copy the platform API KEY, which is required only for server-side requests. Use the standard endpoint for the initial configuration request. If the response contains another apiUrl, use that configured GraphQL address for subsequent White-label API requests with the same request format.
There are two execution contexts:
| Context | Required request data | Use it for |
|---|---|---|
| Platform server | Content-Type, X-Game-Platform-Api-Key, X-Game-Platform-ID | Full game catalogue with metrics, feedback processing, and statistics |
| Player browser | Content-Type, X-Game-Platform-ID, matching browser Origin, and credentials: 'include' | Public configuration and content, player login, profile, played games, and purchases |
The API key is a server-side secret. Never embed it in a frontend bundle, expose it to a browser, or commit it to a repository.
The Secret Key shown next to the API key is used for webhook signatures. It is not a GraphQL access key. Internal GamePush headers and tokens are not part of the public API.
Browser request helperโ
The browser adds its Origin header. The API checks that the origin matches the platform domain. credentials: 'include' lets the browser receive and send the HttpOnly player-session cookie.
const apiUrl = 'https://api.gamepush.com/gs/api/graphql';
const platformId = '42';
async function requestWhiteLabelApi(query, variables = {}) {
const response = await fetch(apiUrl, {
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'X-Game-Platform-ID': platformId,
},
body: JSON.stringify({ query, variables }),
});
const payload = await response.json();
if (!response.ok || payload.errors?.length) {
throw new Error(payload.errors?.[0]?.message ?? `HTTP ${response.status}`);
}
return payload.data;
}
Do not add the API key to this helper. The player cookie is managed by the browser and must not be read from JavaScript.
Handle GraphQL resultsโ
White-label operations return a union. Use __typename to distinguish a successful object from Problem. HTTP 200 does not guarantee a successful business result.
const data = await requestWhiteLabelApi(query, variables);
const result = data.result;
if (result.__typename === 'Problem') {
throw new Error(result.message);
}
API sectionsโ
- Quick start: server helper and first requests.
- Platform: branding, SEO, analytics, menus, ads, and payments configuration.
- Games: game content, pagination, filters, and metrics.
- Pages: page metadata and renderable blocks.
- Collections: collection metadata and paginated games.
- Promotions: promotional banners, PWA prompt, and game of the day.
- Player: login, profile, played games, and purchases.
- Feedback: create and process platform feedback.
- Statistics: recorded advertising and purchase aggregates.
The White-label API reads settings prepared in the control panel. Administrative create, update, publish, and delete operations remain control-panel operations and are not part of this API guide.