HSLG Media

CapacitorBoot.ts

CapacitorBoot.ts

Source file: apps/mobile/src/CapacitorBoot.ts

Module: app-mobile

Size: 36 lines

SHA-256: 06ec56a0acdfb404573b399cf99b9aae644475832162053e439162ec4bb0be46

Responsibility

Runs the real customer UI with native or fail-closed device and backend services; no simulated success.

Declared entry points

  • Window — source line 10.
  • bootstrap — source line 17.
  • device — source line 18.
  • baseUrl — source line 20.

Imports and dependencies

  • Line 7: import { createCapacitorDeviceServices } from '../native-adapters/CapacitorDeviceServices.js';
  • Line 8: import { createNativeAccountCoordinator } from './services/NativeAccountCoordinator.mjs';

Behaviour and audit locations

  • Line 7: import { createCapacitorDeviceServices } from '../native-adapters/CapacitorDeviceServices.js';
  • Line 11: HSLGCapacitorDevice?: ReturnType<typeof createCapacitorDeviceServices>;
  • Line 18: const device=createCapacitorDeviceServices();
  • Line 19: window.HSLGCapacitorDevice=device;

Bootstrap sequence and safety

bootstrap() creates the plugin-backed device service object and exposes it to the shared screen integration. An account coordinator is created only when VITE_HSLG_API_BASE_URL is set. The expected secure token vault is a separate optional host-provided bridge; without it, authenticated session persistence must not be claimed. The bootstrap then initializes the shared device experience and configures the native keyboard, orientation and splash behaviour. An initialization failure is logged and connectivity is rechecked, not converted into a fake successful login or device action.

Relationship to the system

This page is the file-level source reference, not the architecture rationale. Read the module explanation, the corresponding architecture decision and user guide before changing behaviour. Names and line locations above are extracted from this exact source version; they are reference points, not proof that an external service or a phone feature works.

Change verification

Review the entry points and errors in this file, then run the module’s associated tests, source dependency gate, history gate and documentation coverage check. If the file changes an API response, user interaction, data model, deployment or third-party dependency, revise those human explanations and disaster recovery/licensing when relevant. Do not infer actual native or external API operation from source presence.