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

sso-offloading-connector

v0.1.2

Published

A client connector for Chrome Apps and Isolated Web Apps to offload SSO to a handler extension.

Readme

SSO Offloading Connector

This package provides a TypeScript module for offloading Single Sign-On (SSO) authentication flows from a sandboxed client environment (Isolated Web App or a Chrome App) to a dedicated Chrome Extension helper.

It is designed to be used within an IWA or Chrome App, intercepting authentication requests and delegating them to the SSO Offloading Extension. It works with both the IWA's <controlledframe> and the Chrome App's <webview>.

Installation

npm install sso-offloading-connector
# or
pnpm add sso-offloading-connector

How It Works

  1. Handshake: The connector first "pings" the companion extension to ensure it's installed and active.
  2. Listen: It attaches a request listener to the target view element (<controlledframe> or <webview>).
  3. Intercept & Delegate: When a navigation request inside the view matches your URL filters, the connector cancels the request and sends the URL to the offloading extension.
  4. Redirect: The connector waits for the extension to return the final redirect URL after a successful login. It then programmatically navigates the view to this URL, completing the flow.

API and Usage

The main entry point is the createSsoOffloadingConnector factory function.

import {
  createSsoOffloadingConnector,
  SsoOffloadingConnectorError,
  RequestFilter
} from 'sso-offloading-connector';

const viewElement = document.getElementById('auth-view') as HTMLIFrameElement; 

// URL patterns to intercept.
const requestFilter: RequestFilter = {
    urls: [
        'https://accounts.google.com/o/oauth2/v2/auth*',
        'https://sso.mycompany.com/*'
    ],
};

// (Optional) An error handler for issues during the offloading flow.
const onInterceptError = (error: SsoOffloadingConnectorError): void => {
  console.error(`SSO offloading failed: ${error.name}: ${error.message}`);
};

// Create the connector instance.
const ssoConnector = createSsoOffloadingConnector(
  viewElement,
  requestFilter,
  onInterceptError
);

// Start the connector to begin intercepting requests.
ssoConnector.start().then(() => {
  console.log('SSO offloading connector is active.');
}).catch(error => {
  console.error('Failed to start SSO connector:', error);
});

// Stop the connector when it's no longer needed.
// ssoConnector.stop();

Error Handling

The library exports several custom error classes to help distinguish between different failure modes:

  • ConfigurationError: Problem with the initial setup (e.g., invalid element).
  • CommunicationError: The connector failed to establish a connection with the extension.
  • SsoOffloadingExtensionResponseError: The extension responded with an error during the auth flow.

License

This project is licensed under the Apache 2.0 License.