If your game is written in JavaScript, it already runs in the browser — no compilation, no SDK package, no build step. Wavedash injects WavedashJS into the page before your code runs.
Setup
Create a web/ folder with two files:
web/index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My Game</title>
<style>
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #111; }
#gameCanvas { width: 100%; height: 100%; display: block; }
</style>
</head>
<body>
<canvas id="gameCanvas"></canvas>
<script type="module" src="./main.js"></script>
</body>
</html>
web/main.js
const WavedashJS = await window.WavedashJS;
const canvas = document.getElementById("gameCanvas");
const ctx = canvas.getContext("2d");
// ... game setup ...
WavedashJS.updateLoadProgressZeroToOne(1);
WavedashJS.init({ debug: true });
let last = performance.now();
(function loop(now) {
const dt = Math.min(0.05, (now - last) / 1000);
last = now;
update(dt);
draw();
requestAnimationFrame(loop);
})(last);
Call updateLoadProgressZeroToOne(...) with intermediate values during async asset loading. init() automatically signals load completion, so call it last.
window.WavedashJS is a Promise injected by wavedash dev. type="module" on the script tag gives you top-level await.
wavedash.toml
game_id = "YOUR_GAME_ID_HERE"
upload_dir = "./web"
SDK features
Once initialized, WavedashJS exposes leaderboards, achievements, stats, and user data:
const user = WavedashJS.getUser();
await WavedashJS.uploadLeaderboardScore("high-scores", score, true);
WavedashJS.setAchievement("first_clear");
await WavedashJS.storeStats();