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

@batoanng/oidc

v0.0.24

Published

[![npm version](https://img.shields.io/npm/v/@batoanng/oidc)](https://www.npmjs.com/package/@batoanng/oidc) [![install size](https://packagephobia.com/badge?p=@batoanng/oidc)](https://packagephobia.com/result?p=@batoanng/oidc)

Downloads

1,141

Readme

@batoanng/oidc

npm version install size

A React-based OIDC (OpenID Connect) wrapper built on top of oidc-client-ts and react-oidc-context, designed to streamline authentication flows in frontend applications.

It integrates with react-router-dom, uses shared utilities from @batoanng/utils, and UI feedback from @batoanng/mui-components.


✨ Features

  • Plug-and-play OIDC integration for SPA
  • Login + logout + context + callback flows
  • Built with react-oidc-context
  • Uses react-router-dom's <Routes> and <Route>
  • Uses custom modals and loaders from @batoanng/mui-components
  • Exposes a shared authorisation context
  • Includes default login/logout callback URLs

🚪 Main Entry Point

import { OidcAuthorisationProvider } from '@batoanng/oidc';

This component wraps your app's authentication logic and injects routes for login/logout handling.

<OidcAuthorisationProvider
  userManagerSettings={{
    authority: 'https://your-idp.com',
    client_id: 'your-client-id',
    redirect_uri: 'http://localhost:3000/oidc/callback',
    post_logout_redirect_uri: 'http://localhost:3000/oidc/logout',
  }}
>
  <App />
</OidcAuthorisationProvider>

⚙️ Props

interface OidcAuthorisationProviderProps {
  userManagerSettings: UserManagerSettings;
  loginCallbackRelativeUrl?: string; // default: '/oidc/callback'
  logoutCallbackRelativeUrl?: string; // default: '/oidc/logout'
}

All other props are passed to OidcAuthorisationContextProvider.


🌐 Default Routes

| Route | Purpose | |-------|---------| | /oidc/callback | Handles login redirect callback | | /oidc/logout | Handles logout redirect callback |

These routes are automatically injected into your router when using OidcAuthorisationProvider.


🧩 Internals

src/
├── OidcAuthorisationProvider.tsx         # Main entry point
├── OidcAuthorisationContextProvider.tsx  # Context provider
├── OidcLoginCallback.tsx                 # Handles redirect on login
├── OidcLogoutCallback.tsx                # Handles redirect on logout
├── OidcAuthenticationPage.tsx           # Optional login screen
├── OidcErrorPage.tsx                     # Optional error fallback
├── utils.ts / hooks.ts / types.ts        # Supporting logic

📦 Related Packages