Skip to main content

Interface: IRuntime

Defined in: src/types/runtime.ts:232

The top-level runtime instance created by createRuntime.

Manages the full miniapp lifecycle — loading, bootstrapping, caching, and teardown — within the configured DOM container.

Methods​

destroy()​

destroy(): void

Defined in: src/types/runtime.ts:249

Destroy the runtime and clean up all resources

Returns​

void


getState()​

getState(): IRuntimeState

Defined in: src/types/runtime.ts:243

Returns the current runtime state snapshot

Returns​

IRuntimeState


load()​

load(miniappOrPackageId, options?): Promise<IMiniappHandle>

Defined in: src/types/runtime.ts:234

Load a miniapp (or fetch its manifest by package ID) and prepare it for bootstrapping

Parameters​

miniappOrPackageId​

string | { appVersion: string; categoryTags: string[]; changeLog: string; createdBy: { displayName: string; id: string; photo: string; }; createdOn: string; description: string; experience: "Edit" | "Create" | "Landing"; extensions: object[]; iconUrl: string; id: string; isModuleFederated: boolean; isPublic: boolean; isTrusted: boolean; layout?: string; name: string; owners: object[]; packageId: string; permissions: "View"[]; platforms: ("android" | "apple" | "website")[]; platformVersion: string; productBundle: string; routes?: object[]; state: "Draft" | "Published"; systemTags: string[]; tags: string[]; updatedBy: { displayName: string; id: string; photo: string; }; updatedOn: string; workspaceIds: string[]; }

options?​

ILoadOptions

Returns​

Promise<IMiniappHandle>


loadModule()​

loadModule(options): Promise<ILoadModuleResult>

Defined in: src/types/runtime.ts:240

Load a module-federated component from a miniapp (e.g., ToolbarIcon, Sidebar)

Parameters​

options​

ILoadModuleOptions

Returns​

Promise<ILoadModuleResult>


subscribe()​

subscribe(listener): VoidFunction

Defined in: src/types/runtime.ts:246

Subscribes to runtime state changes and returns an unsubscribe function

Parameters​

listener​

IStormSubcription<IRuntimeState>

Returns​

VoidFunction