Developer guidelines
What your build needs, how to connect it to GameCraft, and what happens after you upload.
Build requirements
Upload a single .zip file containing an HTML5 game.
- index.html at the root of the zip. If everything is inside one folder, we use that folder as the root.
- Up to 250 MB zipped, 500 MB unpacked, 5,000 files, and 100 MB for any one file.
- Use relative paths (
assets/hero.png, not/assets/hero.png). Each version is served from its own folder. - Pre-compressed
.brand.gzfiles (as Unity and Godot export them) are served with the right encoding. - Bundle everything. Loading code or assets from other sites is flagged in review, except fonts and the GameCraft SDK.
- No executables, symbolic links or files outside the game folder.
- Games run in a sandboxed frame on a separate domain. Popups, top-level navigation and cookies are blocked; use the SDK to save progress.
- Support both keyboard and touch if you tick “Playable on phones”.
Using the SDK
Add the SDK before your game code. It creates a global GameCraft object.
<script src="http://localhost:3400/sdk/v1/sdk.js"></script>Report loading, then call gameplayStart() when the player is actually playing:
const sdk = window.GameCraft;
await sdk.init(); // never throws; works offline too
sdk.game.loadingStart();
await loadAssets((p) => sdk.game.loadingProgress(p)); // 0..1
sdk.game.loadingStop();
function startRound() {
sdk.game.gameplayStart(); // player is in control
}
function endRound() {
sdk.game.gameplayStop(); // menus, game over, level select
}Respect pause and mute requests from the site (for example during ads):
sdk.on('pause', () => game.pause());
sdk.on('resume', () => game.resume());
sdk.on('mute', ({ muted }) => audio.setMuted(muted));Save progress for signed-in and guest players. Each game has slots 0–9, up to 256 KB each:
await sdk.data.save(0, { level: 4, coins: 120 });
const progress = await sdk.data.load(0); // null when emptyAds are optional. Midgame ads show at natural breaks; rewarded ads give the player something in return:
const { rewarded } = await sdk.ad.requestAd('rewarded', {
onStart: () => game.pause(),
onFinish: () => game.resume(),
});
if (rewarded) player.addLife();Leaderboards and achievements
Declare them on your game’s page in Studio first. Each has a key you use in code. Scores outside the leaderboard’s range are refused, and a score must come from a play session that started at least 5 seconds earlier, so call gameplayStart() when play begins.
// At game over. GameCraft keeps each player's best score.
const { best, isNewBest, rank } = await sdk.leaderboard.submit('high_score', score);
if (isNewBest) showBanner(`New best! You are #${rank}`);
// Let players open the leaderboard next to your game.
sdk.leaderboard.show('high_score');
// Unlocking twice is harmless; players see a toast the first time.
await sdk.achievement.unlock('first_win');For times or move counts, set “Best score is: Lowest” and submit whole numbers (for example milliseconds). Guests can hold scores too; they keep them when they create an account.
Test mode: add ?gc_test=1 to your build’s URL (the “Test this build” link does this) to see every SDK call in a small panel inside the game.
Unity and Godot
- Unity (WebGL): copy
GameCraft.jslibandGameCraftSDK.csintoAssets, add the SDK script tag to your WebGL template, then callGameCraftSDK.Instance.Init(),SubmitScore(key, score)andUnlockAchievement(key). - Godot 4 (Web export): copy
addons/gamecraft, enable the plugin, put the SDK script tag in the export’s Head Include, then useawait GameCraft.submit_score(key, score). - Both are in the GameCraft repository under
packages/sdk/engines, each with a README. In the editor every call is a safe no-op.
Automatic checks
Every upload is checked within a few minutes. A build fails, and must be fixed, if:
- the zip is damaged, too large, or has no index.html;
- it contains unsafe paths, links or executable files;
- antivirus finds a threat;
- the game does not load in Chrome on desktop or mobile size.
Warnings do not block review, but reviewers read them: a missing SDK, gameplayStart() never called, a blank screen after 8 seconds, script errors, other sites contacted, tracking or ad scripts, and another portal’s SDK. The report includes screenshots and a link to test the exact build.
Review and publishing
- Builds that pass are reviewed by our team, usually within two working days.
- If changes are needed, you get a notification and an email with the reviewer’s notes. Upload a new version once you have fixed them.
- Approved builds go live automatically within a minute. Players get the new version next time they start the game.
- Studio owners can make any previous version live again from the game’s Builds list. This takes effect immediately without another review.
- Only one build per game can be in progress at a time. Withdraw it to upload another.
Content rules
- You must own or have licensed everything in the game.
- No sexual content, hate, real-world gambling, or content targeting children with ads.
- Violence and horror are allowed if the description and tags say so.
- No third-party ads, crypto miners, analytics that track players, or links to other portals.
- Titles, covers and descriptions must match the game.