Skip to content

Local Development

You do not need to upload a build to work on your integration. The SDK runs on your own machine, and sign-in works there too.


Running your game locally

Serve the game over HTTP and open it in a browser. Any port, any path.

If you do not already have a server running, this works in any folder:

python3 -m http.server 8000

Then open http://localhost:8000.

Opening the file directly will not work

Double-clicking index.html, or otherwise opening it as file:///…, gives a page with no working SDK. Browsers refuse the requests it needs to make from a file:// origin, and there is nothing the SDK can do about it.

Symptoms look like a broken integration rather than a blocked one, so this is worth ruling out first. Serve the folder over HTTP instead.


Signing in while developing

Sign-in from your own machine is always allowed — localhost needs no setup at all.

Anywhere else is a different origin, and origins have to be known to Y8 before they may sign players in. That covers the cases where you are not on localhost:

  • testing on your phone,
  • running through a tunnel such as ngrok,
  • opening the game from another machine on your network.

Add the address in the Y8 Developer Portal, under Development Origins on your game's SDK Initialization tab, and sign-in starts working from it while you develop. Enter the scheme and host the game is served from — any path is ignored. localhost and 127.0.0.1 already work and need not be added.

Development origins expire after 30 days

Each one stops working 30 days after you add it. Extend it from the same list whenever you still need it — and add a tunnel's new address whenever the tunnel gives you one.

They apply to your published game too. A live game that signs players in from a development origin stops being able to the day it expires; a game that loads from your own server needs a permanent address instead, which Y8 support adds for you.

Auto sign-in is a separate matter

Players are not signed in automatically while your game runs anywhere other than its Y8 page — including localhost and registered development addresses. Your game starts anonymous there, and nothing you configure will change that.

This is not a fault in your integration. Automatic sign-in relies on a check the browser only permits from the Y8 site itself.

Signing in explicitly works exactly as it will in production: call the login method and the sign-in window opens as normal. Call it straight from the click that asked for it — off the Y8 page that window is a popup, and a browser blocks one that is asked for too late. Once your game is live on its Y8 page, automatic sign-in resumes.

So while developing, expect to press your own sign-in button. Which is worth doing anyway — most of your players will arrive signed out, and that path deserves as much testing as the signed-in one.


Before you upload

  • Play through once without signing in. Anonymous players are the majority; the game should be enjoyable for them.
  • Request an ad break twice in quick succession. Once the first one has shown an ad, the second is frequency capped, and you want to be sure that leaves the game running rather than paused. A first break that showed nothing does not start the cap.
  • Check that a failed save is visible to the player rather than silent.

Interstitials and banners served while your game is in draft or in review are Y8's own house ads — or Google's test ads, on games whose ads run through AdSense for Platforms — switched on for you automatically. There is no test flag to set and none to remember to remove later. In those builds a break that shows no ad also opens a panel over the game saying why; live games never show it.