Analytics, live-ops config & webhooks
- Written for
- + Written for
- Deprecated
- + Deprecated
- Applies to
- + Applies to
Analytics, live-ops config & webhooks
Cool GPT Games is a game backend, not just a host. Three live-ops primitives:
Custom analytics + crash reporting (in-game)
// Log whatever tells you how players play. Fire-and-forget; lands inside a session.
GameSDK.trackEvent("level_complete", { level: 3, timeMs: 42000 });
GameSDK.trackEvent("boss_defeated", { boss: "dragon" });
// Report a caught error/crash — shows up in your dashboard's crash list.
try { risky(); } catch (e) { GameSDK.reportError(e.message, { where: "boot" }); }Read the aggregates in your creator dashboard (per game: event counts, top events, crashes, daily active players, returning players) or via the API: GET /v1/dev/games/:id/analytics → { totalEvents, uniquePlayers, events[], errors[], daily[], returningPlayers }.
Remote config / live-ops (change your game without re-uploading)
Set a JSON config in the dashboard (or arc.setConfig(gameId, {...})); the game reads it live:
GameSDK.getConfig().then(function (cfg) {
var difficulty = cfg.difficulty || "normal";
var dropRate = cfg.dropRate != null ? cfg.dropRate : 0.1;
// Tune your game from the dashboard — no new build, no re-review.
});GET /v1/games/:slug/config (public) · GET|PUT /v1/dev/games/:id/config (owner).
Outbound webhooks (server-to-server events)
Register an HTTPS endpoint and get signed events for game.approved, game.rejected, game.reported, review.created, tournament.ended, payout.paid (or *):
const arc = new ArcadeyClient({ apiKey });
const { id, secret } = await arc.createWebhook({ url: "https://you.dev/hook", events: ["*"] });
// Each delivery carries: headers x-arcadey-event + x-arcadey-signature = "sha256=" + HMAC-SHA256(secret, rawBody)
// Body: { event, data, sentAt }. Verify the signature before trusting it.POST /v1/dev/webhooks · GET /v1/dev/webhooks · DELETE /v1/dev/webhooks/:id · POST /v1/dev/webhooks/:id/test · GET /v1/dev/webhooks/:id/deliveries.
In-game economy (sell items for coins)
Define items in your dashboard (or arc.upsertItem(gameId, {...})); players buy them with the coins they already earn on the platform, and the sale credits your creator balance. Ownership is a durable entitlement.
GameSDK.economy.listItems().then(function (items) { /* [{ sku, name, priceCoins }] */ });
GameSDK.economy.purchase("skin_gold").then(function (r) {
if (r && r.ok) unlockSkin(); // r.purchased / r.alreadyOwned / r.coins
else if (r && r.error === "insufficient_coins") promptTopUp();
});
GameSDK.economy.getEntitlements().then(function (r) { /* r.owned = ["skin_gold", ...] */ });Preview builds & instant rollback
GET /v1/me/games/:id/preview→ a private, owner-only playable link for an unpublished (or current) build — playtest before you submit. It's in the dashboard.POST /v1/me/games/:id/versions/:versionId/rollback→ re-publish an earlier version that already passed review, instantly (no re-moderation).
API-key scopes
Mint scoped keys (dashboard or POST /v1/me/keys {name, scopes}) so a key can only do what it needs: read, publish, tournaments, webhooks, config, analytics, economy (or * for full). Session logins are always full-access.