Skip to content
izy.gg
··

izy.gg SDK documentation

One script tag gives your HTML5 or WebGL game ads that pay you, cloud saves, the player's language and sound control. The SDK has no dependencies and also works outside izy.gg, so you can develop locally.

Quick start

Add the script to your index.html and call IzySDK.init() once. It always resolves: on izy.gg it connects to the site, anywhere else it runs standalone with test ads and local saves.

<script src="https://izy.gg/sdk/v1.js"></script>
<script>
  (async () => {
    const izy = await IzySDK.init();   // always resolves, also outside izy.gg

    // Language and sound from izy.gg
    game.setLanguage(izy.locale);      // "en", "ru", …
    game.mute(izy.muted);
    izy.on("audio", ({ muted }) => game.mute(muted));

    // Loading screen
    izy.loading(40);                   // 0..100
    await game.load();
    izy.ready();
  })();
</script>

API reference

Everything is on the object returned by IzySDK.init():

  • izy.locale: the player's language on izy.gg ("en", "ru", …).
  • izy.device: "desktop", "mobile" or "tablet".
  • izy.user: { name, avatar } of the signed-in player, or null.
  • izy.muted: whether the player muted the site. izy.on("audio", ({ muted }) => …) tells you when it changes.
  • izy.test: true outside izy.gg and in the portal preview (ads are test ads, nothing is counted).
  • izy.loading(progress) and izy.ready(): drive the izy.gg loading screen.
  • izy.gameplayStart() and izy.gameplayStop(): tell izy.gg when real gameplay runs. Ads never interrupt gameplay.
  • izy.ads.interstitial() and izy.ads.rewarded(): see Ads below.
  • izy.save(data) and izy.load(): see Saves below.
  • izy.happyTime(): a moment of joy, like a record or a cleared level.
  • izy.on("pause" | "resume", callback): around every ad. Mute and pause your game on "pause".

Ads

Interstitials show between levels or after a game over. izy.gg protects players: no interstitial in the first 90 seconds and at most one every 2 minutes, whatever your game asks for. Call it at natural breaks and carry on when the promise resolves.

Rewarded ads must always be the player's choice (a button with a clear reward) and the reward is given only when the promise resolves to true.

// Between levels: izy.gg decides if an ad fits (at most one every 2 minutes)
izy.gameplayStop();
await izy.ads.interstitial();          // → true if an ad was shown
izy.gameplayStart();

// Only when the player taps "Watch an ad for +1 life"
if (await izy.ads.rewarded()) {        // → true only if watched to the end
  player.lives += 1;
}

// izy.gg pauses your game around every ad
izy.on("pause", () => game.pause());
izy.on("resume", () => game.resume());

Cloud saves

Signed-in players keep their progress on every device; guests keep it in the browser. Always await load() before starting the first level.

// Any JSON up to 256 KB. Signed-in players get it on every device.
await izy.save({ level: 7, coins: 1200 });

const progress = await izy.load();     // → your object, or null
if (progress) game.restore(progress);

Unity, Phaser, Construct, Godot

The SDK is plain JavaScript, so any engine with an HTML5 export can use it. Unity WebGL builds call it through a .jslib plugin:

// Assets/Plugins/WebGL/izy.jslib
mergeInto(LibraryManager.library, {
  IzyInterstitial: function () {
    IzySDK.init().then(function (izy) {
      izy.ads.interstitial().then(function () {
        SendMessage("IzyBridge", "OnAdDone", "");
      });
    });
  },
  IzyRewarded: function () {
    IzySDK.init().then(function (izy) {
      izy.ads.rewarded().then(function (ok) {
        SendMessage("IzyBridge", "OnRewarded", ok ? "1" : "0");
      });
    });
  },
});
// Add <script src="https://izy.gg/sdk/v1.js"></script> to your WebGL template's index.html.

// Phaser
this.sound.mute = izy.muted;
izy.on("audio", ({ muted }) => (this.sound.mute = muted));

// Construct 3: call the functions above from "Execute JavaScript" actions.
// Godot (HTML5 export): JavaScriptBridge.eval("IzySDK.init().then(i => i.ads.interstitial())")

Build requirements

  • A zip with index.html at the root (or inside a single folder). Up to 100 MB packed, 300 MB unpacked and 3000 files.
  • Relative paths only; everything the game needs is inside the zip. Load nothing over plain http.
  • No executables or server-side scripts (.exe, .php, .sh and the like are rejected).
  • No analytics, trackers or ads of your own: izy.gg handles ads, and players' privacy is protected by our consent rules.
  • Fits any window size and works with touch if you mark it as mobile-friendly. Your game runs in a sandboxed frame on games.izy.gg.
  • Unity WebGL: Brotli or Gzip compression is fine, decompression fallback is not needed.

Testing

Locally: open your index.html from any local server. The SDK runs standalone, shows a 3-second test ad overlay and resolves rewarded ads with true.

In the portal: after uploading a build press Test the build. It runs exactly as on izy.gg, with test ads, before you send it for review.

Review

Every new game and every new version is checked by a person, usually within 2 working days. We reject games that:

  • do not load, crash, or are unplayable on the devices they claim to support;
  • contain malware, cryptocurrency miners, phishing or hidden redirects;
  • show adult, hateful or illegal content, or use assets you have no rights to;
  • show their own ads, links to other game sites or ask for personal data;
  • abuse rewarded ads or force players to watch ads.

Earnings and payouts

You earn your revenue share (70% by default) of the ads shown inside your games. Earnings appear daily in the portal; the last two days are estimates and are fixed within 48 hours.

Request a payout from the Earnings page once your balance reaches the minimum (50 USD by default). We pay within 10 working days by PayPal, Payoneer, Wise, USDT (TRC-20) or bank transfer.

Help

Questions about the SDK, review or payouts: direct@izy.gg.