Skip to content
Random game

Coming from CrazyGames

Last updated 2026-11-21

The FreeGames.gg SDK script also sets up window.CrazyGames.SDK (the shape of the CrazyGames HTML5 SDK v3), so a game built for it runs here with one change: the script tag.

Swap the script tag

Remove the CrazyGames script:

<script src="https://sdk.crazygames.com/crazygames-sdk-v3.js"></script>

and put ours in its place, before your game’s scripts:

<script src="https://games.foony.com/sdk/v1.js"></script>

Keep your CrazyGames.SDK calls. Our script only sets up CrazyGames when no other script has, so the CrazyGames script MUST be gone.

Calls that work

Your game calls What it does here
SDK.init() init(). Await it before the other calls, as on CrazyGames
SDK.game.loadingStart() loadingStart()
SDK.game.loadingStop() loadingFinished()
SDK.game.gameplayStart() gameplayStart()
SDK.game.gameplayStop() gameplayStop()
SDK.game.happytime() happyTime()
SDK.ad.requestAd('midgame', callbacks) commercialBreak(). adStarted when the ad starts, adFinished after it. No ad calls adError with code unfilled
SDK.ad.requestAd('rewarded', callbacks) rewardedBreak(). adFinished only when the player earned the reward, else adError with code unfilled
SDK.game.inviteLink({room: 42}) Your game’s page on FreeGames.gg plus the query. Call it after init() has resolved
SDK.game.showInviteButton(params) Returns the same link. No button shows
SDK.game.getInviteParam('room') Reads the query of your game’s frame, or null
SDK.data.setItem(key, value) Keeps the value in the browser, and also calls save.set()
SDK.data.getItem(key), removeItem(key) Read and remove from the browser
SDK.game.settings.muteAudio true while the page’s sound is off. Set from init()
SDK.game.addSettingsChangeListener(listener) Calls listener with the new settings when the page’s sound goes off or on, like audio.onMuteChange()

SDK.environment is 'crazygames', so code that checks for it takes the normal path.

Calls that do nothing here

Your game calls Here
SDK.user.getUser() Resolves null
SDK.user.isUserAccountAvailable false
SDK.user.getUserToken(), showAuthPrompt() Reject with “No CrazyGames account on this site.”
SDK.ad.hasAdblock() Resolves false. A blocked rewarded ad ends in adError anyway
SDK.banner.requestBanner(), requestResponsiveBanner() Resolve and show nothing. The page places its own banners
SDK.banner.clearBanner(), clearAllBanners(), game.hideInviteButton(), data.clear() Nothing

Things to change

  • User accounts. CrazyGames’ user module has no account here. Players have a Foony account instead: use the player token from FreeGamesSdk.init() to know who is playing. A game that needs a CrazyGames account to play MUST work without one.
  • The ad rules are ours. The first game of a visit has no interstitial, and ads are at least 120 seconds apart (see Ads). Many requestAd('midgame') calls end in adError with unfilled. Treat it like a finished ad and go on.
  • Engine plugins. We have tested the adapter with the HTML5 SDK calls only. The CrazyGames plugins for Unity, Godot and other engines aren’t tested yet. For those engines, follow our engine guides instead.

Test it

Load the build in the Inspector. The event log shows the FreeGames.gg call each CrazyGames.SDK call turns into.