How to playtest your game without sharing source code
Updated · 2 min read
To playtest a game without sharing your source code, separate where your repo lives from where your compiled build is hosted, and distribute either a compiled browser bundle behind a private/invite link or a native desktop export. Playtesters should only ever receive the built output—never access to your Git repository.
1. Keep your repository private and deploy only the build output
If you use GitHub, GitLab, or Pita, keep the source repository private. Only the compiled output folder (dist/, build/, or your engine's WebGL/native export) should be uploaded to your playtest host.
A few practical checks before sharing a web build:
- Disable source maps in production builds. In Vite,
build.sourcemapdefaults tofalse, which prevents original TypeScript source files from being bundled alongside minified JS. Double-checkvite.config.tssosourcemap: trueisn't left on by accident. - Never put API keys or database credentials in client code. Anything prefixed with
VITE_or embedded in browser JS is readable in DevTools. Keep secrets on your game server. - Understand what is still visible in browser games. Even without source maps, browser JS, WebAssembly, and textures are downloaded to run in the player's browser. Minification and bundling make code harder to read, though not impossible to reverse-engineer—true secrecy for game logic (anti-cheat, economy rules, hidden state) belongs on a server.
2. Choose a private sharing method with low tester friction
How you share the compiled build makes a big difference in how many people actually test it:
- itch.io Restricted page: Upload your compiled HTML5 zip or desktop binaries, set visibility to Restricted, and set a secret URL or password. Testers don't see your repo, and you can revoke the secret link later.
- Steam Playtest (for desktop games): If you already have a Steam app ID, Steam's built-in Playtest feature distributes compiled desktop builds to invited accounts without exposing your source.
- Private invite links on Pita: On Pita, your git repo and workspace stay restricted to the collaborators you add, while playtesters only see a clean Player view. Keep sharing set to Invite link only so only people with your invite link can launch the game—no account creation required—and rotate or disable the invite link whenever a playtest window ends.
3. Separate playtest builds from your live build
If you already have players on a stable build, avoid overwriting it during an experimental playtest. Publish experimental changes to a separate staging URL or environment (for example pita publish --to playtest --create on Pita—up to 10 isolated environments per game on Basic—or a preview branch on a static host) so testers can try new mechanics without affecting your main link or production SQLite database.
FAQ
Can I add a collaborator who can push code without giving playtesters repo access?
Yes. Keep code collaborators and playtesters separate. On Pita, developers added as game members get git and workspace access, while playtesters using an invite link only see the Player view and cannot access your repo, logs, or secrets.
Is a compiled WebAssembly (Godot, Bevy, Unity WebGL) build safer than JavaScript?
Compiled .wasm binaries are much harder to read casually than plain JavaScript, though they can still be disassembled. For single-player indie games, disabling source maps and keeping your Git repo private is the standard level of protection.