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

@hitachivantara/app-shell-services

v2.0.2

Published

AppShell Services

Readme

@hitachivantara/app-shell-services

Hitachi Vantara App Shell Services. Support package to manage services at the App Shell ecosystem.

Overview

This package provides service management capabilities including:

  • Service registration and resolution
  • React hooks for service consumption
  • Type-safe service interfaces

Usage

Services supports a consumer/provider model where:

  • Consumers, like an app owning a header action for example, will consume a given service contract either from the shared-services package from other app or, if also a provider, its own shared-services package. The services are identified by an id that, ideally, should be unique while also providing information about the type it expects like main-app:AppsMetadata. This way, the consumers know the type they expect and the providers know what to implement, without collisions in the multi-tenant App Shell ecosystem.
  • Providers implement services that match the consumer's contract and register them under the consumer's id in its app-shell.config.ts file as example below:
services: {
  "@some-package/main-app-services:AppsMetadata": [{
    instance: {
       value: {
         name: "dummy app",
         description: "This is 'dummy app' description",
         version: 2.0,
         final: false,
       }
    }
  }],
}

This way, looking at the configuration, it is clear that there is a consumer application (main-app) that expects service-providers to implement the AppsMetadata contract and register them under its @some-package/main-app-services:AppsMetadata service definition, keeping the consumer resilient: as long as service-providers adhere to the declared contract the consumer code will not break.

Example (consumer)

Exploring the example above, the consumer should register the service contract and definition in a package that can be shared between the consumer and the provider:

// @some-package/main-app-services
export type AppsMetadata = {
  appId: string;
  appName: string;
  version: number;
  isRelease: boolean;
};

/**
 * Service definitions that the consumer 'main app' exposes on a services shared package.
 */
export const MainAppServiceDefinitions = {
  /**
   * The {@const AppsMetadata} service represents the service-provider application metadata.
   *
   * The service-providers that implement this contract will have its implementation displayed on a page.
   *
   * Instances of this service are typescript constants of type {@link AppsMetadata}.
   */
  AppsMetadata: {
    id: "@some-package/main-app-services:AppsMetadata",
  },
};

The main app consumes all the service definitions under its identifier using the useServices hook, which returns all the successfully loaded services of the requested identifier, namely the MainAppServiceDefinitions.AppsMetadata service definition. This way, as long as any provider implements and registers a service that matches the AppsMetadata contract, it will be safe to render as expected:

const AboutApps: FC = () => {
  const { services: appsMetadata[], isPending, error } = useServices<AppsMetadata[]>(
    ServiceDefinitions.AppsMetadata.id,
  );

  if (isPending) {
    return <HvLoading>Loading apps metadata from services...</HvLoading>;
  }

  if (error) {
    const errorMessage = `Failed to apps metadata: ${ServiceDefinitions.AppsMetadata.id}`;
    return <HvTypography>{errorMessage}</HvTypography>;
  }

  return (
    <HvContainer maxWidth="lg">
      <HvTypography variant="title1">Applications information</HvTypography>
      <HvGrid container spacing={3}>
        {appsMetadata.map((metadata, index) => {
          return (
            <HvGrid item key={metadata.appId}>
              <HvTypography>
                <strong>Application: </strong> {metadata.appName}
              </HvTypography>
              <HvTypography>
                {metadata.version} - {metadata.isRelease ? "Release" : "In development"}
              </HvTypography>
            </HvGrid>
          );
        })}
      </HvGrid>
    </HvContainer>
  );
};

Example (provider)

A simple way to implement a service-provider that matches the AppsMetadata contract is a constant like below:

import { AppsMetadata } from "@some-package/main-app-services";

const dummyAppMetadata: AppsMetadata = {
  appId: "ProviderApp",
  appName: "A provider app",
  version: 1.0,
  isRelease: true,
};

and having it registered on its app-shell.config.ts file, under the consumer service identifier.

  //...
  services: {
    "@some-package/main-app-services:AppsMetadata": [
      {
        instance: {
          bundle: "dummy-app/metadata/dummyAppMetadata.js",
        },
        ranking: 100,
      }
    ],
  },
  //...

More examples

To see more examples, please check the Default App ServicesDemo page and the app-shell.config.ts file.

Installation

The App Shell Services is available as an NPM package, and can be installed with:

npm install @hitachivantara/app-shell-services