alepha@docs:~/docs/packages/@alepha-capacitor$
cat core.md | pretty
4 min read
Last commit:

#@alepha/capacitor - Core

Native iOS and Android apps for Alepha: a Capacitor shell, native capabilities behind DI providers, and the alepha capacitor commands.

#Installation

npm install @alepha/capacitor

#Overview

Native capabilities for an Alepha app running in a Capacitor shell.

Import this module in the app's browser entry. Inside the native shell it binds the native implementations; in a plain browser, web fallbacks; so the same app code runs on both, and app code never imports @capacitor/*.

  • CapacitorConfigProvider: the shell's public configuration, and every host-less $client pointed at its API;
  • WebContentProvider: which web layer is running (bundled, dev, or a live update through a substituted ContentInspector);
  • HapticsProvider, AppStateProvider, DeviceProvider, StatusBarProvider;
  • DeepLinkProvider: <scheme>://app/<path> links, cold and warm;
  • BackButtonProvider: the Android back button as a chain of handlers, then the router's history, then exit;
  • natively, NativeChrome: data-native on <html>, the splash hidden on the first settled screen (SplashScreenProvider), the status bar following the theme;
  • natively, NativeAuthTransport: ReactAuth signs in against the API with a password and keeps the session in secure storage (TokenStorageProvider) as a Bearer token. Register this module before the one importing AlephaReactAuth.

Each has a Memory* implementation for specs: substitute it before this module is registered.

There is no native navigation plugin: tabs, stacks and transitions are the $page router's, in the DOM, with the platform's chrome around them (status bar, splash, safe areas, back button, haptics). An adopting product reopens that choice only after two App Store guideline 4.2 rejections.

The shell and its native projects are made by @alepha/capacitor/cli.

#API Reference

#Providers