Runtimes
Ionic Runtime
Ionic and Capacitor integration with @meshkit/ionic.
Use @meshkit/ionic when an Ionic or Capacitor app needs MeshKit with platform-aware storage and capability detection.
Ionic can run in native Capacitor shells or browser-like contexts. The available key storage, filesystem, and background behavior depend on that runtime.
Install
npm install @meshkit/ionicCreate An Ionic Client
import {
createCapacitorKeyVault,
createMeshkitIonic,
detectIonicCapabilities,
} from "@meshkit/ionic";
const capabilities = detectIonicCapabilities();
const mesh = await createMeshkitIonic({
keyVault: capabilities.capacitorKeyVault ? createCapacitorKeyVault() : false,
identity: "ionic-user",
});
console.log({
platform: capabilities.platform,
capacitorKeyVault: capabilities.capacitorKeyVault,
provider: mesh.providers.current().name,
});What To Verify
| Area | Check |
|---|---|
| Platform | Is the app running in Capacitor native shell or browser fallback? |
| Key vault | Is secure storage available and configured? |
| Identity persistence | Are exported identity records protected at rest? |
| File access | Does the platform support the file size and stream pattern you need? |
| Background work | Which Capacitor/background task path will call mesh.sync.flush()? |
| Provider access | Are privileged provider tokens kept out of client bundles? |
Production Caveats
- Browser fallback storage is weaker than native secure storage.
- Capacitor secure storage does not automatically mean non-exportable cryptographic keys.
- Treat lost-device, backup, and recovery as explicit product workflows.
- Do not expose unrestricted Kubo RPC or broad metadata tokens to public app clients.