Publishing /Builds

Publishing

Builds

A build is a saved, hosted snapshot of your compiled game with its own URL. Share it as a game-only page, embed it, or run it as a Discord Activity.

When you share a codetoy normally, people see your code and the preview side by side. A build is just the game: your compiled WebAssembly captured at a moment in time, hosted at its own address on codetoy.dev.

Text
https://<build-id>.codetoy.dev/

Each build gets its own URL, and a build never changes. Keep editing your codetoy as much as you like: existing builds keep running exactly the version you captured. When you're ready to ship an update, capture a new build.

Builds require AssemblyScript

Builds are made from the compiled .wasm, which today only AssemblyScript produces. For C# and Python codetoys the Builds panel shows “Only available for AssemblyScript projects.”

#What builds are for

  • Share a clean, playable game. No editor, no code, the game fills the whole page.
  • Discord Activities. Discord loads your game from its build URL.
  • Embedding a game-only iframe on your own site.
  • Versioning. Each build is a labeled checkpoint with a message and release notes, so you can keep a known-good version live while you experiment.

#Create a build

You can only create builds for your own, saved codetoys.

#Open the Builds panel

Open your codetoy in the editor and press ▶ Play to make sure the latest code compiles and runs. Then click the Publish button (the box icon) in the tab bar above the code, next to Docs.

#Click New Build

Write a commit message saying what changed, for example "Add double jump and fix wall clipping". It must be 11 to 200 characters.

Optionally add release notes (up to 2,000 characters): what's new, known issues, controls.

#Capture & Save

Codetoy captures what the preview is currently running (the compiled build.wasm and its instantiate.js loader), uploads it, and adds the build to the top of the list.

Run before you capture

A build captures the last version you ran, not unsaved code in the editor. Press ▶ Play right before Capture & Save so the build includes your latest changes.

#Open and share a build

Each build in the list shows its address, like 3f9c2a1e.codetoy.dev. That's shortened for display; the link points to the full address with the complete build id:

Text
https://3f9c2a1e-7b4d-4c1a-9e8f-2d6b5a0c4e71.codetoy.dev/

Click the address to open the build in a new tab, or right-click it and choose Copy Link to share it. Anyone with the link can play. They don't need an account and never see your code.

#Updating a build

Builds are immutable, so "updating" means capturing a new one:

  1. Make your changes and press ▶ Play.
  2. Capture a new build with a message describing the change.
  3. Share the new build's URL. Anywhere you used the old one (a Discord URL mapping, an embed, a link in a post) needs the new URL too.

The old build keeps working until you delete it, so people mid-game aren't interrupted.

#Download build files

Each build has two download buttons:

File What it is
build.wasm Your game, compiled to WebAssembly.
instantiate.js The loader that connects the .wasm to Codetoy's runtime (canvas, input, time).

Downloads are only available to the build's owner. They're useful for keeping an archive of releases.

Self-hosting

codetoy.dev serves your build together with Codetoy's runtime, which provides the canvas, input and timing. The downloaded files need that runtime to run, so hosting them yourself isn't officially supported yet. For now, link to or embed the build URL instead.

#Delete a build

Click the trash icon on a build and type your codetoy's name to confirm. Deleting is permanent. The build URL stops working immediately for everyone, including any Discord Activity or embed that uses it.

#Limits and details

Language AssemblyScript only
Who can create The codetoy's owner, on a saved codetoy
Commit message 11–200 characters, required
Release notes Up to 2,000 characters, optional
Visibility Anyone with the URL can play
URL format https://<build-id>.codetoy.dev/
Contents Compiled build.wasm + instantiate.js (your source code isn't included)

#Troubleshooting

The Publish button doesn't appear. It only shows on codetoys you own, after they're saved. Forks of other people's codetoys are yours once you save them.

"Only available for AssemblyScript projects." Builds need AssemblyScript. Create a new codetoy with the AS language and move your code over.

"Message must be more than 10 characters." Commit messages need at least 11 characters. Describe what changed.

"Could not get build. Request timed out." The preview isn't running a compiled program. Press ▶ Play, wait for it to start, then try again.

My build shows an old version. You captured before running your latest code. Press ▶ Play, then capture a new build.

#Next steps

Esc