Skip to content
Download all docs .md

The gamefuse hosting Command

The same gamefuse command that uploads Multiplayer room code also uploads hosted games.

npm i -g gamefuse

Commands

Command What it does
gamefuse hosting validate [folder] Runs the check. Uploads nothing.
gamefuse hosting deploy [folder] Runs the check, uploads, makes it live, and prints the address.
gamefuse hosting deploy --no-browser-check Skips the Chrome step of the check. For build servers.
gamefuse hosting status Shows the address, size, number of files, upload time and hits today.
gamefuse hosting open Opens the live game in your browser.
gamefuse hosting rollback Makes the previous upload live again.
gamefuse hosting remove Empties the slot. Players see "This game is not online yet." Asks first.
gamefuse hosting domain add <domain> Starts linking a domain you own and prints the DNS records to create. See Use Your Own Domain.
gamefuse hosting domain status Shows each DNS record as found or not found, and the overall status.
gamefuse hosting domain remove Unlinks the domain. Asks first.

Which folder

When you leave out the folder, the command uses the first of these that has an index.html: dist, then build, then the folder you are in.

Options

Option Meaning
--game <id> Your game's ID, from the dashboard. Otherwise it is read from GAMEFUSE_GAME_ID, then hosting.json.
--key <key> The upload key. Otherwise it is read from GAMEFUSE_UPLOAD_KEY in .env or your environment. The older name GAMEFUSE_MULTIPLAYER_KEY also works.
--json Print the result as JSON, for scripts.

The exit code is 0 when the command worked.

The upload key

Hosting uses the same upload key as Multiplayer: one mpk_... key per game. It is in your game's Hosting tab and Multiplayer tab. It works only for that one game. Keep it out of your game's files and out of public repositories. See Upload Key.

Put it in a .env file in your project folder, and keep that file out of git:

# .env
GAMEFUSE_UPLOAD_KEY=mpk_3f9a1c0b7d2e4f6a8b0c1d2e3f4a5b6c
GAMEFUSE_GAME_ID=123
gamefuse hosting deploy dist

The command reads .env from the folder you run it in, or the nearest folder above it, up to the top of your git project. Variables set in your terminal or build server win over .env, and options like --key win over both. The same .env works for gamefuse multiplayer.

hosting.json

An optional hosting.json in your project remembers the game ID and folder, so gamefuse hosting deploy is enough on its own.

Messages you may see

Message Meaning
"This game is 240 MB. The Basic plan holds up to 100 MB. For larger games, contact us about an enterprise plan: support@gamefuse.co." The build is over your plan's size. See Limits and Plans.
"This looks like your project folder. Upload your build folder, usually dist or build." Build first, then upload the build.
No hosting plan The game needs a hosting plan. Pick one in the Hosting tab.
Over 20 uploads today Each game can upload 20 times a day. Try again tomorrow (UTC).