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

@xema-platform/plugin-registry-web

v0.1.0

Published

Frontend-host plugin registry for the Xema platform. Exposes the plugin contribution shape (FrontendPlugin, FrontendPluginFactory), the singleton runtime registry, the HostBridge contract for host-agnostic navigation/auth/toast access, and the <PluginSlot

Readme

@xema-platform/plugin-registry-web

Frontend-host plugin registry for the Xema platform. Exposes the plugin contribution shape, the singleton runtime registry, the HostBridge contract for host-agnostic navigation/auth/toast access, and the <PluginSlot> rendering primitive.

This package is shell-agnostic: the same plugin code runs in a Vite SPA host (via @xema-platform/plugin-host-react-router), a Next.js host (via @xema-dev/plugin-host-nextjs), or any other React shell that supplies a HostBridge implementation.

Install

npm install @xema-platform/plugin-registry-web
# or
pnpm add @xema-platform/plugin-registry-web

react and @tanstack/react-query are peer dependencies — the host provides them.

Concepts

┌─────────────────────────────────────────────────────────────┐
│ PLUGIN AUTHOR                                               │
│   default-exports a FrontendPluginFactory                   │
│      (bridge: HostBridge) => FrontendPlugin                 │
│                                                             │
│   Inside plugin components:                                 │
│     const bridge = useHostBridge();                         │
│     bridge.navigation.push(path);                           │
│     bridge.auth.getActorToken();                            │
│     bridge.toast.success(msg);                              │
│   ↑ no react-router, no next/navigation, no auth lib        │
│                                                             │
└─────────────────────────────────────────────────────────────┘
                            │
                            │  registered at host bootstrap
                            ▼
┌─────────────────────────────────────────────────────────────┐
│ HOST                                                        │
│   1. Mounts <HostBridgeContext.Provider value={bridge}>     │
│   2. Calls registerFrontendPlugin(factory, bridge)          │
│   3. Reads pluginRegistry.list() at render time             │
│      - merges navItems into its sidebar                     │
│      - mounts routes from plugin.routes                     │
│      - <PluginSlot name="…"/> renders contributed panels    │
└─────────────────────────────────────────────────────────────┘

Quick start (any host)

import {
  HostBridgeContext,
  registerFrontendPlugin,
  PluginSlot,
  type HostBridge,
} from '@xema-platform/plugin-registry-web';
import myPluginFactory from '@xema-dev/software-dev-web';

const bridge: HostBridge = { /* host-specific implementation */ };

registerFrontendPlugin(myPluginFactory, bridge);

function App() {
  return (
    <HostBridgeContext.Provider value={bridge}>
      <YourLayout>
        <PluginSlot name="session-actions" />
      </YourLayout>
    </HostBridgeContext.Provider>
  );
}

For most hosts, you don't write the bridge by hand — drop in the matching adapter package:

  • Vite + react-router@xema-platform/plugin-host-react-router (<DefaultHostBridgeProvider> + mountPluginRoutes).
  • Next.js@xema-dev/plugin-host-nextjs (planned).
  • Custom shell → implement HostBridge directly against your router/auth/toast primitives.

Authoring a plugin

// my-plugin/src/index.tsx
import {
  type FrontendPlugin,
  type FrontendPluginFactory,
  useHostBridge,
} from '@xema-platform/plugin-registry-web';

function MyPanel() {
  const bridge = useHostBridge();
  return <button onClick={() => bridge.navigation.push('/elsewhere')}>Go</button>;
}

const myPlugin: FrontendPluginFactory = (bridge): FrontendPlugin => ({
  id: 'my-plugin',
  displayName: 'My Plugin',
  navItems: [{ id: 'mine', label: 'Mine', route: 'mine', section: 'Build' }],
  routes: [{ path: 'mine', element: () => <MyPage />, projectScoped: true }],
  panels: [{ slot: 'session-actions', id: 'mine/panel', render: () => <MyPanel /> }],
});

export default myPlugin;

Plugin components import only:

  • React + React hooks.
  • useHostBridge() from this package.
  • @tanstack/react-query (peer-dep).
  • Their own UI deps (lucide icons, plain CSS, etc.) — never the host's router/auth library.

Documentation

The full plugin authoring guide, host-adapter catalog, and platform architecture are at docs.xema.dev/plugins.

Related packages

License

Apache-2.0.