๐ŸŽฎ
EmilyGaming
Developer Portal
Developer dashboard

Build first. Upload second. Submit scores with a simple API.

EmilyGaming uses a simple API for global scores. Download the starter template before you upload, wire in your game slug, then submit the final score when a run ends.

๐Ÿงฉ

Start with template

Download the starter ZIP and plug in your slug.

๐Ÿ“ฆ

Upload ZIP

Include index.html and all required assets.

๐Ÿ†

Submit final score

Use the API once at game over.

Start with the template before uploading your game.

Starter Template

This is the recommended starting point for new EmilyGaming integrations. Enter your game slug and the template will be configured for you automatically before download.

Use before upload
Slug = your game URL name. Example: modern-defender-fx

Best use

  • โ€ข Download this before building your game
  • โ€ข Replace the sample code with your real gameplay
  • โ€ข Keep the score submit call at real game over

Whatโ€™s inside

starter-game/
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ game.js
โ””โ”€โ”€ README.txt

Global Score API

Use the same route for score submission and leaderboard loading.

No SDK required

Submit score

await fetch('/api/games/YOUR-GAME-SLUG/scores', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer ' + localStorage.getItem('emilygamingUserToken')
  },
  credentials: 'include',
  body: JSON.stringify({
    score: finalScore
  })
});

Get leaderboard

const res = await fetch('/api/games/YOUR-GAME-SLUG/scores', {
  credentials: 'include'
});
const scores = await res.json();

Submit only once

let submitted = false;

async function endGame(score) {
  if (submitted) return;
  submitted = true;

  await submitScore(score);
}

Realtime Multiplayer Standard

All future multiplayer games should use the same SDK and flow: login required, game-specific room key, Create Room, share code, Join Room.

Open Multiplayer Lab

Platform flow

  1. Player A logs in and clicks Create Room.
  2. Game gets a real room code from the server room contract.
  3. Player A shares the code or share link.
  4. Player B logs in and joins with that same room code.
  5. Both players are inside the same realtime room instance.

Load the SDK in your game

<script src="/js/emilygaming-multiplayer-sdk.js"></script>
<script>
  const mp = EmilyGamingMultiplayer.createClient({
    endpoint: "https://rt.emilygaming.com",
    gameKey: "your-game-slug",
    roomName: "game_room",
    maxClients: 8
  });
</script>

Create room and join room

// Host
const created = await mp.createRoom({ username: "HostPlayer" });
console.log("Room code:", created.roomCode);

// Friend
await mp.joinRoom("AB12CD", { username: "GuestPlayer" });

Realtime events

mp.on("presence", (msg) => console.log("presence", msg));
mp.on("input", (msg) => applyRemoteInput(msg));
mp.on("event", (msg) => applyRemoteEvent(msg));
mp.on("state", (msg) => hydrateSnapshot(msg.payload));

mp.sendInput({ moveX: 1, fire: false });
mp.sendEvent("ability", { id: "dash", at: performance.now() });

Game ZIP Requirements

Package your game like a clean browser app so EmilyGaming can extract and serve it correctly.

Required

  • โ€ข A main index.html file
  • โ€ข All CSS, JS, image, and audio assets inside the ZIP
  • โ€ข A browser-playable HTML game

Recommended

  • โ€ข Keep every path relative
  • โ€ข Include a thumbnail image
  • โ€ข Add instructions and controls
Example ZIP structure
my-game.zip
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ css/
โ”‚   โ””โ”€โ”€ style.css
โ”œโ”€โ”€ js/
โ”‚   โ””โ”€โ”€ game.js
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ images/
โ”‚   โ””โ”€โ”€ audio/
โ””โ”€โ”€ README.txt

Best Practices

Do

  • โ€ข Start from the template before upload
  • โ€ข Submit score only when the round is really over
  • โ€ข Use integers for scores
  • โ€ข Keep file paths relative
  • โ€ข Test while logged in

Avoid

  • โ€ข Downloading the template after upload
  • โ€ข Posting a score every frame
  • โ€ข Using floating point score values
  • โ€ข Depending on absolute file paths
  • โ€ข Submitting multiple times per run