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

@seij/common-ui-auth

v0.1.0

Published

UI utilities and tooling to manage authentication.

Downloads

108

Readme

common-ui-auth

UI utilities and tooling to manage authentication.

Usage

Configuration

import { createAuthenticationConfig } from "@seij/common-ui-auth";

const config = createAuthenticationConfig({
  authority: "https://oidc.mydomain.lan/realms/myrealm",
  client_id: "your client id",
  redirect_uri: yourAppBaseUrl + "/authentication-callback",
});

Usage with APIs

Now, you can configure your API headers so send stored API token with headers.

import { ConnectionConfig, defaultConnection } from "@seij/common-services";

const apiConfig: ConnectionConfig = {
  apiBaseUrl: "/api/myapibaseurl",
  getApiAccessToken: authenticationConfig.getCurrentAccessToken,
};
defaultConnection.reconfigure(apiConfig);

Usage with React

Place a provider around the area where authentication is needed. This will provide hooks to know connected (or not) user, as well as methods to signIn() or signOut() user.

import { AuthenticationProvider, useAuthentication } from "@seij/common-ui-auth";

export function App() {
  return (
    <AuthenticationProvider {...config}>
      <MyScreen />
    </AuthenticationProvider>
  );
}

export function MyScreen() {
  const authentication = useAuthentication();
  return (
    <div>
      <div>Is authenticated: {authentication.isAuthenticated}</div>
      <div>Is loading: {authentication.isLoading}</div>
      <div>Is error: {authentication.isError}</div>
      <div>Error: {authentication.error}</div>
      <div>User display name: {authentication.userDisplayName}</div>
      <div>
        <button onClick={() => authentication.signIn()}>Sign in</button>
        <button onClick={() => authentication.signOut()}>Sign out</button>
      </div>
    </div>
  );
}

We provide Views to display common displays depending on user state.

  • AuthenticationCallbackView that you should bind to /authentication-callback
  • AuthenticationLoginView that you should bind to /authentication-login
  • AuthenticationLogoutView that you should bind to /authentication-logout
  • AuthenticationStatusView that you should display when user tries to access a page that required authentication. Displays the current status of authentication process and, if user is not authenticated, a message to help him do so.

Usage with @seij/common-ui's ApplicationShell

We also provide ApplicationShellSecured, an extension to @seij/common-ui's ApplicationShell that

  • binds user status to the Shell (displays username, loading status, buttons to sign in/out)
  • protects the main area if user displaying NotAuthenticatedView when necessary
  • filters out navigation items (the menu items) to remove all those not permitted by the current user status or roles

Paths

We provide standard paths for login, logout and callback pages:

  • AuthenticationPaths.callback
  • AuthenticationPaths.login
  • AuthenticationPaths.logout

Internationalization

Uses common-ui default internationalization features and plugs its translations as a namespace.