npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@theaiplatform/miniapp-sdk

v0.2.4

Published

Public SDK for building portable miniapps that run in The AI Platform.

Readme

The AI Platform Miniapp SDK

@theaiplatform/miniapp-sdk is the public package for building portable miniapps that run in The AI Platform.

pnpm add @theaiplatform/miniapp-sdk

The package provides the host-injected SDK API, isolated surface lifecycle types, browser helpers, portable React UI components, manifest schema, and the Rspack/Rslib integration used to produce descriptor-backed Module Federation targets.

Start with the Miniapp SDK documentation.

Supported entry points

  • @theaiplatform/miniapp-sdk
  • @theaiplatform/miniapp-sdk/sdk
  • @theaiplatform/miniapp-sdk/web
  • @theaiplatform/miniapp-sdk/ui
  • @theaiplatform/miniapp-sdk/ui/wasm
  • @theaiplatform/miniapp-sdk/ui/styles.css
  • @theaiplatform/miniapp-sdk/ui/tailwind.css
  • @theaiplatform/miniapp-sdk/ui-components.json
  • @theaiplatform/miniapp-sdk/surface
  • @theaiplatform/miniapp-sdk/config
  • @theaiplatform/miniapp-sdk/rspack
  • @theaiplatform/miniapp-sdk/config-schema.json

The host API is injected at runtime. Importing an entry point is safe in build tools and tests; host-backed calls fail when used outside a supported runtime. sdk.storage provides revisioned non-secret JSON scoped by the host to the active workspace and exact package. sdk.presence provides host-stamped, ephemeral room membership and state; package code never supplies participant identity. On supported desktop surfaces, sdk.http sends bounded HTTP(S) requests through host consent instead of browser fetch, and sdk.credentials lists metadata-only HTTP credential references. Credential secrets remain in the host vault and are injected only by the native request authority.

sdk.printing is an optional desktop-only receipt printer API. It discovers bounded machine-local printer metadata and host-supported 58 mm and 80 mm paper profiles, then accepts only bounded semantic version-1 receipt rows with printable ASCII text and a stable job key. The miniapp passes its exact printer/profile selection to status and submission; the host revalidates that destination and owns wrapping, feed, cut, and OS spooler submission. Packages must declare the exact descriptor effect { "kind": "physical-output", "resources": ["receipt-printer"] } and a persisted printing.receipt action with reusable consent, do autonomy, and consequential risk. Raw ESC/POS, direct USB/network access, and window.print() are not SDK capabilities. Job-key journaling suppresses routine reconnect duplicates, but physical exactly-once printing is impossible; every result therefore carries physicalExactlyOnce: false.

Discovery metadata

Descriptor-backed packages may assign up to three unique presentation.categories. Import the MiniAppCategory type from the package root or /config; accepted values are productivity, developer-tools, creativity, communication, data-and-analytics, business, education, media-and-entertainment, utilities, and other.

Do not add an authored includes field. The host derives the package's stable, counted capability summary from its verified contributions, so Marketplace details cannot drift from the code the descriptor is allowed to expose.

Portable UI

Import the precompiled stylesheet once at the miniapp entry point, then use components from the public UI entry. React 19 is a peer dependency.

import '@theaiplatform/miniapp-sdk/ui/styles.css';

import {
  Button,
  Card,
  CardContent,
  CardHeader,
  CardTitle,
} from '@theaiplatform/miniapp-sdk/ui';

export function WelcomeCard() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Ready to build</CardTitle>
      </CardHeader>
      <CardContent>
        <Button>Continue</Button>
      </CardContent>
    </Card>
  );
}

Tailwind v4 miniapps can instead import the source integration after tailwindcss and tw-animate-css; it supplies the platform theme and scans the SDK's UI bundle for component classes.

@import 'tailwindcss' source(none);
@import 'tw-animate-css';
@import '@theaiplatform/miniapp-sdk/ui/tailwind.css';

@source './src';

Use installMiniAppAppearanceSync() from the /web entry to apply the host's light/dark theme and bounded UI scale. Tools and agents can read the exported ui-components.json catalog to discover the supported component families and style entry points without importing application-private packages.

Rust/WASM UI

Rust/WASM miniapps can render the same public component library through the imperative /ui/wasm entry. It accepts a bounded serializable model, owns its React root and providers, and emits serializable actions with stable control IDs, entity IDs, model revisions, and unique event IDs.

import '@theaiplatform/miniapp-sdk/ui/styles.css';
import { createMiniAppUiRoot } from '@theaiplatform/miniapp-sdk/ui/wasm';

const ui = createMiniAppUiRoot(element, model, (action) => {
  wasm.onUiAction(action);
});

ui.update(nextModel);
ui.focus('project-name');
ui.unmount();

The bridge synchronizes theme and UI scale, restores focus for controlled dialogs, exposes a live-announcement method, rejects malformed or stale models, reports render and dispatch failures explicitly, and makes teardown idempotent. See examples/wasm-ui for a clean wasm-bindgen consumer that maps JavaScript exceptions to Rust Result values and rejects stale or replayed actions.

License and public policies

By downloading, installing, copying, accessing, or using this SDK, you accept the Miniapp SDK Proprietary License Agreement. The SDK has no separate license fee and is provided as-is under that agreement.