Skip to content

1681-engine / mobile / capacitorConfig

Function: capacitorConfig() ​

ts
function capacitorConfig(options): Record<string, unknown>;

Defined in: src/mobile/capacitor.ts:82

A capacitor.config.ts for a game, with the defaults a game wants rather than a web page's:

  • the page is served from https://localhost (Android) so cookies, crypto.subtle and service workers behave as on the web, and nothing is fetched over plain http;
  • the web view does not scroll, bounce or zoom on iOS, and draws edge to edge (contentInset: 'never', mind the safe area: safeAreaInsets);
  • the splash screen stays until the game hides it (SplashScreen.hide() once the first scene draws), so the player never sees a blank web view;
  • @capgo/capacitor-updater does not update on its own: the engine's pickWebUpdate decides.
ts
// capacitor.config.ts
import { capacitorConfig } from '1681-engine/mobile';
export default capacitorConfig({ appId: 'com.example.mygame', appName: 'My Game', debug: process.env.DEBUG === '1' });

Parameters ​

ParameterType
optionsMobileConfigOptions

Returns ​

Record<string, unknown>

Released under the MIT License.