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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@openmfp/portal-server-lib

v0.163.3

Published

This library helps you to set up an openmfp based micro frontend portal server with ease.

Downloads

935

Readme

Portal server library

This library helps you to set up an openmfp based micro frontend portal server with ease.

Build Status REUSE status

This library helps you to set up a Nest.js server to serve a dynamic luigi configuration. It is closely related to the portal ui library.

The main features of this library are:

  • Provide a Dynamic Luigi configuration without the need to deploy a library
  • Optional authentication capabilities with GitHub and Auth Server
  • Dynamic development capabilities - Embed your local MicroFrontend into a running luigi frame.
  • Can run without any authentication infrastructure

Getting started

Set up an environment

The portal can run without any authentication infrastructure. Authentication configuration is optional and only required if you want to enable user authentication.

Environment properties

  • Optional - Authentication

Note: All authentication-related environment variables are optional. The portal can run without any auth services to display node configurations. Configure these only if you want to enable authentication features.

| Property name | Description | | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IDP_NAMES | Comma separated values of the name(s) of the Identity Providers (IDPs) used for authentication. | | BASEDOMAINS${idp} | Comma separated values of base domains for the application. | | AUTHSERVER_URL${idp} | The URL for the authentication service provider specific to the idp name. This URL is used for retrieveing an authenticating a user. | | TOKENURL${idp} | The URL for the authentication token service provider specific to the idp name. This URL is used for retrieveing an auth tokens. | | OIDCCLIENT_ID${idp} | Client ID for the OpenID Connect (OIDC) configuration. The Client ID is used to identify the application to the OIDC provider (e.g., an authorization server). | | OIDCCLIENT_SECRET${idp} | Client Secret for the OIDC configuration. The Client Secret is a confidential value known only to the application and the OIDC provider, used to authenticate the application to the provider. |

  • Optional

| Property name | Description | |-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | CONTENT_CONFIGURATION_VALIDATOR_API_URL | Endpoint URL for custom content configuration validation. Endpoint returns useful error message when configuration is invalid. | | HEALTH_CHECK_INTERVAL | The interval in milliseconds at which the application performs health checks to ensure its components are functioning correctly. Default 2000 ms. | | LOGOUT_REDIRECT_URL | The url to redirect user after logout action, by default /logout. | | ENVIRONMENT | This property indicates the environment in which the application is running, local indicates development environment. | | DEVELOPMENT_INSTANCE | This property indicates if the portal runs in development mode. | | FRONTEND_PORT | Set the port number on which the frontend of the application will run. | | VALID_WEBCOMPONENT_URLS | To enable CORS Web component Loading: basically you need to add external domains where the Web Components are hosted; ".?" in this examle, we are sepcify that we can load Web Components from everywhere. | | FEATURE_TOGGLES | Comma separated values of features following the convention featureName=boolean. Boolean value indicates is the feature is on/off (true/false) | | USER_AVATAR_URL | Url that indicates where to find a user avatar to be displayed in the application along with the user information. Should contain a user id placeholder ${userId} which will be automatically replaced with the value. |

Full configuration (with authentication)

## Mandatory
CONTENT_CONFIGURATION_VALIDATOR_API_URL=https://example.com/validate

## Auth Optional
IDP_NAMES=app,dev
BASE_DOMAINS_APP=localhost,example.com
AUTH_SERVER_URL_APP=https://example.com/auth
TOKEN_URL_APP=https://example.com/token
OIDC_CLIENT_ID_APP=app_client_id
OIDC_CLIENT_SECRET_APP=app_client_secret

## Portal
OPENMFP_PORTAL_CONTEXT_CRD_GATEWAY_API_URL=https://example.com/graphql

## Optional
DEVELOPMENT_INSTANCE=true
ENVIRONMENT='local'
VALID_WEBCOMPONENT_URLS=".?"
FEATURE_TOGGLES="foo=true,boo=false"
USER_AVATAR_URL=https://example.com/avatar/${userId}

Consuming the library

This library exposes a Nest module as an api and needs a main project to run.

All system environment variables set and prefixed with OPENMFP_PORTAL_CONTEXT_ are automatically read and accessible at the /rest/config endpoint. For example, OPENMFP_PORTAL_CONTEXT_CRD_GATEWAY_API_URL=https://example.com/graphql transforms to "portalContext": {"crdGatewayApiUrl": "https://example.com/graphql"}, with the whole resulting response:

{
  "portalContext": { "crdGatewayApiUrl": "https://example.com/graphql" },
  "featureToggles": { "foo": true },
  "providers": []
}

Import the module

import { NestFactory } from '@nestjs/core';
import { PortalModule } from '@portal/server-lib';

async function bootstrap() {
  const app = await NestFactory.create(
    PortalModule.create({
      healthChecker: OpenHealthChecker,
    }),
  );
  await app.listen(process.env.PORT || 3000);
}

// bootstrap the app
bootstrap();

Requirements

The portal requires an installation of node.js and npm. Check out the package.json for the required node version and dependencies.

Contributing

Please refer to the CONTRIBUTING.md file in this repository for instructions on how to contribute to openMFP.

Code of Conduct

Please refer to the CODE_OF_CONDUCT.md file in this repository for information on the expected Code of Conduct for contributing to openMFP.

Licensing

Copyright 2025 SAP SE or an SAP affiliate company and openMFP contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.