SDK Reference

Install the SDK from the public npm registry:

pnpm add @theaiplatform/miniapp-sdk

Use the narrowest entry point for each module. This keeps browser targets from importing build-only dependencies and makes runtime assumptions explicit.

ExportPurpose
@theaiplatform/miniapp-sdkConvenience root that re-exports the config and SDK APIs
@theaiplatform/miniapp-sdk/sdkHost-backed channels, projects, workflows, chat, navigation, authentication, VFS, and specialist capabilities
@theaiplatform/miniapp-sdk/mcpPackage-runtime MCP server authoring contract for exact QuickJS tool exposes
@theaiplatform/miniapp-sdk/webBrowser compatibility, editor actions, specialist events, and theme helpers
@theaiplatform/miniapp-sdk/uiPortable React components with public TypeScript declarations
@theaiplatform/miniapp-sdk/ui/wasmSerializable imperative UI lifecycle for Rust/WASM miniapps
@theaiplatform/miniapp-sdk/ui/styles.cssPrecompiled platform theme and component styles
@theaiplatform/miniapp-sdk/ui/tailwind.cssTailwind v4 source integration for miniapp styles
@theaiplatform/miniapp-sdk/ui-components.jsonAgent-readable component family and style catalog
@theaiplatform/miniapp-sdk/surfaceSurface mount contracts, host authority, package events, and asset URL resolution
@theaiplatform/miniapp-sdk/configTyped app configuration helpers
@theaiplatform/miniapp-sdk/rspackRsbuild and Rslib target compilation, package assembly, and portability checks
@theaiplatform/miniapp-sdk/config-schema.jsonPublished JSON Schema for manifest.tap.json

The root export is convenient for shared types and simple runtime code. Prefer /rspack only in build configuration and scripts, never in a browser or headless target bundle.

Compatibility

The package declares its supported Node.js and peer-dependency ranges in its published metadata. Install peer packages only for the features you use, and keep all Module Federation packages on the same exact version.

Code should treat optional SDK methods and capability groups as feature-detected additions. A host can reject an operation when its realm, scope, permission, or selected target does not authorize it.