#@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$clientpointed at its API;WebContentProvider: which web layer is running (bundled, dev, or a live update through a substitutedContentInspector);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-nativeon<html>, the splash hidden on the first settled screen (SplashScreenProvider), the status bar following the theme; - natively,
NativeAuthTransport:ReactAuthsigns 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 importingAlephaReactAuth.
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
AppStateProvider- Whether the app is in the foreground, and the event when that changes.BackButtonProvider- The Android back button, as a chain rather than a registry of overlays.CapacitorConfigProvider- The public configuration of a native shell, as its build baked it.ContentInspector- Answers which web layer is running, forWebContentProvider.DeepLinkProvider- Custom-scheme deep links:<scheme>://app/<path>?query#hashopens thatDeviceProvider- What the app runs on. The web implementation (this class) says only what aHapticsProvider- Touch feedback. A no-op on the web, where there is nothing to vibrateMemoryAppStateProvider- An app state a spec moves by hand.MemoryBackButtonProvider- Records the exits a spec's presses caused, instead of closing anything.MemoryCapacitorConfigProvider- A shell configuration set by hand, for specs.undefinedis a web build.MemoryContentInspector- An inspector answering whatever a spec sets,otaincluded: the seam aMemoryDeepLinkProvider- Deep links a spec plays: a launch URL, and links opened later.MemoryDeviceProvider- A device a spec describes.MemoryHapticsProvider- Records every haptic a spec triggered.MemorySplashScreenProvider- Counts the hides a spec caused.MemoryStatusBarProvider- Records what a spec asked of the status bar.MemoryTokenStorageProvider- Session tokens in a map, for specs.MemoryWebContentProvider- Web content set by hand, every mode included, for specs.NativeAppStateProvider- Foreground and background from@capacitor/app, which a WebView's ownNativeAuthTransport-ReactAuth's transport inside a native shell: password sign-in againstNativeBackButtonProvider- The hardware back button from@capacitor/app(Android; iOS has none).NativeDeepLinkProvider- Deep links from@capacitor/app: the launch URL andappUrlOpen.NativeDeviceProvider- Device information from@capacitor/device.NativeHapticsProvider- Haptics through@capacitor/haptics, loaded on first use so a web buildNativeSplashScreenProvider- The splash through@capacitor/splash-screen, loaded on first use so a webNativeStatusBarProvider- The status bar through Capacitor's ownSystemBars.NativeTokenStorageProvider- Session tokens in the Keychain (iOS) or the Keystore (Android), throughSplashScreenProvider- The native launch splash. A no-op on the web, which has none.StatusBarProvider- The system bars of a native shell, overSystemBarsfrom@capacitor/coreTokenStorageProvider- Where a native app keeps its session tokens.WebContentProvider- Read-only: where the running web layer came from.