Publishing a game
Players can open your game from a single link. Install the Deja CLI, claim a namespace, then publish an HTML game folder or a game you already host.
Claim your namespace
Choose an available namespace with lowercase letters, digits, and hyphens. Replace your-studio with the name you want.
namespace=your-studio
deja publisher signup "$namespace"Deja saves the publishing credential in your operating system’s credential store. Back up the recovery file identified by the command. CI can use DIST_TOKEN.
API signup for automation
Choose an available namespace with lowercase letters, digits, and hyphens. The signup endpoint accepts an empty POST and returns a publishing token and a recovery code. This example uses curl and jq; replace your-studio with your namespace.
namespace=your-studio
publisher_api="https://registry.deja.science/v2/publishers/$namespace"
umask 077
key_dir=$(mktemp -d "$HOME/.deja-keys.XXXXXXXX")
curl -fsS -X POST "$publisher_api/signup" -o "$key_dir/signup.json" &&
export DIST_TOKEN="$(jq -er '.token' "$key_dir/signup.json")"
printf 'Credentials saved in %s\n' "$key_dir"Store the returned recovery value in your password manager. Keep the token private and outside your game build. In future sessions, set DIST_TOKEN to the current publishing token.
Publish a native sample on Mac
Use the pinned Orbit sample for this rehearsal. Fetch its archive, then publish it under your namespace.
deja fetch acme/orbit@2.1.0 --out orbit.tar.gz
deja publish "$namespace/orbit-sample" orbit.tar.gz --version 1.0.0 --title "Orbit sample"Send the printed game page URL to a player. They can install Deja and copy the native launch command from that page.
Publish and share
Put index.html at the root of your build folder and use relative asset URLs. Hosted builds support up to 1,024 files, 64 MiB per file and 128 MiB total. Each namespace can reserve up to 512 MiB and 10,000 distinct upload slots across its projects. Identical retries reuse their slot. Set the title, description and controls to describe your game. You can also pass --cover with an HTTPS image URL.
deja publish "$namespace/game" --version 1.0.0 --web-dir web-dist \
--title "Night Flight" \
--description "Land your ship before sunrise." \
--controls "Use the arrow keys to steer."Share the game link printed by the CLI. Its default view follows stable. Select a version in Releases or use Link to this version for a permanently pinned page.
For a game already on your site, use --web-url https://your-site.example/game/ in place of --web-dir web-dist. Allow your game to be embedded by https://deja.science, or players can follow the publisher-site link. For platform-specific archives, add one --native-target PLATFORM=FILE per build (macos-aarch64, macos-x86_64, linux-aarch64 or linux-x86_64). Use a tar.gz with one top-level .app bundle for macOS. For Linux, place one executable with execute permissions at the archive root. The CLI selects the local platform.
Update or roll back
Publish a new version after rebuilding. Include the metadata and targets you want that release to offer. A new release becomes stable by default. To preview a pinned release first, include --no-promote.
deja publish "$namespace/game" --version 1.1.0 --web-dir web-dist \
--title "Night Flight" --description "Land before sunrise." \
--controls "Use the arrow keys to steer."
deja info "$namespace/game"
deja rollback "$namespace/game" --to 1.0.0Use deja releases "$namespace/game" to list versions. Rollback moves the stable channel for both browser and native builds. An already-open hosted game keeps its release URL. Publisher-hosted content is controlled by its host.
Update project defaults
To give existing releases a title, description, controls, and cover, send a JSON object to the metadata endpoint with the publishing token. Fields supplied when publishing a release take precedence.
curl -fsS -X PUT -H "Authorization: Bearer $DIST_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"title":"Night Flight","description":"Land before sunrise.","controls":"Use the arrow keys to steer."}' \
"https://registry.deja.science/v2/$namespace/game/metadata"Manage your keys
Use the same publisher_api and private key_dir from signup. These operations change credentials immediately.
- Rotate the publishing token
- Authenticate with the current publishing token. Save the new token and update its consumers.
rotation_file=$(mktemp "$key_dir/rotation.XXXXXXXX")
curl -fsS -X POST -H "Authorization: Bearer $DIST_TOKEN" \
"$publisher_api/rotate" -o "$rotation_file" &&
export DIST_TOKEN="$(jq -er '.token' "$rotation_file")"- Revoke the publishing token
- Disable the current token. Use your recovery code to regain publishing access.
curl -fsS -X POST -H "Authorization: Bearer $DIST_TOKEN" \
"$publisher_api/revoke"- Recover the namespace
- Authenticate with the current recovery code. The response contains a new publishing token and a new recovery code. Store both.
recovery=$(jq -er '.recovery' "$key_dir/signup.json")
recovery_file=$(mktemp "$key_dir/recovery.XXXXXXXX")
curl -fsS -X POST -H "Authorization: Bearer $recovery" \
"$publisher_api/recover" -o "$recovery_file" &&
export DIST_TOKEN="$(jq -er '.token' "$recovery_file")"
unset recoveryFor subsequent recoveries, read the recovery code from the latest successful recovery response or your password manager.
Unlist or report a game
To remove your project from the catalog, send an authenticated unlist request.
curl -fsS -X POST -H "Authorization: Bearer $DIST_TOKEN" \
"https://registry.deja.science/v2/$namespace/game/unlist"Visitors can use Report this game on a game page. The public POST /v2/{namespace}/{project}/report endpoint also accepts JSON with a reason field. To review reports for your own game, send an authenticated GET /v2/{namespace}/{project}/reports request.