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 your game's SDK Initialization tab, and sign-in starts working from it while you develop.
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. 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. The second is frequency capped, and you want to be sure that leaves the game running rather than paused.
- Check that a failed save is visible to the player rather than silent.
Ads served while your game is in review are Google's test creatives, switched on for you automatically — there is no test flag to set and none to remember to remove later.