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

handshake-login

v0.1.1

Published

A library for authentication with Handshake names, used by validating servers and identity managers.

Downloads

7

Readme

Handshake Login

npm License Codecov GitHub issues

A (fully-typed) JavaScript library for authentication with Handshake names, for use by validating servers (websites) and identity managers.

Features

  • Add Login with Handshake to your website
  • Build Identity Managers
  • Use without any intermediaries (OAuth servers, etc.)
  • Works in NodeJs and Browsers
  • Supports multiple strategies

Demo

This library is used in an example Express server (repo). Try it out at https://sample-hs-login-server.herokuapp.com/.

It is also used in an identity manager.

Installation

NodeJs: Requires NodeJs v16+ if used on the server-side as it depends on native SubtleCrypto. Browsers: The v16+ requirement doesn't apply if it is used in a browser context (so a React/Vue app being developed with NodeJs v14 is fine.)

Install it with:

npm install --save handshake-login
# or
yarn add handshake-login

Usage/Examples

Websites

To add Login With Handshake to your website, only 2 main methods are needed: one to generate a request URL and another to verify the response on callback.

const hLogin = new HandshakeLogin();
const requestUrl = await hLogin.generateRequestUrl({
  domain: 'example',
  challenge: 'randomly-generated-challenge---keep-track-server-side',
  callbackUrl: 'http://localhost:3000/callback',
});
// Redirect to requestUrl

// On Callback
const hLogin = new HandshakeLogin();
const responseData = hLogin.parseResponseDataFromUrl(url);
const verified = await hLogin.verifyResponseData(req.session.challenge);
// Authenticate based on `verified` boolean
// That's it!

Check out this example Express server for a compelete example.

Identity Managers / Other Use Cases

Documentation is generated and explains all public methods. Check out this identity manager for how the different methods can be used.

Documentation

Generated documentation (with TypeDoc) is available at https://rithvikvibhu.github.io/handshake-login/.

Running Tests

To run tests, run the following command:

npm run test

Code coverage reports can be generated with:

npm run cov

Contributing

Contributions are always welcome! However, please create an issue before starting any work so there won't be any repeated/wasted effort.

To add new strategies, have a look at lib/strategies/. Similar to existing ones, create a new folder and make the class inherit the AbstractStrategy class.

Development

Clone the project

git clone [email protected]:rithvikvibhu/handshake-login.git
cd handshake-login

Install dependencies

npm install

In 2 terminals, start the build and test watchers

# in parallel:
npm run watch:build
npm run watch:test

For one-time runs:

npm run build
npm run test

Acknowledgements