Game integration addons

manifest.type must be game. These addons run a worker and connect stream events to in-game effects.

Manifest example

{
  "name": { "en": "GTA V integration" },
  "description": { "en": "Viewer-triggered in-game effects." },
  "type": "game",
  "version": "1.0.0",
  "author": "Your Name",
  "icon": "logo.png",
  "permissions": ["NETWORK_REQUEST", "FILE_ACCESS"]
}

Game mods and file access

Game addons can install or update mod files inside the user's game folder using the scoped files API (FILE_ACCESS permission).

Typical flow: ask for the game folder in settings (folder / file field), then call files.requestAccess(gamePath, 'manage') and copy your mod files with writeFile / copyFile.

Example — Script Hook–style layout for GTA V:

GenerateConfig([
  {
    key: 'game_dir',
    type: 'folder',
    default: '',
    editor: { label: { en: 'GTA V folder' }, required: true },
  },
  {
    key: 'mod_notice',
    type: 'info',
    editor: {
      description: {
        en: 'Anti-cheat may ban online play. Use only in single-player or allowed modded sessions.',
      },
      infoBorder: 'red',
    },
  },
]);

const params = await api.config.getParams();
const gameDir = params.game_dir;
if (gameDir && (await files.requestAccess(gameDir, 'manage')).success) {
  await files.writeFile(`${gameDir}\\scripts\\my_mod.asi`, '...');
}

Developer responsibilities

See File access and Settings schema.

Register in-game actions

Call once at addon load:

await game.registerInputTriggers([
  { id: 'spawn_car', label: { en: 'Spawn car', ru: 'Заспавнить машину' } },
  { id: 'explosion', label: { en: 'Explosion', ru: 'Взрыв' } },
]);

events.On('gameInputTrigger', ({ actionId, trigger, record, user }) => {
  if (actionId === 'spawn_car') {
    // run in-game effect
  }
});

Users bind dashboard events to each action in Settings → Game integrations.

Optional overlay triggers

With DASHBOARD_EVENTS, you can also call dashboard.registerTriggers() and push events via dashboard.addRecord(..., { trigger }) so overlays and other modules react to game events.

Path settings (folder / file)

GenerateConfig([
  {
    key: 'game_exe',
    type: 'file',
    default: '',
    pathPicker: {
      title: { en: 'GTA V executable' },
      filename: 'GTAV.exe',
      filters: [{ name: 'Executable', extensions: ['exe'] }],
    },
    editor: { label: { en: 'Game executable' }, required: true },
  },
]);

See also: API dashboard, Config schema.