Publishing
A PlayCanvas app is a web page: an index.html file and the scripts and assets it loads. To publish one, you make a build, a folder of files that runs on its own, and put it where players can open it. Nothing runs on a server, so any web host can serve a build, and platforms for browser games can host it for you.
Making a Build
How you make a build depends on how you build your app:
- Editor: publish a build to PlayCanvas Hosting at a link you can share, or download it as a static website to host anywhere else. Editor Publishing covers both.
- Engine, React and Web Components: run your bundler's production build. In a Vite project, including one made with create-playcanvas,
npm run buildwrites the build to thedistfolder. - Without a bundler: the build is the folder that contains your
index.html, as in the Web Components Getting Started examples.
Where to Publish
| Page | What it covers |
|---|---|
| Web Hosting | Putting a build on your own server or a static hosting service, testing it locally, and serving its assets from a content delivery network (CDN). |
| Embedding in a Web Page | Showing an app inside another page with an iframe, and passing messages between the page and the app. |
| Wavedash | A platform for browser games, with player accounts, leaderboards and multiplayer lobbies. |
| heyVR | A platform for WebXR games that players open on VR headsets and other devices. |
| Snapchat Web Lenses | Running a game inside Snapchat as a Lens. |
| Mobile Apps | Wrapping a build in a native app for the Apple App Store and Google Play. |
| Desktop Apps | Packaging a build as a Windows, macOS or Linux app. |
The Editor can also export a project as a playable ad for Facebook and Snapchat.
Before You Publish
- Test the build, not just your development version. Serve the build locally and open it on the devices your players use. In the Editor, the Launch Page opens on phones and tablets as well as your desktop.
- Keep the download small. Texture compression and the other load-time tips matter most on phones. In a bundler project, Bundle Size and Tree Shaking explains how to ship only the parts of the engine your app uses.
- Show progress while it loads. Editor builds show a loading screen that you can replace with your own.