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 🙏

© 2024 – Pkg Stats / Ryan Hefner

web-credential-handler

v3.0.0

Published

Credential Handler API util functions for Bedrock Web apps

Downloads

4,142

Readme

web-credential-handler

Credential Handler API utility functions for Web applications

Background

This module provides some plumbing that makes writing a Credential Handler easier.

A Credential Handler is an event handler for credential request and credential storage events. The Credential Handler API helps solve the Nascar Problem. The Credential Handler API enables websites to install Credential Handlers that can respond when users visit other websites that request or store credentials.

For example, a user may visit a website that wants them to login using OpenIdConnect, provide an OAuth Token, authenticate using a DID, or present some Verifiable Credentials. When these other websites use the Credential Handler API, the user is shown an in-browser selection screen with visual representations (e.g. icons and origin information) of only those Credential Handlers that they have been previously installed by the user and that are compatible with the website's request. Once the user makes a choice, the appropriate Credential Handler is loaded and a credential event is sent to it.

The Credential Handler receives the event via a Service Worker or, if the Credential Handler Polyfill is used, a simple page with no UI elements is loaded that uses the polyfill to receive and respond to the event.

The Credential Handler must respond to the event with a credential that fulfills the request. If necessary, the Credential Handler may open a window on its website's origin to allow the user to interact with its website prior to responding. This UI can be styled and shaped according to the website owner's brand using arbitrary JavaScript and HTML like any other webpage.

This module provides utility functions to handle installing/uninstalling a Credential Handler, receiving an event, responding to an event, and forwarding an event to another window for handling after user interaction with a UI.

Without this module, a developer must setup this basic infrastructure to handle credential requests and credential storage requests and their interaction with a UI window on their own.

See also:

Install

To install locally (for development):

git clone https://github.com/digitalbazaar/web-credential-handler.git
cd web-credential-handler
npm install

To install as a dependency of another project, add this to your package.json:

"web-credential-handler": "^1.0.0"

Usage

Requiring web-credential-handler (browser)

TBD

import {installHandler, activateHandler} from 'web-credential-handler';

Installing a Credential Handler

import {installHandler} from 'web-credential-handler';

Uninstalling a Credential Handler

TBD

import {uninstallHandler} from 'web-credential-handler';

Activating a Credential Handler

TBD

import {activateHandler} from 'web-credential-handler';

Receiving a credential event in a UI window

TBD

import {receiveCredentialEvent} from 'web-credential-handler';

Getting a Credential Handler Registration

TBD

import {getHandlerRegistration} from 'web-credential-handler';

Contribute

PRs accepted.

Small note: If editing the Readme, please conform to the standard-readme specification.

Commercial Support

Commercial support for this library is available upon request from Digital Bazaar: [email protected]

License

New BSD License (3-clause) © Digital Bazaar