Skip to main content

Overview

Super Capacitor is a Capacitor plugin designed to allow Capacitor apps to utilize the capabilities of Ionic Portals.

Install

npm install @ionic-enterprise/super-capacitor
npx cap sync

Types

MicroappOptions

The options for configuring your microapp when using presentMicroapp.

interface MicroappOptions {
name: string;
type: 'push' | 'modal';
modalStyle?: 'fullScreen' | 'pageSheet';
startDir?: string;
initialContext?: InitialContext;
plugins?: CapacitorPlugin[];
liveUpdateConfig?: LiveUpdateConfig;
}

CapacitorPlugin

If you need to use any Capacitor plugins, the classpath of the Android plugins and the Objective-C class name will have to be provided to MicroappOptions in the plugins property.

interface CapacitorPlugin {
/** The classpath of the plugin to be used in Android. (e.g. com.capacitorjs.plugins.camera.CameraPlugin) */
androidClassPath: string;
/** The class name of the plugin to be used in iOS.
* This must be the name as it is exposed to the Objective-C runtime.
* For example, The CameraPlugin swift class is exposed to Objective-C as CAPCameraPlugin.
*/
iosClassName: string;
}

Methods

presentMicroapp

presentMicroapp(options: MicroappOptions) => Promise<void>

Usage

import { presentMicroapp } from '@ionic-enterprise/super-capacitor/superapp';

presentMicroapp({
name: 'checkoutApp',
startDir: 'microapps/checkout',
type: 'push',
});

NOTE: A Typescript module resolution Node16, NodeNext, or Bundler is required to recognize Super Capacitor's use of subpath exports.

Parameters

NameTypeDescription
optionsMicroappOptionsThe MicroappOptions object to configure the microapp.

dismissMicroapp

dismissMicroapp() => Promise<void>

Usage

import { dismissMicroapp } from '@ionic-enterprise/super-capacitor/microapp';

dismissMicroapp();

NOTE: A Typescript module resolution Node16, NodeNext, or Bundler is required to recognize Super Capacitor's use of subpath exports.