# Vortex Arcade game integration guide

Vortex Arcade imports a static browser build from a reviewed Git commit and launches it at `/play/<slug>/`. A game can ship with guest play, cloud saves, reviewed items for Vortex Credits, or online matchmaking. Use the Arcade-injected SDK for these account services.

1. [Prepare a web release](#prepare-a-web-release) with a stable game slug, local assets, and `arcade.game.json` at the repository root.
2. [Integrate the SDK](#integrate-the-arcade-sdk), [set wallet costs](#shared-vortex-credits-and-wallet-costs), and [add cloud saves](#game-currency-and-cloud-saves) for the features your game uses.
3. If the game supports online play, add [matchmaking](#shared-matchmaking) and configure [WebRTC and TURN](#webrtc-and-turn).
4. [Validate the release](#release-checklist), then [run Check release and submit](#submit-through-vortex-arcade).

## Prepare a web release

Your repository needs a static browser build that works from a subdirectory URL. Keep game scripts and their imports local and relative. Put executable script tags directly in the document head or body, and use literal relative URLs for dynamic imports and classic Web Workers. Published exports should use explicit script files instead of import maps or module preload tags. Modules that use `import.meta.url` must be at the release root so their asset URLs survive bundling. The import reports the file and reason if the compiler cannot preserve the export. Provide a cover image in a separate public media folder and keep private credentials on the server.

Commit the browser export, public media, and manifest together. This example uses a ready screen, one paid cosmetic, and a cover kept outside the build directory. [Manifest template](https://github.com/Volcar144/Vortex-Royale/blob/main/arcade/templates/arcade.game.json)

```text
arcade.game.json
web-export/
  index.html
  game.js
  style.css
arcade-art/
  cover.webp
```

```json
{
  "slug": "example-game",
  "title": "Example Game",
  "summary": "Race the clock and beat your best run.",
  "genres": ["Arcade"],
  "tags": ["Single player"],
  "input": "Keyboard and touch",
  "releaseDate": "2026-11-29",
  "buildDir": "web-export",
  "entry": "index.html",
  "mediaDir": "arcade-art",
  "cover": "cover.webp",
  "coverAlt": "A rider approaching a brightly lit finish line",
  "controls": [["Steer", "Arrow keys"]],
  "touchControls": [["Steer", "On-screen arrows"]],
  "launchTest": { "ready": "#menu", "start": "#play", "started": "#game-hud" },
  "creditProducts": [
    { "id": "blue-trail", "name": "Blue Trail", "description": "A blue flight trail", "credits": 250 }
  ]
}
```

| Field | What Arcade expects |
| --- | --- |
| `slug` | A stable unique ID in lowercase letters and digits with optional hyphen separators. Keep it across releases so the listing, purchases, and cloud saves stay under the same game. |
| `title`, `summary`, `genres`, `tags`, `input`, `releaseDate`, `coverAlt` | Catalog copy and metadata. Supply at least one genre and use `YYYY-MM-DD` for the release date. List the inputs the build actually supports. |
| `buildDir`, `entry` | The committed static export directory and its HTML entry path, relative to that directory. |
| `mediaDir`, `cover` | A separate committed directory and a cover path relative to it. Keep the build and media directories disjoint. |
| `controls`, `touchControls`, `modes`, `adapterPath` | Optional control labels, launch modes, and a custom adapter path when required. Standard games can use the injected SDK without an adapter. |
| `launchTest`, `creditProducts` | Optional guest smoke test selectors and the reviewed game store. Cloud saves require no additional manifest field. |

Use relative paths such as `./game.js` and `./assets/cover.webp` inside the build so it runs under `/releases/<slug>/`. Commit runtime dependencies and cover artwork as ordinary files. Test with external networking blocked so a CDN, analytics script, remote font, or API outage cannot stop the game from reaching its menu. Keep startup lightweight, make touch controls fit the embedded viewport, and start audio on a player action. [Packaged Deadshift manifest with products](https://github.com/Volcar144/Vortex-Royale/blob/main/arcade/library/deadshift-block-13/game.json)

Run `npm run scan:game -- <release-directory>` from the Arcade project root to scan an exported game. Include the optional launch adapter when scanning a staged import. The JSON report gives the rule, file and severity. The import workflow scans the pinned source and runs Chromium with guest and synthetic account profiles in a container with networking disabled. It records blocking findings in a draft review PR and links to the report from the submission. Three sensitive findings, counted once per rule per file, pause the import until an Arcade admin or owner approves that commit. The browser check covers startup and the declared launch interaction.

Arcade publishes compiled game code and the artwork declared in the listing. Keep private keys, authoring files and original project archives out of the release. A player can still save any code or assets delivered to their browser. Keep secrets and authoritative wallet and account logic on the server.

After both checks pass, admins and owners can play the scanned build in the submission screen when the release did not need elevated approval. The preview runs as a guest in a separate browser sandbox with a ten-minute link.

## Integrate the Arcade SDK

The release build injects `window.VortexCredits` before your entry page's scripts. In the production player, an imported game runs in a separate-origin iframe. The SDK asks the Arcade page to perform account operations using the player's Arcade session and the launched game's slug. Launch from `/play/<slug>/` to test signed-in features. The raw `/releases/` URL for an imported game can serve guest play. A standalone game export may have no SDK at all.

| SDK call | Result |
| --- | --- |
| `identity()` | `{ signedIn: false }` for a guest. Signed-in players get `{ signedIn: true, userId, username }`. Treat `userId` as opaque and scoped to the game in the imported player. Use `username` for display. |
| `wallet()` | `{ signedIn, balance, checkoutEnabled }` in the imported player. `balance` is shared Vortex Credits. |
| `store()` | `{ game, balance, products, checkoutEnabled }`. Each product has `id`, `name`, `description`, `credits`, `repeatable`, and `owned` with its purchased quantity. Requires sign-in. |
| `purchase(productId, requestId?)` | `{ game, product, balance, owned, checkoutEnabled }`. Here `product` is the purchased ID and `owned` maps product IDs to purchased quantities. Requires sign-in. |
| `buyCredits(packId, requestId?)` | Requests Arcade's top-level Stripe Checkout. Use a fresh wallet read on return to confirm the balance. |
| `gameState.load(account?)` | The signed-in player's current `{ game, balance, data, revision }` snapshot. Pass the game-account ID when syncing queued changes. |
| `gameState.save({ balance, data, revision, account? })` | Replaces the signed-in player's snapshot at the supplied revision and returns the saved snapshot with its new revision. |

Render the menu before waiting on the SDK. Call `identity()` or `wallet()` to decide which account controls to show. Offer a guest route when supported, and direct guests to the sign-in control in the Arcade player for account features. Treat identity lookup errors as temporary service failures and keep any cloud state untouched. Recheck identity on return to the game and before resuming pending writes. On account changes, clear the previous account's state, purchase UI, and pending operations from memory. Use the SDK instead of passing user IDs, session cookies, or payment credentials through your game.

```js
async function loadArcadeShop() {
  const sdk = window.VortexCredits;
  if (!sdk) return { signedIn: false };

  const account = await sdk.identity();
  if (!account.signedIn) return { signedIn: false };

  const store = await sdk.store();
  return { ...store, signedIn: true };
}
```

Call this when opening the shop. Handle a rejected read by showing a retry message while leaving the main game playable.

## Shared Vortex Credits and wallet costs

| Balance | Where to read it | Intended use |
| --- | --- | --- |
| Shared Vortex Credits | `wallet().balance` or `store().balance` after awaiting the call | Reviewed Arcade and game purchases. The Arcade ledger owns the balance. |
| Game coins or other gameplay currency | `gameState.load()`, then read its `balance` | Per-game progression such as coins earned from a run. The save API accepts client-reported values. |

Use distinct labels in the game UI, for example **Vortex Credits** and **Game Coins**. The checked-in wallet gives an account a one-time 1,200-credit welcome grant. Always display the balance returned by the service. The game-facing SDK has no credit-grant operation.

### Price and register game items

List items in `arcade.game.json` under `creditProducts`. A game can register up to 100 products. Use a unique lowercase slug for each `id`, a nonblank `name` of at most 80 characters, and an integer `credits` price from 1 to 100,000. The optional `description` is limited to 300 characters. Purchase and analytics records use the product ID, so keep it stable for the same entitlement. A price or catalog change goes through the regular release review.

```json
{
  "creditProducts": [
    { "id": "blue-trail", "name": "Blue Trail", "description": "A blue flight trail", "credits": 250 },
    { "id": "energy-refill", "name": "Energy Refill", "credits": 80, "repeatable": true }
  ]
}
```

Products default to one-time ownership. `repeatable: true` allows another paid purchase and increments the cumulative purchased quantity each time. If a repeatable item can be consumed, the game must track fulfillment and consumption separately. Use the store as the source of paid entitlements on startup and after purchases. If a release retires a product, plan how existing buyers will keep access before removing it from the manifest because `store()` lists the current catalog. Keep products plainly described and show the exact Vortex Credit price before the player chooses **Buy**.

### Complete and reconcile a purchase

1. On opening the store, call `store()` and display its current prices, balance, and ownership. A balance check in the UI can disable an unaffordable purchase. The service makes the final decision.
2. On an explicit player action, generate a UUID for the purchase and keep it with the account and product while the result is unknown. Allow one purchase in flight. The imported player displays its own confirmation with the registry price.
3. Apply the returned balance and purchased quantities. For a permanent cosmetic, set access from the owned quantity. If a response times out, refresh the store and retry the same purchase only with its original UUID if the player chooses to continue. The same UUID for the same game, account, and product makes a retry safe from a second charge. Use a new UUID for each deliberate new purchase.

```js
const credits = window.VortexCredits;

// Call this through a signed-in shop's Buy button with the UUID for this purchase.
async function purchaseBlueTrail(requestId) {
  const result = await credits.purchase('blue-trail', requestId);
  return {
    balance: result.balance,
    hasBlueTrail: (result.owned['blue-trail'] ?? 0) > 0,
  };
}

// Create once per new purchase. Keep this value if the outcome is uncertain.
const requestId = crypto.randomUUID();
```

Arcade selects the price, checks the balance and ownership, records the purchase, and debits the shared wallet. Declines can include insufficient credits, already-owned items, an unknown product, or a reused request ID for another product. Some embedded purchase errors expose only a message. Display it and refresh the store instead of relying on a specific HTTP status. Keep the paid entitlement in the store's ownership data. For repeatable rewards with gameplay or competitive value, use an authoritative backend to record fulfillment before granting anything. Avoid treating a successful retry as another unit of inventory.

### Offer Arcade credit packs

Credit packs cost real money and credit the player's shared wallet after Arcade confirms payment. The table reflects the repository catalog. Use the prices and quantities shown at checkout for live purchases. The SDK accepts a pack ID and provides no pack-list method. Pack IDs are stable identifiers and may contain numbers that differ from the current grant. [Arcade Credits page](https://vortexgame.win/credits/) · [Catalog source](https://github.com/Volcar144/Vortex-Royale/blob/main/src/catalog.js)

| Pack ID | Credits | Catalog price (GBP) |
| --- | ---: | ---: |
| `p400` | 400 | £2.00 |
| `p1000` | 1,050 | £5.00 |
| `p2800` | 1,920 | £8.00 |
| `p6000` | 2,500 | £10.00 |
| `p14000` | 3,780 | £15.00 |

Before offering an in-game checkout action, require `signedIn` and `checkoutEnabled` from `wallet()`. Save any pending progress before navigating. On the player's click, call `buyCredits(packId, requestId)` with a UUID and handle a rejection by showing the message. Arcade opens checkout by navigating the top-level page. The promise can reject if opening is cancelled, fails, or times out, and has no success result. Stripe-side cancellation is handled by Arcade on return. Refresh the wallet and store when the game loads again or the player reopens the shop. Credits may take time to appear while verification is pending. Spending existing credits can remain available when real-money checkout is disabled.

## Game currency and cloud saves

`VortexCredits.gameState` stores one snapshot per signed-in account and game slug. A new account/game pair returns `{ game: '<slug>', balance: 0, data: {}, revision: 0 }`. Load before writing. The first successful save returns revision 1, and each further successful write increments it. Keep the revision from the most recent load or successful write. `data` is the entire JSON object, so include fields you want to keep.

For queued changes, get the opaque game-account ID from `VortexCredits.identity()`. Pass it to `gameState.load(account)` and send it as `account` in `gameState.save()`. Arcade rejects the operation if the signed-in account has changed.

| Field | Contract |
| --- | --- |
| `balance` | Integer from 0 through 1,000,000,000 for gameplay currency. |
| `data` | JSON object up to 32 KiB (32,768 UTF-8 bytes after serialization). Arrays can be fields within the object. |
| `revision` | Server-managed write version. Send the revision of the snapshot on which your changes are based. |

Save meaningful checkpoints such as a finished run, a level unlock, or an explicit **Save** action. Debounce autosaves and serialize writes in each tab. Show **Saving**, **Saved**, and **Changes pending** according to the result. Keep pending changes until a confirmed save. Prefer saving before navigation, since backgrounding or closing a tab can interrupt the last write.

### Handle concurrent saves

The example keeps the best score from either device and preserves the latest balance and unrelated fields. Call it from a serialized save handler after a completed run. The caller retains the score if the save fails and can offer a retry.

```js
async function saveBestRun(score) {
  if (!Number.isSafeInteger(score) || score < 0) {
    throw new RangeError('Expected a non-negative integer score.');
  }
  const gameState = window.VortexCredits.gameState;
  let base = await gameState.load();

  for (let attempt = 0; attempt < 2; attempt += 1) {
    const bestRun = base.data.bestRun ?? 0;
    if (score <= bestRun) return base;

    const data = { ...base.data, bestRun: score };
    if (new TextEncoder().encode(JSON.stringify(data)).length > 32_768) {
      throw new Error('Game save exceeds 32 KiB.');
    }
    try {
      return await gameState.save({ balance: base.balance, data, revision: base.revision });
    } catch (error) {
      if (error.status !== 409 || !error.state || attempt === 1) throw error;
      base = error.state;
    }
  }
}
```

Use a merge rule that fits each field. A personal best can take the maximum and achievement flags can merge by ID. For balances, consumable inventory, and other counters, record stable event IDs if you intend to replay pending changes. Apply each event once against the latest state. After a network failure, reload and check whether the intended event already landed before adding it again. If the game cannot merge safely, show both versions or ask the player which progress should be kept. Never overwrite a newer cloud save with an old local snapshot on reconnect.

### Plan for updates, offline play, and service errors

- Put a game-owned `schemaVersion` inside `data`. Migrate older saves when loading and preserve unknown fields where possible. Handle a newer format by keeping its saved data intact and asking the player to reload the latest game. The server's `revision` handles concurrent writes.
- Keep cloud writes compact and structured. Use JSON primitives, arrays, and plain objects. Leave headroom for future fields and avoid raw replays, media, secrets, payment data, and unnecessary personal information.
- Store guest progress under a separate local key if the browser allows it. Make guest-to-account import explicit and check the cloud save first. Scope any queued signed-in changes to the opaque account ID and the game, and verify the account before syncing. Allow play even when browser storage is blocked where the game supports that mode.
- On `401`, keep pending changes and ask the player to sign in through Arcade. On `409`, use `error.state` to reconcile. On `400` or `413`, correct the payload or shrink it. On `403`, `404`, or `410`, stop writes and surface the service message. On `503` or a network failure, retain pending progress, then reload and reconcile when the service returns.
- Use cloud saves for player-reported progress. Keep ranked scores, tradeable inventory, economy rules, and other authoritative outcomes on a game backend reviewed by Arcade. Keep wallet entitlements in the Arcade ledger even when local or cloud progress is reset.

## Shared matchmaking

Use the injected `window.VortexMatchmaking` SDK to group signed-in Arcade players and get a roster. Your game provides signaling, connects the roster, and runs the match. Launch from `/play/<slug>/` with separate signed-in accounts to test the full handoff. Keep the game menu and supported guest modes available when the SDK or online services are unavailable.

### Choose the queue

Arcade fills the oldest compatible tickets first. Players are compatible when all of these fields match.

| Join field | Contract |
| --- | --- |
| Game slug | Arcade derives it from the launched game. Each game has its own queues. |
| `queue` | A lowercase slug of at most 48 characters, for example `duel` or `co-op`. Use one name per compatible mode. |
| `version` | A positive safe integer. Bump it when builds use incompatible multiplayer protocols or game rules. |
| `playerCount` | An integer from 2 to 64. Arcade assigns a roster when the queue has the requested number of compatible players. |
| `code` | Omit it or send an empty string for public play. Use 6–24 ASCII letters or digits for a private room. Arcade compares codes case-insensitively. Share a randomly generated code with invited players. |
| `metadata` | Optional JSON object of up to 1,024 UTF-8 bytes. It does not affect compatibility. Use it for public connection identifiers and validate values from other players. Keep credentials and personal data out of it. |

### Manage the matchmaking ticket

| SDK call | Use |
| --- | --- |
| `createTicket()` | Generates the lowercase version 4 UUID for a new search. |
| `join({ ticket, queue, version, playerCount, code?, metadata? })` | Joins the queue. Retry an uncertain join with the same ticket and options. |
| `poll(ticket)` | Checks the ticket and refreshes its heartbeat while waiting. Wait for `pollAfterMs` (currently 2 seconds) between calls. |
| `connection(ticket, outcome)` | Optionally records `'connected'` or `'failed'` for Arcade diagnostics. Report once for a matched ticket before it expires. |
| `leave(ticket)` | Cancels a search or releases the ticket after connecting. Send it before discarding the ticket. |
| `turn(ticket)` | Gets time-limited WebRTC relay credentials for an active ticket. See [WebRTC and TURN](#webrtc-and-turn). |

- **`waiting`** includes `ticket`, `expiresAt`, and `pollAfterMs`. A ticket expires after roughly 30 seconds without a heartbeat. Poll with one loop and one request in flight. On resume from a backgrounded tab, check the ticket before offering to continue.
- **`matched`** includes `ticket`, `matchId`, `expiresAt`, your zero-based `seat`, and the ordered `players` array. Entries include `seat`, `username`, `metadata`, and `left`. Seat zero joined first. Use the two-minute handoff window to connect the roster. If a required player has left, offer a fresh search.
- **`closed`** includes `ticket`. A missing, expired, or cancelled ticket returns this state when polled. Create a new UUID for a new search. All `expiresAt` timestamps are Unix milliseconds.

Each account can have one active ticket per game. A join using a new ticket while another is active returns `409` with `error.ticket`. Offer to resume polling that ticket or cancel it before starting over. A `409` from reusing a ticket for different queue options can omit `error.ticket`. Keep the ticket only as long as the search or handoff needs it. Handle an explicit cancel immediately and let the server expiry cover abrupt tab closes.

### Connect a matched roster

This example hands a matched duel to a game-provided `connect` function and requests TURN during handoff. Have `connect` validate metadata, use `matchId` and the assigned seats in the game's signaling flow, honor cancellation, and resolve when the game's transport is ready.

```js
async function connectDuel({ peerId, code = '', signal, connect }) {
  const matchmaking = window.VortexMatchmaking;
  if (!matchmaking) throw new Error('Open this game from Arcade to play online.');
  signal.throwIfAborted();

  const ticket = matchmaking.createTicket();
  const leave = () => matchmaking.leave(ticket).catch(() => {});
  signal.addEventListener('abort', leave, { once: true });
  try {
    let match = await matchmaking.join({
      ticket, queue: 'duel', version: 1, playerCount: 2, code,
      metadata: { peerId },
    });
    while (match.state === 'waiting') {
      signal.throwIfAborted();
      await new Promise((resolve) => setTimeout(resolve, match.pollAfterMs));
      signal.throwIfAborted();
      match = await matchmaking.poll(ticket);
    }
    signal.throwIfAborted();
    if (match.state === 'closed') return null;

    try {
      if (match.players.some((player) => player.left)) {
        throw new Error('A player left the match.');
      }
      const { iceServers } = await matchmaking.turn(ticket);
      signal.throwIfAborted();
      const connection = await connect({ match, iceServers, signal });
      await matchmaking.connection(ticket, 'connected').catch(() => {});
      return connection;
    } catch (error) {
      if (!signal.aborted) await matchmaking.connection(ticket, 'failed').catch(() => {});
      throw error;
    }
  } finally {
    signal.removeEventListener('abort', leave);
    void leave();
  }
}
```

### Handle matchmaking errors

| Status | Game response |
| --- | --- |
| `400` | Validate the ticket format and join options before retrying. |
| `401` | Prompt the player to sign in through Arcade. |
| `403` | Surface the Arcade message. The player or game may be restricted from matchmaking. |
| `404` or `410` | Stop the search and show that the game is unavailable. |
| `409` | Offer to resume or cancel the existing search if `error.ticket` is present. |
| `503` or network failure | Show that matchmaking is temporarily unavailable. If retrying an uncertain join, reuse the ticket and back off. |

Behind the SDK, the join, poll, leave, and connection operations are JSON `POST` requests under `/api/games/{slug}/v1/matchmaking/`. The body matches the SDK join options for `join`, `{ ticket }` for `poll` and `leave`, and `{ ticket, outcome }` for `connection`. Use the SDK from a game. Arcade supplies the session and the correct origin.

## WebRTC and TURN

TURN relays WebRTC traffic when peers cannot connect directly, for example on a restrictive network. The game's signaling service still exchanges offers, answers, and ICE candidates. Request relay credentials when a WebRTC transport needs them, while the caller's ticket is active and belongs to the same game and signed-in account. Waiting and matched tickets can qualify. Each peer requests its own credentials.

Create, refresh, and release the ticket through the matchmaking SDK. [Manage the matchmaking ticket](#manage-the-matchmaking-ticket)

```js
const { iceServers, expiresAt } = await window.VortexMatchmaking.turn(ticket);
const peer = new RTCPeerConnection({ iceServers });
// Exchange SDP and ICE candidates through your game's signaling service.
```

- Set `iceServers` before ICE gathering starts. For a relay-only test, set `iceTransportPolicy: 'relay'`. With the default policy, WebRTC can choose either direct or relay candidates.
- Use `expiresAt` in Unix milliseconds to decide when to refresh. Arcade issues credentials for up to five minutes and can return cached credentials with less time remaining. Keep credentials in memory and out of logs, room metadata, saved data, and version control.
- Keep the ticket active through signaling and connection setup. Release it after the game transport is ready or the handoff is cancelled. If the game needs a new relay allocation or an ICE restart later, refresh through an active ticket when available or use the game's reconnect flow.
- The underlying endpoint is `POST /api/matchmaking/turn` with JSON `{ game, ticket }`. A `401` requires Arcade sign-in, a `403` means the ticket is inactive, belongs to another game or player, or access is restricted, and a `503` can mean Arcade paused matchmaking or the relay is unavailable. Offer a direct connection only if the game supports that fallback. Otherwise show the error and let the player retry.

## Optional game API Worker

Game API backends are registered by Arcade maintainers. A public route such as `/api/example-game/matches` can map to a private Worker route such as `/api/matches`. Configure the Arcade gateway's `GAME_API_ROUTES` Worker variable and a service binding for the target Worker; keep the target Worker private (`workers_dev = false` and no public route) so callers cannot bypass the gateway's auth and route policy. The target receives `x-vortex-game`, and authenticated routes also receive `x-vortex-user-id` and URL-encoded `x-vortex-username`. The Arcade session cookie and browser Authorization header are stripped before forwarding.

The route config is JSON keyed by game slug. Example:

```json
{
  "example-game": {
    "binding": "EXAMPLE_GAME_API",
    "worker": "example-game-api",
    "auth": "required",
    "routes": [
      { "publicPath": "/matches", "workerPath": "/api/matches", "methods": ["GET", "POST"] }
    ]
  }
}
```

Add the matching `[[services]]` binding to the Arcade Worker's Wrangler config and deploy the backend Worker before the gateway. This route table is deployment-managed; developer-submitted deployments do not receive production bindings automatically.

Example Wrangler binding:

```toml
[[services]]
binding = "EXAMPLE_GAME_API"
service = "example-game-api"
```

Keep the backend Worker private: do not give it a `workers.dev` endpoint or public route. Only the Arcade gateway should be able to invoke it through the service binding.

Use a game backend when your game must verify outcomes or maintain authoritative inventory. Derive identity from the verified gateway context, scope records to the user and game, validate client inputs, and make retries safe. Coordinate the browser call path with Arcade staff. The injected wallet and cloud-save SDK covers Arcade's built-in services. A registered route also needs a supported way for the imported frame to call it.

## Validate the release locally

Build the game, then use a clean commit or release tag containing the manifest, build output, and media. From the Vortex Royale repository root:

```sh
npm --prefix arcade run import-game -- /path/to/game-checkout v1.0.0
npm run build:site
npm run dev
```

The importer resolves the tag to a commit, validates the manifest and required files, stages the release, and updates `arcade/library/<slug>`. Inspect the generated details page, browse card, images, mobile layout, launch path, and any mode selection in the local site preview before publishing.

The local preview defaults to `http://localhost:4173` and uses guest accounts. Use SDK fixtures to exercise account scenarios locally, then verify signed-in behavior through an approved Arcade player build. Use test payment configuration for checkout verification.

To check a basic interaction automatically, add an optional `launchTest` object to `arcade.game.json`. Use CSS selectors for the visible ready state and, when relevant, a start control and the state it reveals.

```json
{
  "launchTest": {
    "ready": "#menu",
    "start": "#play",
    "started": "#game-hud"
  }
}
```

Use a visible `ready` selector on its own for games that start automatically. Provide both `start` and `started` for a click test. The started element must become visible after the click. Use an offline or guest flow for this check.

## Release checklist

| Area | Verify before publication |
| --- | --- |
| Build and catalog | Submit the intended commit with the full export and artwork. Open the listing and player. Check relative URLs, cover text, controls, mobile layout, keyboard focus, and gameplay with external networking blocked during startup. |
| Guest and sign-in | Reach the menu with an absent SDK, as an Arcade guest, and during account lookup failure. Sign in through the player. Switch accounts and verify that cloud state and paid inventory follow the active account. |
| Wallet and store | Compare item prices to the registered catalog. Confirm a one-time item persists after reload. Check cancellation, insufficient funds, and duplicate button presses. Retry an uncertain purchase with the same UUID and verify one debit. For repeatable items, verify that a new UUID records one new purchase and that replaying the old UUID grants no additional item. |
| Credit packs | In an Arcade test environment, verify disabled checkout, successful return, pending payment, and cancellation. Confirm that the UI refreshes the shared balance from the service and shows no credit increase on cancellation. |
| Cloud saves | Save and reload with the same account, open the game from another browser, and verify isolation across accounts. Test a two-tab conflict, a lost response, a save larger than 32 KiB, and migration from the previous release. |
| Matchmaking and TURN | Use two signed-in accounts. Exercise public and invite-code queues, incompatible versions, duplicate joins, cancel, timeout, expired tickets, and a player leaving during handoff. Test a relay-only connection, TURN rejection after release, and the UI when the relay is unavailable. |
| Updates | Re-run the guest launch test and signed-in checks after changes to product IDs, save schema, gameplay logic, or packaged assets. Keep the game slug stable and recheck the exact commit you submit. |

## Submit through Vortex Arcade

Sign in and request developer access. After Arcade approves the account, open the submission page, connect GitHub, select a repository and branch, and choose **Check release**. Arcade checks the manifest, packaged files, and launch HTML before you submit. Fix blocking findings, push to the branch, and check again. The form suggests a title from the manifest and submits the exact checked commit. **Your submissions** shows review status and notes. After changes are requested, **Use this repository** restores the source selection so you can check and submit the updated commit. [Developer registration](https://vortexgame.win/account/developer/) · [Submit a game](https://vortexgame.win/game/submit/)

After an owner approves the source review, the import workflow loads the packaged game in Chromium inside a network-isolated container. It checks that the game displays a launch screen, that packaged startup resources load, and that the page has no uncaught startup errors. It uses a guest Arcade fixture and blocks external networking. A failed check creates a draft import PR with a link to the check run. Review and merge are required for publication.

Include the game's intended age rating, input methods, third-party asset licences, and external services in the review notes. Maintainers review functionality, content rights, loading, accessibility, and the packaged release. For updates, push to the linked branch and keep the same game slug. Arcade checks the new commit and publishes it after the import PR is reviewed and merged.

## Game availability and analytics

Arcade can suspend a game or its online features. Show Arcade's message if the game becomes unavailable and keep supported offline modes available where Arcade permits them. The published catalog registers the game automatically for Arcade game control and analytics.

The Arcade owner can grant a developer access to a published game from **Admin → Developers**. Assigned developers can use `/developer/` to see signed-in players and sessions, game-attributed credit spending, and confirmed credit-pack payments. The player records one session per account per game per 30 minutes. Shop activity uses the launch game's slug, and credit-pack orders from the general credits page are grouped under `arcade`.
