Skip to main content

Publishing on Wavedash

Wavedash is a platform for publishing browser games. It hosts your game, and its SDK adds features such as player accounts, achievements, leaderboards, cloud saves and multiplayer lobbies.

This page covers projects built with the Editor, the Engine, React and Web Components. Wavedash's own PlayCanvas guide walks through an Engine project built with Vite.

Publishing Flow​

To publish your game on Wavedash, follow these steps:

  1. Install the Wavedash CLI and create your game
  2. Call Wavedash.init() when your game is ready
  3. Build your project
  4. Test and upload the build
  5. Publish!

1. Install the Wavedash CLI and create your game​

Install the CLI by following Wavedash's installation guide, then sign in:

wavedash auth login

Create your game in the Developer Portal, or from the command line with wavedash team create and wavedash project create (see the CLI commands). Make a note of the game ID, which you'll need in step 4.

2. Call Wavedash.init() when your game is ready​

Wavedash shows its own loading screen until your game calls Wavedash.init(), so your game stays hidden until then. Call it once the assets your first scene needs have loaded.

When your game runs on Wavedash, the platform defines a global window.Wavedash object before your code starts, so there is nothing to install. Writing the call as window.Wavedash?.init() makes it do nothing on other hosts, so the same build still works on PlayCanvas Hosting or your own server.

Create a script with the following code and attach it to an entity in your first scene, such as the Root entity:

import { Script } from 'playcanvas';

export class WavedashInit extends Script {
static scriptName = 'wavedashInit';

initialize() {
window.Wavedash?.init();
}
}

initialize() runs after the preloaded assets have loaded and the scene has been created, so your game is ready to be shown.

To show your game's loading progress on the Wavedash loading screen, forward the preload progress from a custom loading screen script:

app.on('preload:progress', (value) => {
window.Wavedash?.updateLoadProgressZeroToOne(value);
});
TypeScript

To give window.Wavedash its types, install the @wvdsh/sdk-js package as a dev dependency and add a type-only import to the file that uses it:

import type {} from '@wvdsh/sdk-js';

Keep the import type-only. Importing the package itself throws an error whenever the game isn't running on Wavedash or in wavedash dev.

3. Build your project​

Download a build of your project with the Download Format set to Static Website. Extract the zip file into a folder named build, which is your upload folder.

4. Test and upload the build​

Next to your upload folder, create a file named wavedash.toml with your game ID, and set upload_dir to the upload folder from step 3:

game_id = "YOUR_GAME_ID"
upload_dir = "./dist"

Wavedash loads index.html from the upload folder by default. Downloaded Editor builds and Vite builds both start from index.html, so no other settings are needed.

To test your game, run:

wavedash dev

This serves your build locally with the Wavedash SDK connected to test data, so you can check that your game appears and that any SDK features work.

When you're happy with it, upload the build:

wavedash build push

This prints a build ID and a playtest URL. Uploading a build doesn't make it live. You can also upload a zip file of your upload folder from the Builds tab of the Developer Portal.

5. Publish​

Before you publish for the first time, fill in your game's Metadata in the Developer Portal. Wavedash lists the details it needs, such as a description, cover art and a preview video, on its publishing page.

Then publish the build using the ID from step 4:

wavedash publish BUILD_ID

You can also click Publish in the Builds tab of the Developer Portal. Your game page goes live straight away. To roll back, publish an earlier build.

Loading Files from Other Servers​

Wavedash serves games cross-origin isolated. Everything in your upload folder works without changes. If your game also loads files from another server, that server must send the Cross-Origin-Resource-Policy: cross-origin and Access-Control-Allow-Origin: * headers, or the browser will block the request. This applies to CDNs, external scripts and import map entries, and any API your game calls. jsDelivr, which the Web Components Getting Started page uses, already sends both headers.

SDK Features (optional)​

The global window.Wavedash object also gives your code access to the rest of the Wavedash SDK, including:

  • Player accounts
  • Achievements
  • Leaderboards
  • Cloud saves
  • User-generated content
  • Paid content
  • Multiplayer lobbies and networking

The SDK functions reference lists every call.