The developer docs are written in English and Spanish. You are reading the English version.
Migrate from Poki
The Poki shim exposes window.PokiSDK on top of Gamealia. Most games only swap one script tag.
1. Swap the script
<!-- before -->
<script src="https://game-cdn.poki.com/scripts/v2/poki-sdk.js"></script>
<!-- after -->
<script src="https://gamealia.app/sdk/poki.js"></script>
gamealia init --write (or gamealia_integrate_sdk) does it for you, and the MCP prompt migrate-from-poki walks your assistant through the migration. The shim includes the Gamealia SDK, so window.Gamealia is available too.
2. Check the policy
Gamealia's rules are close to Poki's: no external ads, no purchases, no login of your own. See Game requirements.
Method mapping
| PokiSDK | On Gamealia |
|---|---|
PokiSDK.init() | Gamealia.init(), then Gamealia.game.loadingStart() |
PokiSDK.gameLoadingFinished() | Gamealia.game.loadingStop() (required) |
PokiSDK.gameLoadingProgress() | ignored |
PokiSDK.gameplayStart() / gameplayStop() | Gamealia.game.gameplayStart() / gameplayStop() |
PokiSDK.happyTime(intensity) | Gamealia.game.happyTime() |
PokiSDK.commercialBreak(onStart) | Gamealia.ad.requestMidgame(); onStart runs when the ad starts |
PokiSDK.rewardedBreak(onStart) | Gamealia.ad.requestRewarded(); resolves true only when rewarded |
PokiSDK.rewardBreak(onStart) | same as rewardedBreak |
PokiSDK.getLanguage() | the player's language as a lowercase base code ("pt" for pt-BR) |
PokiSDK.shareableURL(params) | the portal game page, built by Gamealia.room.inviteLink(code) (/game/<slug>?room=<code>). The code is id (or roomId, roomName, room, code, else the first param) and must be 1-32 of A-Z a-z 0-9 _ - (rejects otherwise); other params do not travel. No params: the game page |
PokiSDK.getURLParam(name) | gd<name> (or <name>) from the game URL; for a player who joined from a shared link, the room code for id, roomId, roomName, room and code; "" when missing |
PokiSDK.getUser() | Gamealia.user.get() as { username, avatarUrl }, or null |
PokiSDK.getToken() | Gamealia.user.getToken(); verify it with the Gamealia JWKS, see Player accounts |
PokiSDK.login() | Gamealia.user.requestLogin() |
PokiSDK.openExternalLink(url) | opens url in a new tab |
PokiSDK.setDebug(), connect() | ignored |
PokiSDK.movePill, measure, setPlayerAge, customEvent, muteAd, sendHighscore, enableEventTracking, displayAd, destroyAd | accepted and ignored (one console warning each) |
For invites that land players in the same room, prefer Gamealia.room.inviteLink(code): it builds a portal link (see Multiplayer).