MeshKit
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/ionic

Create 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

AreaCheck
PlatformIs the app running in Capacitor native shell or browser fallback?
Key vaultIs secure storage available and configured?
Identity persistenceAre exported identity records protected at rest?
File accessDoes the platform support the file size and stream pattern you need?
Background workWhich Capacitor/background task path will call mesh.sync.flush()?
Provider accessAre 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.

Next Steps

On this page