Device permissions

Games run in a sandboxed frame. By default they cannot use the camera or the microphone: the portal blocks those prompts and the autotest warns about them. A game that really needs one (voice chat, a singing game, an AR filter) declares it in its listing, says why, and a person approves it at review.

PermissionUse it for
microphonegetUserMedia({ audio: ... }): voice chat, voice control, music games
cameragetUserMedia({ video: ... }): camera filters, motion games

Location, notifications and clipboard reading are not available to games.

Find what you need

gamealia analyze (or gamealia_analyze_project) scans the build for getUserMedia calls and lists the permission each one needs, with file and line: audio means microphone, video means camera. When the constraints are not a literal object it suggests both; check which one the code uses. Declare only what the game really uses.

Declare them, with a justification

The reviewer reads your justification before approving. Make it specific: what the feature is, when the game asks, and what happens if the player says no. 10-1000 characters.

Push-to-talk voice chat in multiplayer rooms. The game asks only when the player holds the talk button; without the microphone the game is fully playable with text emotes.

  • Developer portal: the game's page → Device permissions, tick them and fill in "Why does your game need them?".
  • CLI:

    gamealia permissions my-game --microphone --why "Push-to-talk voice chat in rooms; the game is playable without it."
    gamealia permissions my-game --none   # remove them
  • MCP: gamealia_update_listing {game, permissions: [{name: "microphone", justification: "..."}]} (one justification per permission; [] removes them).

When they take effect

A change takes effect only when a version tested with it is approved. The flow:

  1. Declare the permissions with the justification.
  2. Upload a new version: the autotest runs with them, and a declared getUserMedia passes the permissions check.
  3. Submit it. The reviewer sees the requested permissions, what is live now, and your justification.
  4. On approval, the game's frame gets the permission (the browser still asks the player).

While a version waits for review, the permissions cannot change. A submit that adds a permission without a justification is refused: gamealia submit and the MCP say which command fixes it. If you change the permissions after a version was tested, that version is tested again before it can be submitted.

In your code

There is no SDK call for this: use the normal browser API (or your engine's) and handle a refusal. The player can always say no, so the game must keep working without the device.

async function enableVoice() {
  try {
    const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
    startVoiceChat(stream);
  } catch {
    showToast("Voice chat is off: the microphone is not available");
  }
}