Start here
Getting started
Add the SDK with a script tag or npm, connect, and test on your own computer before you upload.
1. Add the SDK
With a script tag (HTML5, Construct 3, Godot and Unity templates): put arcade-sdk.min.js (8.5 KB) next to your index.html and load it before your game.
<script src="arcade-sdk.min.js"></script>
<script src="game.js"></script>With npm, for bundled games (Phaser, PixiJS, Vite, webpack):
pnpm add @arcade/sdkimport { ArcadeSDK, ArcadeError } from '@arcade/sdk';2. Connect and use it
const sdk = new ArcadeSDK();
const info = await sdk.ready(); // { mode: 'arcade' | 'local', signedIn, permissions }
const player = await sdk.player.get(); // null for a guest
const state = (await sdk.save.get('state')) ?? { level: 1, coins: 0 };
// When the player finishes a level:
await sdk.save.set('state', state);
sdk.events.track('level_completed', { level: state.level });
await sdk.score.submit(state.coins);3. Test on your own computer
Open your game outside ARCADE (for example index.html from disk, or your engine's preview) and the SDK switches to local mode after 1.5 seconds:
- Saves go to your browser's
localStorage. - Scores, events and ads are printed to the console.
player.get()returns a "Local tester", andinfo.modeis'local'.
The same code works unchanged once the game is uploaded to ARCADE.
4. Upload
ZIP your game with index.html at the top level, including arcade-sdk.min.js. Every upload is scanned for malware and checked before it can go live.