game-sdk.js 553 B

1234567891011121314151617
  1. /**
  2. * Game Platform SDK
  3. *
  4. * window.GameSDK is injected by the platform before your bundle loads.
  5. * Call it as a global — no import needed.
  6. *
  7. * const result = await GameSDK.submit(100)
  8. * // { ok: true, rank: 3 }
  9. *
  10. * For TypeScript projects, copy game-sdk.d.ts into your source tree (or
  11. * reference it in tsconfig) to get type checking and autocomplete.
  12. *
  13. * API:
  14. * GameSDK.gameId — string
  15. * GameSDK.getPlayerName() — string
  16. * GameSDK.submit(score) — Promise<{ ok: true, rank } | { ok: false, error }>
  17. */