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

@datum-cloud/portal-plugin-sdk

v1.0.0

Published

Host-contract SDK for cloud-portal's Portal Plugin System: React hooks (useProjectContext, usePluginFetch, useResourceWatch) that give a plugin its project identity, its only data path (the portal's authenticated Milo control-plane proxy), and live resour

Readme

@datum-cloud/portal-plugin-sdk

The host-contract package for cloud-portal's Portal Plugin System. A service team's plugin imports this package to reach the three things the host provides — never a plugin-declared backend, and never a hand-rolled stand-in.

import { useProjectContext, usePluginFetch, useResourceWatch } from '@datum-cloud/portal-plugin-sdk';

function InstanceList() {
  const { project } = useProjectContext();
  const pluginFetch = usePluginFetch();
  const { lastEvent } = useResourceWatch({
    resourceType: 'compute.miloapis.com/v1alpha1/workloads',
  });

  // pluginFetch is pre-scoped to `project`'s control plane and already
  // authenticated — the path below is just the K8s API path.
  // await pluginFetch('/apis/compute.miloapis.com/v1alpha1/namespaces/default/workloads')

  return <div>{project?.displayName}</div>;
}

Why a singleton, not a normal npm dependency

Plugins are loaded via Module Federation, in the host's own JavaScript realm. If a plugin bundled its own copy of this package, its useContext() calls would read from its own private Context — never the host's. The host registers @datum-cloud/portal-plugin-sdk as an eager singleton shared module (see cloud-portal's federation-host.ts), the same way it shares react and react-router, so every plugin resolves the host's exact module instance at runtime regardless of what version it was built against.

Two entry points, two audiences

  • @datum-cloud/portal-plugin-sdk — the plugin-facing surface: useProjectContext, usePluginFetch, useResourceWatch, and their result types. This is the package a plugin repository actually calls.
  • @datum-cloud/portal-plugin-sdk/host — host-only wiring (PortalPluginHostProvider), imported by cloud-portal to supply the real implementations behind those three hooks. A plugin should never import this.

Versioning

The host advertises its SDK version; a plugin manifest whose sdk.range doesn't match is not loaded (Compatible=False). Per the enhancement doc: additive changes (a new optional field, a new hook) are minor; removing a hook or a required field is major, with a deprecation window. Both entry points are part of that same contract — a breaking change to either is a major bump.

Development

pnpm install
pnpm build
pnpm test
pnpm typecheck