HypercasualGaming SDK
Guide

HypercasualGaming SDK

The SDK is a small JavaScript file your HTML5 game loads to live inside the feed. The website shows your game, pauses it, handles its sound, keeps its high scores and shows ads on top of it — your game only has to say when gameplay starts and stops.

How your game lives in the feed

Players go from one game to the next in the feed. Your game:

What the SDK does for you

How it's integrated

The SDK requires three things, whatever your engine. The rest of the SDK is optional: use it only if your game needs it. Your game also has to meet the requirements.

WhatHow
Load the SDK before your game<script src="/sdk/v1/hg-sdk.js"></script>Required
Gameplay starts or continuesHGSDK.gameplayStart()Required
Gameplay stops (the player loses, pauses or goes to the menu)HGSDK.gameplayStop()Required
Send the score, if your game has oneHGSDK.sendScore(score)Optional
Ask for an ad, if you want to monetizeHGSDK.showAd({ type })Optional

The automatic pause (when an ad is shown, when the player switches games or leaves the website…), the sound, the gestures and the cover work on their own: you don't have to program them. Your game can still have its own pause menu.

What “gameplay” means

Cover→gameplayStart()→playing→gameplayStop()→menu or end screen

Gameplay is the time the player is actually playing. Only then do touches belong to your game, play time counts and, if the player leaves, they'll find “Tap to continue” when they come back. In your menu or end screen, a swipe goes to another game.

Choose your engine

From your game to the feed

1 · Integrate the SDK→2 · Test it in the tester→3 · Submit it for review→4 · Live in the feed

Before submitting your game, check the requirements and how to test and publish it. All the functions are in the reference.