GameMondi.com
Search
K

SDK for HTML5/JS

GameMondi.com SDK for HTML5 games. This allows you to display advertisements in the games published within the GameMondi.com network.

Implementation

Embed script to your project.
Implement the following snippet within your game or within the <script> section of your index.html.
window.SDK_OPTIONS = {
appId: "[YOUR GMD GAME ID]",
onEvent: function (a) {
switch (a.name) {
case "SDK_READY":
// when sdk is ready
break;
case "SDK_APP_START":
// advertisement done, resume game logic and unmute audio
break;
case "SDK_APP_PAUSE":
// pause game logic / mute audio
break;
case "REWARDED_SLOT_GRANTED":
// player successfully complete watch the rewarded ad
break;
case "REWARDED_SLOT_CLOSED":
// player close the reward ads before complete
break;
}
},
};
(function (a, b, c) {
var d = a.getElementsByTagName(b)[0];
a.getElementById(c) ||
((a = a.createElement(b)),
(a.id = c),
(a.src = "https://sdk.gamemondi.co/library.min.js"),
d.parentNode.insertBefore(a, d));
})(document, "script", "gamemondi-sdk");

Invoke an advertisement

Now you must call GMD_SDK.showAd() at the appropriate time in your game to show ads.
GMD_SDK.showAd({ type: "preroll" }); // type: preroll / midroll / rewards
  • Pre-roll: an ad shown before the user starts playing the game.
  • Mid-roll: an ad shown in between game sessions.
  • Reward ads: users can watch an in-game video and receive rewards.

Example

GameMondiSDKdemo.zip
479KB
Binary

Support

If you have any technical questions or comments, please email us at: [email protected]
Last modified 1mo ago