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

@orbid/aurelia-oidc-client-ts

v1.0.0

Published

This plugin is a fork of the aurelia-open-id-connect library but uses the oidc-client-ts instead of the depracted oidc-client-js library.

Readme

Why?

This plugin is a fork of the aurelia-open-id-connect library but uses the oidc-client-ts instead of the depracted oidc-client-js library.

https://github.com/aurelia-contrib/aurelia-open-id-connect

https://github.com/authts/oidc-client-ts

Installation

npm i @orbid/aurelia-oidc-client-ts

Example usage

Initialize the plugin

aurelia.use
		.standardConfiguration()
		.feature("resources")
		.plugin("@orbid/aurelia-oidc-client-ts", () => new OidcConfig());

    aurelia.start().then(async () => {
		const httpClient: HttpClient = aurelia.container.get(HttpClient);

		const authService = aurelia.container.get(
			AuthenticationService
		) as AuthenticationService;
		const router = aurelia.container.get(Router) as Router;

		httpClient.configure((config) => {
			config.withInterceptor({
				request(req: Request) {
					if (authService.isAuthenticated) {
						req.headers.append(
							"Authorization",
							`Bearer ${authService.user.access_token}`
						);
					}
					return req;
				},
				async response(resp: Response) {
					if (resp.status === 401) {
						authService.signIn();
					}
					if (resp.status === 403) {
						router.navigateToRoute("unauthorized");
					}
					return resp;
				},
			});
		});

Authentication service

import { autoinject, computedFrom } from "aurelia-framework";
import { OpenIdConnect } from "@orbid/aurelia-oidc-client-ts";
import { Router } from "aurelia-router";
import { User } from "oidc-client-ts";

@autoinject()
export class AuthenticationService {
	public user: User;
	constructor(private openIdConnect: OpenIdConnect) {
		this.openIdConnect.observeUser(async (u) => {
			this.user = u;
		});
	}
	@computedFrom("user", "user.expired")
	public get isAuthenticated() {
		return this.user && !this.user.expired;
	}

	public async signIn() {
		this.openIdConnect.login();
	}
	public async logOut() {
		this.openIdConnect.logout();
	}
}

Configure router

import { Router, RouterConfiguration } from "aurelia-router";
import { autoinject } from "aurelia-framework";
import { OpenIdConnect } from "@orbid/aurelia-oidc-client-ts";
@autoinject()
export class App {
	public router: Router;
	constructor(private openIdConnect: OpenIdConnect) {}

	public configureRouter(
		config: RouterConfiguration,
		router: Router
	): Promise<void> | PromiseLike<void> | void {
		config.options.pushState = true;
		config.map([
			{
				route: ["Dashboard"],
				name: "Dashboard",
				moduleId: "./modules/dashboard",
				nav: true,
				title: "Dashboard",
			},
			{
				route: ["unauthorized"],
				moduleId: "unauthorized",
				title: "unauthorized",
				name: "unauthorized",
				nav: false,
			},
		]);

		this.openIdConnect.configure(config);

		this.router = router;
	}
}

Example config

import { OpenIdConnectConfiguration } from "@orbid/aurelia-oidc-client-ts";
import environment from "environment";
import { Log, UserManagerSettings, WebStorageStateStore } from "oidc-client-ts";

export class OidcConfig extends OpenIdConnectConfiguration {
	constructor() {
		super();
		this.loginRedirectRoute = "/";
		this.logoutRedirectRoute = "/unauthorized";
		this.unauthorizedRedirectRoute = "/unauthorized";
		this.userManagerSettings = {
			// the number of seconds in advance of access token expiry
			// to raise the access token expiring event.
			accessTokenExpiringNotificationTimeInSeconds: 20,
			authority: environment.stsUrl,
			automaticSilentRenew: true,
			monitorSession: true,
			checkSessionIntervalInSeconds: 2000,
			// the client or application ID that the authority issues.
			client_id: environment.clientId,
			filterProtocolClaims: true,
			loadUserInfo: false,
			post_logout_redirect_uri: `${environment.appUrl}/signout-oidc`,
			redirect_uri: `${environment.appUrl}/signin-oidc`,
			response_type: "code",
			// response_mode: "query",
			scope: `openid offline_access profile email ${environment.scope}`,
			// number of millisecods to wait for the authorization
			// server to response to silent renew request
			silentRequestTimeoutInSeconds: 10000,
			silent_redirect_uri: `${environment.appUrl}/signin-oidc`,
			userStore: new WebStorageStateStore({
				prefix: "oidc",
				store: window.localStorage,
			}),
		} as UserManagerSettings;
	}
}